Installing 4.3 BSD Quasijarus on SIMH

From Computer History Wiki
Revision as of 23:40, 6 February 2009 by Neozeed (talk | contribs) (boot.ini)
Jump to: navigation, search

This is the procedure that I have used to install 4.3 BSD onto SIMH's MicroVAX II emulator. Please note that this is the Quasijarus release of 4.3 BSD.

Requirements

You will need the following materials to put together a 4.3 BSD Quasijarus installation:

  • A working perl interpeter to make the tape images.
  • A copy of gzip.
  • A working C compiler.
  • A method of extracting the boot file from either the binaries (tar/gzip) or uudecode to extract it from here.
  • A compiled binary of vax from SIMH, along with the ka655x.bin again from SIMH.


You will need the following files from any 4 BSD archive from the Quasijarus0c directory. I have used the files from [1]. You can use whatever method you like to download them, wget, a web browser etc..

stand.Z
miniroot.Z
rootdump.Z
usr.tar.Z
srcsys.tar.Z
src.tar.Z

gzcompat

Next it's easier on a host machine to convert the downloaded Quasijarus files into gzip, then uncompress them using gzip. For this you will need the gzcompat program. I've included the sourcecode on the link, as it's getting harder to find.. Simply compile the gzcompat.c into an exe. It should be somewhat straightforward. The last known place to download gzcompat is [here].

On most instances with gcc simply run:

gcc gzcompat.c -o gzcompat

And that should be it.

Preparing for installation

With the files downloaded you will need to uncompress them all and then create the tape file. With the different compression this will be somewhat involved.

The following command will decompress the tape files, on a UNIX install. For Windows users, use the type command, instead of cat.

cat miniroot.Z | gzcompat | gzip -dc > miniroot
cat rootdump.Z | gzcompat | gzip -dc > rootdump
cat src.tar.Z | gzcompat | gzip -dc > src.tar
cat srcsys.tar.Z | gzcompat | gzip -dc > srcsys.tar
cat stand.Z | gzcompat | gzip -dc > stand
cat usr.tar.Z | gzcompat | gzip -dc > usr.tar

The tape needs to be created with the mkdisttap.pl program. Simply run the program and redirect it into a file called quas.tap .

% ./mkdisttap.pl  > quas.tap
% ls -l quas.tap
-rw-r--r--  1 Neozeed  None_ploc  84450876 Feb  6 17:10 quas.tap
%

Now we have our tape, so we are ready to proceed with the install. For those wondering, unlike the 11/780 emulator, the MicrovaxII can run it's microcode in a logical fashion and we are able to boot from tape in this release.

Boot 1.

I disable as many of the devices as possible to get a 'clean' install. So this is the install.ini that I'm going to use.

install.ini

set cr dis
set lpt dis
set rl dis
set ry dis
set ts dis
set xq dis
set rq0 ra82
att rq0 quas.dsk
set rq1 dis
set rq2 dis
set rq3 dis
att tq0 quas.tap
set tti 7b
set tto 7b
boot cpu

Booting the emulator

You then simply run the emulator and pass it the config file.

C:\Quasijarus0c\work>vax.exe install.ini

VAX simulator V3.8-0
RQ: creating new file
Loading boot code from ka655x.bin

←[c
KA655-B V5.3, VMB 2.7
Performing normal system tests.
40..39..38..37..36..35..34..33..32..31..30..29..28..27..26..25..
24..23..22..21..20..19..18..17..16..15..14..13..12..11..10..09..
08..07..06..05..04..03..
Tests completed.
>>>boot mua0:
(BOOT/R5:0 MUA0



  2..
-MUA0
  1..0..

=

Once the BIOS has done it's POST, it will prompt what device to boot off of at the >>> prompt. The first tape device is mua0:. Once the tape has done the first boot you'll be greeted with the = prompt. From here we are going to load the copy program. Simply type in the following:

copy
tms(0,1)
ra(0,1)

This will copy the second file onto tape, onto the second file position on our hard disk. The output should be the following:

=copy
cpu: uVAX 3000
From: tms(0,1)
To: ra(0,1)
ra0: unlabeled
Copy completed: 308 records copied
=

Next we run the boot program. Simply type in the following:

boot
ra(0,1)vmunix

The resulting output should be the following. The kernel will then prompt for the root partition.

=boot
cpu: uVAX 3000

Boot
: ra(0,1)vmunix
ra0: unlabeled
326312+104440+130352 start 0x23b8
4.3 BSD Quasijarus UNIX #3: Sat Feb 14 20:31:03 PST 2004
    root@luthien.Harhan.ORG:/nbsd/usr/src/sys/GENERIC
real mem  = 16744448
SYSPTSIZE limits number of buffers to 112
avail mem = 14920704
using 112 buffers containing 917504 bytes of memory
MicroVAX 3000, ucode rev 6
tmscp0 at uba0 csr 174500 vec 774, ipl 15
tms0 at tmscp0 slave 0
tms1 at tmscp0 slave 1
uda0 at uba0 csr 172150 vec 770, ipl 15
uda0: version 3 model 3
uda0: DMA burst size set to 4
ra0 at uda0 slave 0: no disk label: ra81, size = 891072 sectors
dz0 at uba0 csr 160100 vec 300, ipl 15
dz1 at uba0 csr 160110 vec 310, ipl 15
dz2 at uba0 csr 160120 vec 320, ipl 15
dz3 at uba0 csr 160130 vec 330, ipl 15
root device?

We will answer with the first ra disk, in a special format, because we have not put a disklabel onto the disk yet.

ra0*

Once the disk has been mounted we will be dumped to the root prompt. The next step will be creating the default disk label.

Creating the disk label

Using the disklabel command we will setup the slices automatically (it's done from a file disktab) then install the boot programs. This way we can boot from disk.

Simply type in:

disklabel -rw ra0 ra82 “Quasijarus” /usr/mdec/rdboot /usr/mdec/bootra

And the disk will now be labled, and bootable from the firmware.

Restoring the rootdump

From here we are now running from the miniroot. The next step is to run the xtr program to restore the root, and then shutdown the emulator. Enter in the command:

disk=ra0 type=ra82 tape=tms xtr

And the following will happen:

# disk=ra0 type=ra82 tape=tms xtr
Build root file system
Warning: 361 sector(s) in last cylinder unallocated
/dev/rra0a:     15884 sectors in 19 cylinders of 15 tracks, 57 sectors
        8.1MB in 2 cyl groups (16 c/g, 7.00MB/g, 3200 i/g)
super-block backups (for fsck -b #) at:
 32, 13776,
Check the file system
** /dev/rra0a
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1 files, 1 used, 7092 free (20 frags, 884 blocks, 0.3% fragmentation)
Rewind tape
Restore the dump image of the root
** /dev/rra0a
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
426 files, 5195 used, 1898 free (18 frags, 235 blocks, 0.3% fragmentation)
Root filesystem extracted

If this is an 8650 or 8600, update the console rl02
If this is a 780 or 785, update the floppy
If this is a 730, update the cassette
#

After this stage, I just sync the disk a few times, then halt the emulator (CONTROL+E) and exit out. Now we are ready for stage two.

If this is a 730, update the cassette
# sync
# sync
# sync

Simulation stopped, PC: 800029AF (BNEQ 800029C6)
sim> q
Goodbye

C:\Quasijarus0c\work>

Boot 2.

Now that the install disk is prepared, we need to use a different config file to reflect us going back to a single disk/tape configuration. The new configuration is as follows:

boot.ini

set cr dis
set lpt dis
set rl dis
set ry dis
set ts dis
set xq dis
set rq0 ra82
att rq0 quas.dsk
set rq1 dis
set rq2 dis
set rq3 dis
att tq0 quas.tap
set tti 7b
set tto 7b
att nvram nvram.dat
dep bdr 1
boot cpu

Booting the emulator

Now boot up the emulator with the boot.ini

C:\4.3BSD\work>vax780.exe boot.ini

VAX780 simulator V3.8-0
loading ra(0,0)boot
Boot
: ra(0,0)vmunix
279844+80872+100324 start 0x12f8
4.3 BSD UNIX #1: Fri Jun  6 19:55:29 PDT 1986
    karels@monet.Berkeley.EDU:/usr/src/sys/GENERIC
real mem  = 8388608
SYSPTSIZE limits number of buffers to 140
avail mem = 7187456
using 140 buffers containing 524288 bytes of memory
mcr0 at tr1
mcr1 at tr2
uba0 at tr3
hk0 at uba0 csr 177440 vec 210, ipl 15
rk0 at hk0 slave 0
rk1 at hk0 slave 1
rk2 at hk0 slave 2
rk3 at hk0 slave 3
uda0 at uba0 csr 172150 vec 774, ipl 15
ra0 at uda0 slave 0
zs0 at uba0 csr 172520 vec 224, ipl 15
ts0 at zs0 slave 0
dz0 at uba0 csr 160100 vec 300, ipl 15
dz1 at uba0 csr 160110 vec 310, ipl 15
dz2 at uba0 csr 160120 vec 320, ipl 15
dz3 at uba0 csr 160130 vec 330, ipl 15
Changing root device to ra0a
Automatic reboot in progress...
Thu Feb  6 07:35:07 PST 1986
Can't open checklist file: /etc/fstab
Automatic reboot failed... help!
erase ^?, kill ^U, intr ^C
#

Preparing the disk

Now we have to prep the machine for both the tape, and the type of disk. Type in the following commands.

# disk=ra
# name=ra0h;type=ra81
# cd /dev
# sh ./MAKEDEV ts0;sync
# cd /
# newfs $name $type

The output will be like this:

# disk=ra
# name=ra0h;type=ra81
# cd /dev
# sh ./MAKEDEV ts0;sync
# cd /
# newfs $name $type
Warning: 680 sector(s) in last cylinder unallocated
/dev/rra0h:     291346 sectors in 409 cylinders of 14 tracks, 51 sectors
        149.2Mb in 26 cyl groups (16 c/g, 5.85Mb/g, 2048 i/g)
super-block backups (for fsck -b#) at:
 32, 11520, 23008, 34496, 45984, 57472, 68960, 80448, 91936, 103424,
 114912, 126400, 137888, 149376, 160864, 172352, 182816, 194304, 205792, 217280,
 228768, 240256, 251744, 263232, 274720, 286208,
#

Restoring the usr slice

The disk's /usr slice will not have been formatted. We can not go ahead and mount it, and restore the /usr files. Then we unmount the slice, and run fsck to make sure everything is ok.

# mount /dev/$name /usr
# cd /usr
# mkdir sys
# cd sys
# mt rew
# mt fsf 3
# tar xpbf 20 /dev/rmt12
# cd ..
# mt fsf
# tar xpbf 20 /dev/rmt12
# cd /
# chmod 755 / /usr /usr/sys
# rm -rf sys
# ln -s /usr/sys sys
# umount /dev/$name
# fsck /dev/r$name

Likewise, the output should be similar to this:

# mount /dev/$name /usr
# cd /usr
# mkdir sys
# cd sys
# mt rew
# mt fsf 3
# tar xpbf 20 /dev/rmt12
# cd ..
# mt fsf
# tar xpbf 20 /dev/rmt12
# cd /
# chmod 755 / /usr /usr/sys
# rm -rf sys
# ln -s /usr/sys sys
# umount /dev/$name
# fsck /dev/r$name
** /dev/rra0h
** Last Mounted on /usr
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
4645 files, 35630 used, 102954 free (162 frags, 12849 blocks, 0.1% fragmentation)
#

Configuring the fstab

Now we just need to create the fstab, format the 'home' slice, and then we can reboot the emulator into multiuser mode. Enter in the following commands:

# cd /etc
# cp fstab.ra81 fstab
# newfs ra0g ra81
# sync
# reboot

And the expected output is as follows:

# cp fstab.ra81 fstab
# newfs ra0g ra81
/dev/rra0g:     515508 sectors in 722 cylinders of 14 tracks, 51 sectors
        263.9Mb in 46 cyl groups (16 c/g, 5.85Mb/g, 2048 i/g)
super-block backups (for fsck -b#) at:
 32, 11520, 23008, 34496, 45984, 57472, 68960, 80448, 91936, 103424,
 114912, 126400, 137888, 149376, 160864, 172352, 182816, 194304, 205792, 217280,

 228768, 240256, 251744, 263232, 274720, 286208, 297696, 309184, 320672, 332160,

 343648, 355136, 365600, 377088, 388576, 400064, 411552, 423040, 434528, 446016,

 457504, 468992, 480480, 491968, 503456, 514944,
# sync
# reboot
syncing disks... done

Reboot requested, PC: 8002B03A (MOVL 8004F628,R0)
sim> q
Goodbye

First Multiuser Boot

Now we can just re-run the last command, and we should boot multiuser! By default there is no root password. Also the system will run fsck uppon boot, so depending on your host computer this could take a while.


C:\4.3BSD\work>vax780.exe boot.ini

VAX780 simulator V3.8-0
loading ra(0,0)boot
Boot
: ra(0,0)vmunix
279844+80872+100324 start 0x12f8
4.3 BSD UNIX #1: Fri Jun  6 19:55:29 PDT 1986
    karels@monet.Berkeley.EDU:/usr/src/sys/GENERIC
real mem  = 8388608
SYSPTSIZE limits number of buffers to 140
avail mem = 7187456
using 140 buffers containing 524288 bytes of memory
mcr0 at tr1
mcr1 at tr2
uba0 at tr3
hk0 at uba0 csr 177440 vec 210, ipl 15
rk0 at hk0 slave 0
rk1 at hk0 slave 1
rk2 at hk0 slave 2
rk3 at hk0 slave 3
uda0 at uba0 csr 172150 vec 774, ipl 15
ra0 at uda0 slave 0
zs0 at uba0 csr 172520 vec 224, ipl 15
ts0 at zs0 slave 0
dz0 at uba0 csr 160100 vec 300, ipl 15
dz1 at uba0 csr 160110 vec 310, ipl 15
dz2 at uba0 csr 160120 vec 320, ipl 15
dz3 at uba0 csr 160130 vec 330, ipl 15
Changing root device to ra0a
Automatic reboot in progress...
Thu Feb  6 07:43:43 PST 1986
/dev/ra0a: 330 files, 4200 used, 3229 free (5 frags, 403 blocks, 0.1% fragmentat
ion)
/dev/rra0h: 4645 files, 35630 used, 102954 free (162 frags, 12849 blocks, 0.1% f
ragmentation)
/dev/rra0g: 2 files, 9 used, 245216 free (16 frags, 30650 blocks, 0.0% fragmenta
tion)
Thu Feb  6 07:43:50 PST 1986
checking quotas: done.
starting system logger
checking for core dump... /a/crash: No such file or directory

Feb  6 07:43:51 myname savecore: /a/crash: No such file or directory
starting local daemons:Feb  6 07:43:51 myname named[53]: /etc/named.boot: No suc
h file or directory
 named sendmail.
preserving editor files
clearing /tmp
standard daemons: update cron accounting.
starting network daemons: rwhod inetd printer.
Thu Feb  6 07:43:52 PST 1986
Feb  6 07:43:54 myname getty: /dev/tty03: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty02: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty05: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty04: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty07: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty06: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty00: No such file or directory
Feb  6 07:43:54 myname getty: /dev/tty01: No such file or directory


4.3 BSD UNIX (myname.my.domain) (console)

login:


Now we can simply logon as root.

login: root
Feb  6 07:43:56 myname login: ROOT LOGIN console
4.3 BSD UNIX #1: Fri Jun  6 19:55:29 PDT 1986

Would you like to play a game?

Don't login as root, use su
myname#

From here you can explore the system. All of the man pages are installed, and there is enough of a base system to get going. Sadly there are bugs in how 4.2 BSD and how SIMH interact with the networking, and it is not reliable. As sad as it is to be an 'island' you can however setup the dz serial interface to allow more than one user.

Enabling remote users

Inside of BSD 4.3 you will have to create the dz device files. Simply logon as root, and run the following commands:

cd /dev
sh ./MAKEDEV dz0

Next, shutdown the OS, and add the following lines into the boot.ini (just make sure they are above the boot command or it'll not work correctly..

set dz lines=8
att dz 8888
set dz 7b

I would also recommend to windows users, either putty, or syncterm. The default telnet client sucks.