mirror of
https://github.com/DoctorWkt/unix-jun72.git
synced 2026-03-10 12:48:57 +00:00
- Added the boot stuff from James.
We may want to move the location of the various files at some point, but I wanted to make sure it got into the svn.
This commit is contained in:
47
boot/README
Normal file
47
boot/README
Normal file
@@ -0,0 +1,47 @@
|
||||
UNIX V1 bootstrap
|
||||
|
||||
The UNIX V1 bootstrap procedure is described in UNIX_ProgammersManual_Nov71.pdf,
|
||||
section BOOT PROCEDURES (VII).
|
||||
|
||||
To install the bootstrap and kernel, prior to running the V1 system, use
|
||||
the boot/installboot command. This will install the bos program as well
|
||||
as the recently-built kernel from build/loadfile into the warm boot area
|
||||
of the rf0 disk:
|
||||
|
||||
boot/installboot
|
||||
|
||||
The system can be warm booted with:
|
||||
|
||||
tools/pdp11 boot/simh.cfg
|
||||
|
||||
Alternatively, everything can be installed while running under the V1 system
|
||||
using the following procedure:
|
||||
|
||||
First, build the support programs: bos and msys
|
||||
|
||||
chdir /usr/boot
|
||||
sh run
|
||||
|
||||
Install the bootstrap and unix:
|
||||
|
||||
msys b bos
|
||||
msys u wunix
|
||||
|
||||
If you build a kernel under V1, then you can install it into the warm
|
||||
boot area with:
|
||||
|
||||
msys u name_of_kernel
|
||||
|
||||
You can install it into the cold boot area (such as for testing) with:
|
||||
|
||||
msys 1 name_of_kernel
|
||||
|
||||
The default installation does not copy an image into the cold boot area.
|
||||
However, if the cold boot area is being used for testing new kernels,
|
||||
then the kernel can be bootstrapped using:
|
||||
|
||||
tools/pdp11 boot/simh_cold.cfg
|
||||
|
||||
NOTE: the 32W bootstrap normally resides at location 173700, but because the
|
||||
simulator does not have memory at that location, the current bootstrap is
|
||||
copied into 073700 in the simulator. This does not change the behavior at all.
|
||||
22
boot/installboot
Executable file
22
boot/installboot
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
RF0IMAGE=rf0.dsk
|
||||
KERNEL=build/loadfile
|
||||
BOS=boot/bos
|
||||
|
||||
if [ ! -f $KERNEL ]
|
||||
then echo "You must build the kernel, $KERNEL, before you can install"
|
||||
echo "the bootstrap."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install bos 32KW below the top of the rf0 image
|
||||
#
|
||||
dd if=$BOS of=$RF0IMAGE bs=512 seek=960
|
||||
|
||||
# Install Unix in the warm boot area, 31KW below the top of the
|
||||
# rf0 image. Because the kernel is in simh load format, the first
|
||||
# 6 bytes are skipped and the following 16K byte are copied onto
|
||||
# the rf0 disk.
|
||||
#
|
||||
dd if=$KERNEL bs=1 skip=6 count=16384 | dd of=$RF0IMAGE bs=512 seek=964
|
||||
BIN
boot/m792low.load
Normal file
BIN
boot/m792low.load
Normal file
Binary file not shown.
30
boot/m792low.s
Normal file
30
boot/m792low.s
Normal file
@@ -0,0 +1,30 @@
|
||||
/ UNIX bootstrap ROM, based on BOOT PROCEDURES (VII) 11/3/71
|
||||
|
||||
. = 73700
|
||||
|
||||
/ 173700 -- load bos from 1700000 of rf0 (RF11)
|
||||
|
||||
mov $177472,r0
|
||||
mov $3,-(r0) / rf11.dae.ta[6:5] = 3
|
||||
mov $140000,-(r0) / rf11.dar = 140000
|
||||
mov $54000,-(r0) / rf11.cma = 54000
|
||||
mov $-2000,-(r0) / rf11.wc = -2000 (1K words)
|
||||
mov $5,-(r0) / rf11.dcs = read,go
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
jmp *$54000 / jump to bos
|
||||
|
||||
/ 173740 -- load from tap0 (TC11 DECtape)
|
||||
|
||||
mov $177350,r0
|
||||
clr -(r0) / tc11.tcba = 0
|
||||
mov r0,-(r0) / tc11.tcwc = 177346 (282. bytes)
|
||||
mov $3,-(r0) / tc11.tccm = rnum,do
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
tst *$177350 / block 0?
|
||||
bne . / no, loop forever
|
||||
movb $5,(r0) / tc11.tccm = rdata,do
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
clr pc / jump to location 0
|
||||
BIN
boot/m792uv1.load
Normal file
BIN
boot/m792uv1.load
Normal file
Binary file not shown.
30
boot/m792uv1.s
Normal file
30
boot/m792uv1.s
Normal file
@@ -0,0 +1,30 @@
|
||||
/ UNIX bootstrap ROM, based on BOOT PROCEDURES (VII) 11/3/71
|
||||
|
||||
. = 173700
|
||||
|
||||
/ 173700 -- load bos from 1700000 of rf0 (RF11)
|
||||
|
||||
mov $177472,r0
|
||||
mov $3,-(r0) / rf11.dae.ta[6:5] = 3
|
||||
mov $140000,-(r0) / rf11.dar = 140000
|
||||
mov $54000,-(r0) / rf11.cma = 54000
|
||||
mov $-2000,-(r0) / rf11.wc = -2000 (1K words)
|
||||
mov $5,-(r0) / rf11.dcs = read,go
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
jmp *$54000 / jump to bos
|
||||
|
||||
/ 173740 -- load from tap0 (TC11 DECtape)
|
||||
|
||||
mov $177350,r0
|
||||
clr -(r0) / tc11.tcba = 0
|
||||
mov r0,-(r0) / tc11.tcwc = 177346 (282. bytes)
|
||||
mov $3,-(r0) / tc11.tccm = rnum,do
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
tst *$177350 / block 0?
|
||||
bne . / no, loop forever
|
||||
movb $5,(r0) / tc11.tccm = rdata,do
|
||||
tstb (r0) / done?
|
||||
bge .-2 / no, loop
|
||||
clr pc / jump to location 0
|
||||
23
boot/simh.cfg
Normal file
23
boot/simh.cfg
Normal file
@@ -0,0 +1,23 @@
|
||||
#!tools/pdp11
|
||||
set cpu 11/20
|
||||
set cpu 32K
|
||||
set rk0 enabled
|
||||
att rk0 rk0.dsk
|
||||
set rf 2p
|
||||
set rf enabled
|
||||
attach rf rf0.dsk
|
||||
set tc enabled
|
||||
att tc tape
|
||||
set hk disabled
|
||||
set rha disabled
|
||||
set tm disabled
|
||||
set rx disabled
|
||||
set rl disabled
|
||||
set tq disabled
|
||||
set tc enabled
|
||||
set rf enabled
|
||||
set ke enabled
|
||||
set cpu history=1000
|
||||
load boot/m792low.load
|
||||
d sr 173700
|
||||
go 73700
|
||||
23
boot/simh_cold.cfg
Normal file
23
boot/simh_cold.cfg
Normal file
@@ -0,0 +1,23 @@
|
||||
#!tools/pdp11
|
||||
set cpu 11/20
|
||||
set cpu 32K
|
||||
set rk0 enabled
|
||||
att rk0 rk0.dsk
|
||||
set rf 2p
|
||||
set rf enabled
|
||||
attach rf rf0.dsk
|
||||
set tc enabled
|
||||
att tc tape
|
||||
set hk disabled
|
||||
set rha disabled
|
||||
set tm disabled
|
||||
set rx disabled
|
||||
set rl disabled
|
||||
set tq disabled
|
||||
set tc enabled
|
||||
set rf enabled
|
||||
set ke enabled
|
||||
set cpu history=1000
|
||||
load boot/m792low.load
|
||||
d sr 1
|
||||
go 73700
|
||||
78
fs/usr/boot/bos.s
Normal file
78
fs/usr/boot/bos.s
Normal file
@@ -0,0 +1,78 @@
|
||||
/ bos -- UNIX V1 bootstrap
|
||||
/
|
||||
/ re-creation, based on description in UNIX_ProgammersManual_Nov71.pdf,
|
||||
/ page 7-06, BOOT PROCEDURES (VII)
|
||||
/ 5/6/08 jam@magic.com
|
||||
/
|
||||
/ M792 bootstrap loads this into core at 54000
|
||||
/
|
||||
/ Behavior depends on switch register:
|
||||
/ 173700 or
|
||||
/ 073700 Read Warm UNIX from RF into core location 0 and jump to 400
|
||||
/ 1 Read Cold UNIX from RF into core location 0 and jump to 400
|
||||
/ 2 Read unassigned 3K program into core location 0 and jump to 400
|
||||
/ 10 Dump 12K words from core location 0 onto DECtape drive 7
|
||||
/ 0 UNIMPLEMENTED -- should be read UNIX binary paper tape
|
||||
|
||||
csw = 177570
|
||||
|
||||
/. = 54000
|
||||
|
||||
mov $177472,r1
|
||||
mov *$csw,r0
|
||||
cmp r0,$173700
|
||||
beq warm
|
||||
cmp r0,$73700
|
||||
bne 1f
|
||||
warm:
|
||||
/ x73700 = Warm UNIX
|
||||
mov $3,-(r1) / rf0 dae = track number high bits
|
||||
mov $142000,-(r1) / rf0 dar = 256KW - 15KW
|
||||
clr -(r1) / rf0 cma = 0
|
||||
mov $-14000,-(r1) / rf0 wc = 6KW
|
||||
loadrf:
|
||||
mov $5,-(r1) / rf0 dcs = read
|
||||
tstb (r1) / rf0 done?
|
||||
bge .-2 / no, loop
|
||||
jmp *$400 / jump to loaded code
|
||||
|
||||
1:
|
||||
cmp r0,$1
|
||||
bne 1f
|
||||
|
||||
/ 0 = Cold UNIX
|
||||
mov $3,-(r1) / rf0 dae = track number high bits
|
||||
mov $156000,-(r1) / rf0 dar = 256KW - 9KW
|
||||
clr -(r1) / rf0 cma = 0
|
||||
mov $-14000,-(r1) / rf0 wc = 6KW
|
||||
br loadrf
|
||||
|
||||
1:
|
||||
cmp r0,$2
|
||||
bne 1f
|
||||
|
||||
/ 2 = Unassigned 3K
|
||||
mov $3,-(r1) / rf0 dae = track number high bits
|
||||
mov $172000,-(r1) / rf0 dar = 256KW - 3KW
|
||||
clr -(r1) / rf0 cma = 0
|
||||
mov $-6000,-(r1) / rf0 wc = 3KW
|
||||
br loadrf
|
||||
|
||||
1:
|
||||
cmp r0,$10
|
||||
bne 1f
|
||||
|
||||
/ 10 = Dump 12K to DECtape drive 7
|
||||
mov $177350,r1
|
||||
clr -(r1) / tc11 tcba = 0
|
||||
mov $-30000,-(r1) / tc11 tcwc = 12KW
|
||||
mov $3415,-(r1) / tc11 tccm = UNIT=7,WDATA,DO
|
||||
tstb (r1) / tc11 done?
|
||||
bge .-2 / no, loop
|
||||
2:
|
||||
halt
|
||||
br 2b
|
||||
|
||||
1:
|
||||
halt / Unrecognized switch setting
|
||||
br 1b
|
||||
87
fs/usr/boot/msys.s
Normal file
87
fs/usr/boot/msys.s
Normal file
@@ -0,0 +1,87 @@
|
||||
/ msys -- copy file to RF read only slot
|
||||
/
|
||||
/ re-creation, based on description in UNIX_ProgammersManual_Nov71.pdf,
|
||||
/ page 7-06, BOOT PROCEDURES (VII)
|
||||
/ 5/9/08 jam@magic.com
|
||||
|
||||
/ b bos 1700
|
||||
/ u warm unix 1704
|
||||
/ 1 cold unix 1734
|
||||
/ 2 unassigned 1764
|
||||
|
||||
mov sp,r5
|
||||
mov (r5)+,r3 / argc
|
||||
cmp $3,r3 / must be 3
|
||||
bne badcmd / else error
|
||||
tst (r5)+
|
||||
mov (r5)+,r4 / get first arg
|
||||
|
||||
cmpb (r4),$'b
|
||||
bne 1f
|
||||
mov $1700,r3
|
||||
br 2f
|
||||
1:
|
||||
cmpb (r4),$'u
|
||||
bne 1f
|
||||
mov $1704,r3
|
||||
br 2f
|
||||
1:
|
||||
cmpb (r4),$'1
|
||||
bne 1f
|
||||
mov $1734,r3
|
||||
br 2f
|
||||
1:
|
||||
cmpb (r4),$'2
|
||||
bne badcmd
|
||||
mov $1764,r3
|
||||
2:
|
||||
|
||||
/ open file
|
||||
mov (r5),r4
|
||||
mov r4,0f
|
||||
sys open; 0:..; 0
|
||||
bes error
|
||||
mov r0,r1
|
||||
|
||||
/ open rf0 and seek to correct block
|
||||
sys open; disk; 1
|
||||
bes error
|
||||
mov r0,r2
|
||||
mov r3,0f
|
||||
sys seek; 0:..; 0
|
||||
bes error
|
||||
|
||||
/ copy file from file to disk one block at a time
|
||||
1:
|
||||
mov r1,r0
|
||||
sys read; buf; 512.
|
||||
mov r0,r4
|
||||
mov r2,r0
|
||||
sys write; buf; 512.
|
||||
bes error
|
||||
tst r4
|
||||
bne 1b
|
||||
|
||||
sys exit
|
||||
|
||||
error:
|
||||
mov $1,r0
|
||||
sys write; 1f; 2
|
||||
4
|
||||
sys exit
|
||||
1:
|
||||
<?\n>
|
||||
|
||||
badcmd:
|
||||
mov $1,r0
|
||||
sys write; 1f; 2
|
||||
4
|
||||
sys exit
|
||||
1:
|
||||
<?\n>
|
||||
|
||||
disk:
|
||||
</dev/rf0\0>
|
||||
.even
|
||||
|
||||
buf: .=.+512.
|
||||
4
fs/usr/boot/run
Normal file
4
fs/usr/boot/run
Normal file
@@ -0,0 +1,4 @@
|
||||
as bos.s
|
||||
mv a.out bos
|
||||
as msys.s
|
||||
mv a.out msys
|
||||
BIN
fs/usr/boot/wunix
Normal file
BIN
fs/usr/boot/wunix
Normal file
Binary file not shown.
Reference in New Issue
Block a user