Difference between pages "Installing 4.2 BSD on SIMH" and "4.2 BSD"

From Computer History Wiki
(Difference between pages)
Jump to: navigation, search
(Boot 2.)
 
m (dab Sub, + a few links)
 
Line 1: Line 1:
This is the procedure that I have used to install 4.2 BSD onto SIMH's vax 11/780 emulator.
+
{{Infobox OS
 +
| image = 42bsd.png
 +
| caption = Logging into a 4.2 BSD system
 +
| name = 4.2 BSD
 +
| creator = CSRG, University of California, Berkeley
 +
| current version = 4.2 (1983)
 +
| year introduced = 1983
 +
| type = Multitasking, multiuser
 +
| architecture = [[VAX]], [[Sun Microsystems|Sun]] theoretically portable
 +
}}
  
== Requirements ==
+
'''4.2 BSD''' follows the betas of 4.1a & 4.1b.  4.2 BSD Is special because it incorporates the first versions of BSD [[TCP/IP]], and [[BSD Fast File System|FFS]]. 4.2 BSD addresses the performance issues that are reported in [[4.0 BSD]].  The prior versions of 4.1x BSD were the 'test' versions onward to the stable version of 4.2 . This release is also the last that was led by [[Bill Joy]], and this was used as the basis for [[SunOS]].  Later [[Sun Microsystems|Sun]] licensed [[UNIX System V|SYSV]] from AT&T and started to incorporate the two versions, before switching to the SYSV kernel in [[Solaris]]. 
  
You will need the following materials to put together a 4.2 BSD installation:
+
It is worth noting that 4.2 BSD's TCP/IP is *NOT* compatible with 4.3 and onward, as it incorrectly handles 'negative' sequence values.
  
*A working perl interpeter to make the tape images.<br>
+
== The Cuckoo's Egg ==
*A copy of gzip.<br>
 
*A method of extracting the boot file from either the binaries (tar/gzip) or uudecode to extract it from [[boot42|here]].<br>
 
*A compiled binary of vax780 from [[SIMH]], along with the vmb.exe again from [[SIMH]].
 
  
 +
When Clifford Stoll was hunting his hacker from UCB, the BSD in widespread use was 4.2 BSD.  It's an interesting book, to take you back to what the mindset was of the people running 4.2 BSD was back then.  A PDF can be found [http://www.ci.ulsa.mx/~elinos/docencia/herseg/cuckoo_egg.pdf here].
  
You will need the following files from any 4 BSD archive from the 4.2 directory.  I have used the files from [http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/ archive.huihoo.org].  You can use whatever method you like to download them, wget, a web browser etc..<br><br>
+
=== Book information ===
 +
*The Cuckoo's Egg
 +
*Clifford Stoll
 +
*Doubleday 1989
 +
*ISBN 0-385-24946-2
  
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/ingres.tar.gz ingres.tar.gz]<br>
+
== How do I get this to run?! ==
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/miniroot.gz miniroot.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/new.tar.gz new.tar.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/rootdump.gz rootdump.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/src.tar.gz src.tar.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/srcsys.tar.gz srcsys.tar.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/stand.gz stand.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/usr.tar.gz usr.tar.gz]<br>
 
[http://unix-archive.huihoo.org/4BSD/Distributions/4.2BSD/vfont.tar.gz vfont.tar.gz]<br><br>
 
  
With the files downloaded you will need to uncompress them all and then create the tape file.
+
[[The Unix Heritage Society]]'s archives have copies of most 4-BSD variants  http://minnie.tuhs.org/TUHS/  However, they're not immediately in ready-to-use-in-SIMH tape format.  There is a repository of SIMH-ready tape images up [https://sourceforge.net/project/showfiles.php?group_id=204974&package_id=309407 here].
  
The following command will decompress the tape files.
+
4.2BSD is in ready to run format on [http://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/BSD4.2-install-0.3.exe/download sourceforge]
<pre>
 
gzip -d *.gz
 
</pre>
 
 
 
The tape needs to be created with the [[mkdisttap.pl]] program.  Simply run the program and redirect it into a file called 42.tap .
 
 
 
<pre>
 
% ./mkdisttap.pl > 42.tap
 
% ls -l 42.tap
 
-rw-r--r--  1 Neozeed  +SYSTEM  69943640 Feb  6 12:39 42.tap
 
</pre>
 
 
 
Next you will need the boot program.  I have uploaded a copy onto this wiki in uuencoded format.  To decode it, simply access the article, and copy the contents of the quoted text (the begin/end part INCLUDING the begin & end segments) and save it to a text file.  Then you will need to run the uudecode file as follows:
 
 
 
<pre>
 
% ls -l boot42.uue
 
-rw-r--r--  1 Neozeed  None_ploc  9117 Feb  6 12:09 boot42.uue
 
% uudecode boot42.uue
 
% ls -l boot42
 
-rw-------  1 Neozeed  None_ploc  6600 Feb  6 12:28 boot42
 
% file boot42
 
boot42: data
 
</pre>
 
 
 
==  Boot 1. ==
 
 
 
We are going to use the following config file to start the first phase of the installation.  Save the following configuration into a file such as 'install.ini'.  Since we are going to boot directly into the miniroot the rq1 disk will hold the installation target.  Since the 'normal' way to install is to install from tape onto the first disk, we will have to add a device file uppon boot for the second disk, and be sure to point the xtr program to the second disk.
 
 
 
=== install.ini ===
 
<pre>
 
set rq0 ra81
 
at rq0 miniroot
 
set rq1 ra81
 
at rq1 rq.dsk
 
set rq1 dis
 
set rq2 dis
 
set rq3 dis
 
set rp dis
 
set lpt dis
 
set rl dis
 
set tq dis
 
set tu dis
 
att ts 42.tap
 
set tti 7b
 
set tto 7b
 
load -o boot42 0
 
d r10 9
 
d r11 0
 
run 2
 
</pre>
 
 
 
You then simply run the emulator and pass it the config file.
 
 
 
<pre>
 
C:\4.2BSD\work>vax780 install.ini
 
 
 
VAX780 simulator V3.8-0
 
RQ: creating new file
 
1.txt> set rq1 dis
 
Command not allowed
 
loading ra(0,0)boot
 
Boot
 
: ra(0,0)vmunix
 
199488+56036+51360 start 0x11a0
 
4.2 BSD UNIX #9: Wed Nov 2 16:00:29 PST 1983
 
real mem  = 8384512
 
avail mem = 7073792
 
using 102 buffers containing 835584 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
 
uda0 at uba0 csr 172150 vec 774, ipl 15
 
ra0 at uda0 slave 0
 
ra1 at uda0 slave 1
 
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
 
root on ra0
 
WARNING: clock gained 94 days -- CHECK AND RESET THE DATE!
 
WARNING: should run interleaved swap with >= 2Mb
 
erase ^?, kill ^U, intr ^C
 
#
 
</pre>
 
 
 
From here we are now running from the miniroot.  The next steps are as follows:
 
 
 
<pre>
 
# cd /dev
 
# ./MAKEDEV ra1
 
# cd /
 
# disk=ra1 type=ra81 tape=ts xtr
 
</pre>
 
  
This will create a 'device' for the ra1 disk, then run the xtr program to restore the root dump.
+
Installation instructions for [[SIMH]] can be found at [[Installing 4.2 BSD on SIMH]].  Also there is a [[Digital Ethernet UNIBUS Network Adapter|DEUNA]] driver here: [[4.2BSD driver for DEC Deuna Ethernet board]].
  
<pre>
+
== What Runs? ==  
erase ^?, kill ^U, intr ^C
 
# cd /dev
 
# ./MAKEDEV ra1
 
# cd /
 
# disk=ra1 type=ra81 tape=ts xtr
 
Build root file system
 
Warning: 538 sector(s) in last cylinder unallocated
 
/dev/rra1a:    15884 sectors in 23 cylinders of 14 tracks, 51 se
 
        8.1Mb in 2 cyl groups (16 c/g, 5.85Mb/g, 1856 i/g)
 
super-block backups (for fsck -b#) at:
 
32, 11520,
 
Check the file system
 
** /dev/rra1a
 
** 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
 
2 files, 9 used, 7420 free (20 frags, 925 blocks)
 
Rewind tape
 
Restore the dump image of the root
 
Warning: ./lost+found: File exists
 
** /dev/rra1a
 
** 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
 
313 files, 3568 used, 3861 free (21 frags, 480 blocks)
 
Root filesystem extracted
 
  
If this is a 780, update floppy
+
Some early [[GNU]] stuff will compile, but not very much otherwise.  There is also a copy of [[Zork]], and [[rogue]] are included in this version.
If this is a 730, update the cassette
 
#
 
</pre>
 
  
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.
+
Early 1.x versions of [[gcc]] will build on 4.2 BSD, allowing you to compile early versions of [[hack]].
  
<pre>
+
On [http://sourceforge.net/projects/bsd42/files/ sourceforge], I've placed [[SIMH]] install tapes of the following:
If this is a 730, update the cassette
 
# sync
 
# sync
 
# sync
 
  
Simulation stopped, PC: 80001620 (FFS #0,#20,8003ED44,R0)
+
*[[dungeon]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/dungeon-2.5.6.binary.BSD-4.2.tap.bz2/download 2.5.6]<br>
sim> q
+
*[[flex]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/flex-2.5.4.binary.BSD-4.2.tap.bz2/download 2.5.4]<br>
Goodbye
+
*[[gcc]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/gcc-1.27.binary.BSD-4.2.tap.bz2/download 1.27]<br>
 +
*[[gcc]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/gcc-1.42.binary.BSD-4.2.tap.bz2/download 1.42]<br>
 +
*[[bison]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/bison-1.25.binary.BSD-4.2.tap.bz2/download 1.25]<br>
 +
*[[hack]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/hack-1.0.3.binary.BSD-4.2.tap.bz2/download 1.0.3]<br>
 +
*[[gzip]] [http://sourceforge.net/projects/bsd42/files/Package%20Tapes/4.2%20BSD/gzip-1.2.4.binary.BSD-4.2.tap.bz2/download 1.2.4]<br>
  
C:\4.2BSD\work>
+
== Games ==
</pre>
+
These are the games that shipped with 4.2 BSD:
 
 
 
 
== 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 ===
 
 
<pre>
 
<pre>
set rq0 ra81
+
adventure
att rq0 rq.dsk
+
arithmetic 
set rq1 dis
+
backgammon 
set rq2 dis
+
banner     
set rq3 dis
+
bcd                 
set rp dis
+
bogdict     
set lpt dis
+
boggle     
set rl dis
+
btlgammon
set tq dis
+
canfield   
set tu dis
+
cfscores   
att ts 42.tap
+
chess     
set tti 7b
+
cribbage   
set tto 7b
+
doctor     
load -o boot42 0
+
factor
d r10 9
+
fish       
d r11 0
+
fortune     
run 2
+
hangman   
</pre>
+
mille       
 
+
monop       
Now boot up the emulator with the boot.ini
+
number
 
+
primes     
 +
quiz       
 +
rain
 +
</pre>  
 +
* [[rogue]]
 
<pre>
 
<pre>
C:\4.2BSD\work>vax780.exe boot.ini
+
sail       
 +
snake
 +
snscore     
 +
teachgammon
 +
trek
 +
wargames
 +
worm
 +
worms
 +
wump
 +
zork
  
VAX780 simulator V3.8-0
+
{{Nav Unix}}
TS: creating new file
 
loading ra(0,0)boot
 
Boot
 
: ra(0,0)vmunix
 
199488+56036+51360 start 0x11a0
 
4.2 BSD UNIX #9: Wed Nov 2 16:00:29 PST 1983
 
real mem  = 8384512
 
avail mem = 7073792
 
using 102 buffers containing 835584 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
 
uda0 at uba0 csr 172150 vec 774, ipl 15
 
ra0 at uda0 slave 0
 
ra1 at uda0 slave 1
 
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
 
root on ra0
 
WARNING: should run interleaved swap with >= 2Mb
 
Automatic reboot in progress...
 
Mon Feb  6 05:05:49 PST 1984
 
Can't open checklist file: /etc/fstab
 
Automatic reboot failed... help!
 
erase ^?, kill ^U, intr ^C
 
#
 
</pre>
 
  
Now we have to prep the machine for both the tape, and the type of disk.  Type in the following commands.
+
[[Category: CSRG BSD]]
 
 
<pre>
 
# disk=ra
 
# name=ra0h;type=ra81
 
# cd /dev
 
# ./MAKEDEV ts0;sync
 
# cd /
 
# newfs $name $type
 
</pre>
 
 
 
The output will be like this:
 
 
 
<pre>
 
# disk=ra
 
# name=ra0h;type=ra81
 
# cd /dev
 
# ./MAKEDEV ts0;sync
 
# cd /
 
# newfs $name $type
 
Warning: 28 sector(s) in last cylinder unallocated
 
/dev/rra0h:    759668 sectors in 1064 cylinders of 14 tracks, 51 sectors
 
        389.0Mb in 67 cyl groups (16 c/g, 5.85Mb/g, 2048 i/g)
 
super-block backups (for fsck -b#) at:
 
32, 11512, 22992, 34472, 45952, 57432, 68912, 80392, 91872, 103352,
 
114832, 126312, 137792, 149272, 160752, 172232, 182816, 194296, 205776, 217256,
 
228736, 240216, 251696, 263176, 274656, 286136, 297616, 309096, 320576, 332056,
 
343536, 355016, 365600, 377080, 388560, 400040, 411520, 423000, 434480, 445960,
 
457440, 468920, 480400, 491880, 503360, 514840, 526320, 537800, 548384, 559864,
 
571344, 582824, 594304, 605784, 617264, 628744, 640224, 651704, 663184, 674664,
 
686144, 697624, 709104, 720584, 731168, 742648, 754128,
 
#
 
</pre>
 
 
 
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.
 
 
 
<pre>
 
# 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
 
</pre>
 

Revision as of 11:31, 28 January 2023


4.2 BSD
42bsd.png
Logging into a 4.2 BSD system
Type: Multitasking, multiuser
Creator: CSRG, University of California, Berkeley
Architecture: VAX, Sun theoretically portable
This Version: 4.2 (1983)
Date Released: 1983


4.2 BSD follows the betas of 4.1a & 4.1b. 4.2 BSD Is special because it incorporates the first versions of BSD TCP/IP, and FFS. 4.2 BSD addresses the performance issues that are reported in 4.0 BSD. The prior versions of 4.1x BSD were the 'test' versions onward to the stable version of 4.2 . This release is also the last that was led by Bill Joy, and this was used as the basis for SunOS. Later Sun licensed SYSV from AT&T and started to incorporate the two versions, before switching to the SYSV kernel in Solaris.

It is worth noting that 4.2 BSD's TCP/IP is *NOT* compatible with 4.3 and onward, as it incorrectly handles 'negative' sequence values.

The Cuckoo's Egg

When Clifford Stoll was hunting his hacker from UCB, the BSD in widespread use was 4.2 BSD. It's an interesting book, to take you back to what the mindset was of the people running 4.2 BSD was back then. A PDF can be found here.

Book information

  • The Cuckoo's Egg
  • Clifford Stoll
  • Doubleday 1989
  • ISBN 0-385-24946-2

How do I get this to run?!

The Unix Heritage Society's archives have copies of most 4-BSD variants http://minnie.tuhs.org/TUHS/ However, they're not immediately in ready-to-use-in-SIMH tape format. There is a repository of SIMH-ready tape images up here.

4.2BSD is in ready to run format on sourceforge

Installation instructions for SIMH can be found at Installing 4.2 BSD on SIMH. Also there is a DEUNA driver here: 4.2BSD driver for DEC Deuna Ethernet board.

What Runs?

Some early GNU stuff will compile, but not very much otherwise. There is also a copy of Zork, and rogue are included in this version.

Early 1.x versions of gcc will build on 4.2 BSD, allowing you to compile early versions of hack.

On sourceforge, I've placed SIMH install tapes of the following:

Games

These are the games that shipped with 4.2 BSD:

adventure
arithmetic   
backgammon   
banner       
bcd                  
bogdict      
boggle       
btlgammon
canfield     
cfscores     
chess       
cribbage     
doctor       
factor
fish         
fortune      
hangman     
mille        
monop        
number
primes       
quiz         
rain
sail         
snake
snscore      
teachgammon
trek
wargames
worm
worms
wump
zork