# Silence SIMH interspersions. set quiet # The kernel is configured for a PDP-11/40. set cpu 11/40 # Attach the bootstrap tape. set tm0 locked attach tm0 rp.tap # Attach a new disk for the root filesystem (SIMH rr is RP03 and rp is RP04). set rp disable set rr enable set rr rp11ce set rr0 rp03 attach rr0 root.rp # Copy the root filesystem from rp.tap onto root.rp. nosend noexpect expect "=" send "copy\r"; go # Copy to rp03 disk. expect "'p' for rp03;'f' for rf; 'k' for rk;'4' for rp04" send "p"; go # Copy from tm11 tape. expect "'m' for tm11; 'u' for tu16;'c' for tc11" send "m"; go expect "disk offset" send "0\r"; go # The filesystem starts at block 84. expect "tape offset" send "84\r"; go # The filesystem is 4000 blocks long. expect "count" send "4000\r"; go expect "=" noexpect; nosend # Boot the bootstrap tape and send the above text to the console. boot -o tm0 # Attach the source tape. detach tm0 attach tm0 src.tap # Boot from the RP disk and login as root. echo send "punix\r" expect "login: " send "root\r"; go # Configure devices (mknod name b/c major minor). # Device major is defined by tables in /usr/source/opsys/conf.c. # Device minor is decoded by tmblk and rpblk with rpoffst in /usr/source/cmd2/errpt.c. # # block, tm driver (bdevsw entry 3), unit=0 (0&3) expect "# " send "/etc/mknod /dev/mt0 b 3 0\r"; go # character, tm driver (cdevsw entry 12), unit=0 (0&3) expect "# " send "/etc/mknod /dev/rmt0 c 12 0\r"; go # block, rp driver (bdevsw entry 1), unit=0 (1>>3), partition=1 (1&7), start cylinder=203 (rpoffst[1&7]) expect "# " send "/etc/mknod /dev/rp1 b 1 1\r"; go # character, rp driver (cdevsw entry 11), unit=0 (1>>3), partition=1 (1&7), start cylinder=203 (rpoffst[1&7]) expect "# " send "/etc/mknod /dev/rrp1 c 11 1\r"; go # Copy /usr/source/opsys/ from the root filesystem before mounting. expect "# " send "mkdir /tmp/opsys\r"; go expect "# " send "/usr/bin/cpall /usr/source/opsys/* /tmp/opsys\r"; go # Create a source filesystem and mount it at /usr/source/. # SIMH's RP03 geometry is 406 cylinders/drive, 20 surfaces/cylinder, and # 10 sectors/track (RP_NUMCY, RP_NUMSF, RP_NUMSC, and drv_tab[1] in pdp11_rr.c), # and this device starts at cylinder 203. # This gives (406 - 203) * 20 * 10 = 40600 blocks. expect "# " send "/etc/mkfs /dev/rrp1 40600\r"; go expect "# " send "/etc/mount /dev/rp1 /usr/source\r"; go # Uncomment the /usr/source mount in /etc/rc for future boots. expect "# " send "ed /etc/rc\r/:\\/etc\\/mount \\/dev\\/rp1 \\/usr\\/source/s/^://\rw\rq\r"; go # Copy opsys to the mount. expect "# " send "mkdir /usr/source/opsys\r"; go expect "# " send "/usr/bin/cpall /tmp/opsys/* /usr/source/opsys\r"; go expect "# " send "rm /tmp/opsys/*\r"; go expect "# " send "rmdir /tmp/opsys\r"; go # Extract the source from src.tap to /usr/source/. expect "# " send "cd /usr/source\r"; go expect "# " send "mkdir adb agen as aslib1 aslib2 bas cc clib1 clib2 clib3 clib4 clib5 clib6 clib7 cmd1 cmd2 cmd3 cmd4 cmd5 cmd6 cref1 cref2 dc fed font form fp\r"; go expect "# " send "tp xvm\r"; go expect "# " send "cd /\r"; go # Print the system name and date. expect "# " send "\rsed -n -e '/.*UNIX/s//UNIX/p' -e '/UNIX/q' /usr/sys/lib1\r"; go expect "# " send "date\r"; go # Boot the root filesystem disk and send the above text to the console. boot rr0