在simh中安装unix v6(PDP11)

去http://sourceforge.net/projects/bsd42/files/Install tapes/Research Unix/Unix-v6-Ken-Wellsch.tap.bz2/download下载Unix-v6-Ken-Wellsch.tap.bz2,解压后变成 Unix-v6-Ken-Wellsch.tap:

$mv Unix-v6-Ken-Wellsch.tap dist.tap
$ cat tboot.ini 
set cpu 11/40
set tm0 locked
attach tm0 dist.tap
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
d cpu 100000 012700
d cpu 100002 172526
d cpu 100004 010040
d cpu 100006 012740
d cpu 100010 060003
d cpu 100012 000777
g 100000

$ pdp11 tboot.ini 

PDP-11 simulator V3.9-0
Disabling XQ
RK: creating new file
RK: creating new file
RK: creating new file

^E
Simulation stopped, PC: 100012 (BR 100012)
sim> g 0
=tmrk
disk offset
0
tape offset
100
count
1
=tmrk
disk offset
1
tape offset
101
count
3999
=^E
Simulation stopped, PC: 137300 (BGE 137274)
sim> q
Goodbye
$ vi dboot.ini
$ cat dboot.ini 
set cpu 11/40
set tto 7b
set tm0 locked
attach tm0 dist.tap
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
dep system sr 173030
boot rk0

$ pdp11 dboot.ini

PDP-11 simulator V3.9-0
Disabling XQ
@rkunix
mem = 1035
RESTRICTED RIGHTS
Use, duplication or disclosure is subject to
restrictions stated in Contract with Western
Electric Company, Inc.
#  STTY -LCASE
# chdir /usr/sys/conf
# cc mkconf.c
# mv a.out mkconf
# ./mkconf
rk
tm
tc
8dc
lp
done
# as m40.s
# mv a.out m40.o
# cc -c c.c
# as l.s
# ld -x a.out m40.o c.o ../lib1 ../lib2
# mv a.out /unix
# ls -l /unix
-rwxrwxrwx  1 root    30346 Oct 10 12:37 /unix
# /etc/mknod /dev/rk0 b 0 0
# /etc/mknod /dev/rk1 b 0 1
# /etc/mknod /dev/rk2 b 0 2
# /etc/mknod /dev/mt0 b 3 0
# /etc/mknod /dev/tap0 b 4 0
# /etc/mknod /dev/rrk0 c 9 0
# /etc/mknod /dev/rrk1 c 9 1
# /etc/mknod /dev/rrk2 c 9 2
# /etc/mknod /dev/rmt0 c 12 0
# /etc/mknod /dev/lp0 c 2 0
# /etc/mknod /dev/tty0 c 3 0
# /etc/mknod /dev/tty1 c 3 1
# /etc/mknod /dev/tty2 c 3 2
# /etc/mknod /dev/tty3 c 3 3
# /etc/mknod /dev/tty4 c 3 4
# /etc/mknod /dev/tty5 c 3 5
# /etc/mknod /dev/tty6 c 3 6
# /etc/mknod /dev/tty7 c 3 7
# chmod 640 /dev/*rk*
# chmod 640 /dev/*mt*
# chmod 640 /dev/*tap*
# dd if=/dev/mt0 of=/dev/rk1 count=4000 skip=4100
4000+0 records in
4000+0 records out
# /etc/mount /dev/rk1 /usr/source
# dd if=/dev/mt0 of=/dev/rk2 count=4000 skip=8100
4000+0 records in
4000+0 records out
# mkdir /usr/doc
# /etc/mount /dev/rk1 /usr/source
mount: Mount device busy
# /etc/mount /dev/rk2 /usr/doc
# cat >> /etc/rc
/etc/mount /dev/rk1 /usr/source
/etc/mount /dev/rk2 /usr/doc
# chdir /usr/source/s1
# ed df.c
1282
/rp0/d
-2a
  "/dev/rk0",
  "/dev/rk1",
.
w
1297
q
# cc -s -O df.c
#  cp a.out /bin/df
# rm a.out
# icheck /dev/rrk0
/dev/rrk0:
spcl      22
files    294
large     96
direc     25
indir     96
used    2920
free     993
# dcheck /dev/rrk0
/dev/rrk0:
# icheck /dev/rrk1
/dev/rrk1:
spcl       0
files    595
large     98
direc     34
indir     98
used    2973
free     940
# dcheck /dev/rrk1
/dev/rrk1:
# icheck /dev/rrk2
/dev/rrk2:
bad freeblock
missing 1499
spcl       0
files    337
large     69
direc     25
indir     69
used    2222
free     192
# dcheck /dev/rrk2
/dev/rrk2:
# ed /etc/ttys
112
1,8s/^0/1/p
170
w
112
q
# sync
# sync
# sync
# synv
synv: not found
# sync
Simulation stopped, PC: 002502 (MOV (SP)+,177776)
sim> q
Goodbye

$ cat boot.ini 
set cpu 11/40
set cpu idle
set tto 7b
set tm0 locked
attach rk0 rk0
attach rk1 rk1
attach rk2 rk2
attach lpt printer.txt
set dci en
set dci lines=8
set dco 7b
att dci 5555
boot rk0
$ pdp11 boot.ini 

PDP-11 simulator V3.9-0
Disabling XQ
Listening on port 5555 (socket 8)
@unix

login: root

# cat hello.c
main()
{
   printf("Hello World!\n");
}
# cc -S hello.c
# cat hello.s
.globl  _main
.text
_main:
~~main:
jsr     r5,csv
mov     $L2,(sp)
jsr     pc,*$_printf
L1:jmp  cret
.globl
.data
L2:.byte 110,145,154,154,157,40,127,157,162,154,144,41,12,0

你可能感兴趣的:(在simh中安装unix v6(PDP11))