386BSD 0.0 on sourceforge

I didn’t realize that I never uploaded this over there. After a discussion on the passing anniversary on the TUHS mailing list I had to dig out my installed copy.

I had forgotten just how rough around the edges this was, as it’s missing quite a few utilities from the Net/2 tape, and isn’t complete enough to come up in multiuser mode, but it is capable of booting up.

Although 386BSD itself was really short lived with its effective short death in the subsequent release it paved the way for an internet only release of a BSD Unix by just 2 people. And it closed up the glaring hole of the lack of a free i386 port of Net/2.

The natural competition was Mach386, which was based around the older 4.3BSD Tahoe, and the up and coming BSDI, which had many former CSRG people which were also racing to deliver their own i386 binary / source release for sale.

One thing about this era is that you had SUN apparently forced out of the BSD business instead to work with the USL on making SYSV usable, leaving NeXT as the next big seller of BSD. The commercial world was going SYSV in a big way, and the only place that was to have a market was on the micros. And for those of us who wanted something open and free 386BSD paved the way realizing the dream of the Net/2 release. A free Unix for the common person, the true democratization of computing by letting common people use, develop and distribute it independently of any larger organization.

It’s almost a shame that GNU had stuck with the unrealized dream of a hierarchy of daemons, instead of adopting the BSD kernel with a GNU userland, on top of that tendy micro kernel Mach.

The landscape radically changed with the infamous ad proudly proclaiming “It’s UNIX”.

While USL was happy to fight both BSDI and the CSRG they never persued Bill Jolitz. And after the internet flame and lawsuit dragged on, neither of the splinter groups NetBSD or FreeBSD caught up, although both did reset upon the release of the 4.4BSD Lite 2 code.

I zipped up Bochs along with the disk here: 386BSD-0.0-with-bochs.7z

Cross Compiling 386BSD 0.1pl23 from Windows 10

I bumped the version to *current year*

Oh yes, this will be a thing!

Sure I can cross compile Linux, but what about 386BSD?  This had long been a thorn in my side, as the GCC/Binutil toolchain that is used in this early era is not GNU pure, they had been modified in all kinds of ways.  One of which was a builtin memcpy that doesn’t work the same as a normal memcpy, and the other being that the C compiler & pre-processor rely in YACC to build the tokens.  I had been using bison before, however even though bison didn’t generate any errors it build the compiler wrong enough that the majority of the kernel wouldn’t compile.

As it stands right now, the only things that do not compile is locore

to post process the kernel, symorder is used along with dbsym, although neither do any processing to the kernel file itself, so they aren’t needed to get a working system.

386BSD Release 0.1 by William and Lynne Jolitz.
Copyright (c) 1989,1990,1991,1992 William F. Jolitz. All rights reserved.
Based in part on work by the 386BSD User Community and the
BSD Networking Software, Release 2 by UCB EECS Department.
386BSD 0.1.2018 (GENERICISA) 02/02/18 15:01

Other than that, yeah it’s great, compile a kernel in under 15 seconds.

Anyone that cares, the initial release is here: 386bsd01.7z

 

More NET/2 to 386BSD 0.0 fun

I just got an email that the ‘officially sanctioned’ patches to Net/2 are still located here.  Just about every 386BSD 0.0 mirror that survives is missing these files.  So I made a copy of them on mine, here.

This dates the patches to February 26th 1992, and all the 3 1/2″ binaries being the 4th of March 1992.  And for more confusion the 5 1/4″ floppies date to the 17th of March.  The 40kb worth of user patches ended around June of 1992.

Also of interest is the Dr Dobbs articles…

Porting Unix to the 386: a Practical Approach.

PORTING UNIX TO THE 386: THREE INITIAL PC UTILITIES

Porting Unix to the 386: Research & the Commercial Sector Where does BSD fit in? 

 

Happy new year!

I thought I’d go ahead and see if I could get Net/2 to build on my own.

Net/2

Net/2

Well it compiles, and tries to boot….   Sadly there is no adb or gdb support.  How on earth did people debug this stuff then?  I’m not sure where the crash location is, or what to do about it.  But I thought this was really cool.

I’ve also tried to track down 4.4BSD encumbered, which was released around the same time as the 4.4BSD-Lite1 which was after the AT&T vs BSDi/CSRG thing..  Or even the release that parallels the Net/2 release…

Anyways, happy 2014!

Old BSD musings

I was thinking after rebuilding the Mach disk, that back in the say it was insinuated that the changes from Net/2 to 386BSD 0.0 were quite minimal.  So I figured I should take a look.  The first thing to do would be to clean up Net/2’s kernel to look more like 386 BSD’s.  This was trivial as there wasn’t much of anything structure wise done.  Running the patch was pretty easy:

$ diff -ruN ../../../../net.2/sys . > /tmp/net2-386bsd00.patch

The patch is about 1MB.  Much larger than I expected!  Applying the patch to Net/2 shows that a substantial amount of files changed:

$ patch -p0 < /tmp/net2-386bsd00.patch
patching file ./conf/files
patching file ./i386/conf/GENERIC.i386
patching file ./i386/conf/Makefile.i386
patching file ./i386/conf/devices.i386
patching file ./i386/conf/files.i386
patching file ./i386/i386/autoconf.c
patching file ./i386/i386/conf.c
patching file ./i386/i386/genassym.c
patching file ./i386/i386/locore.s
patching file ./i386/i386/machdep.c
patching file ./i386/i386/pmap.c
patching file ./i386/i386/symbols.raw
patching file ./i386/i386/trap.c
patching file ./i386/i386/vm_machdep.c
patching file ./i386/include/psl.h
patching file ./i386/isa/com.c
patching file ./i386/isa/fd.c
patching file ./i386/isa/isa.c
patching file ./i386/isa/npx.c
patching file ./i386/isa/pccons.c
patching file ./i386/isa/wd.c
patching file ./i386/isa/wt.c
patching file ./i386/stand/Makefile
patching file ./i386/stand/bmap.c
patching file ./i386/stand/boot.c
patching file ./i386/stand/bootxx.c
patching file ./i386/stand/breadxx.c
patching file ./i386/stand/cga.c
patching file ./i386/stand/conf.c
patching file ./i386/stand/confxx.c
patching file ./i386/stand/fd.c
patching file ./i386/stand/fdbootblk.c
patching file ./i386/stand/fs.c
patching file ./i386/stand/kbd.c
patching file ./i386/stand/libsa/Makefile
patching file ./i386/stand/libsmsa/Makefile
patching file ./i386/stand/prf.c
patching file ./i386/stand/saio.h
patching file ./i386/stand/srt0.c
patching file ./i386/stand/trimhd.c
patching file ./i386/stand/wd.c
patching file ./kern/Makefile
patching file ./kern/init_main.c
patching file ./kern/kern__physio.c
patching file ./kern/kern_descrip.c
patching file ./kern/kern_exec.c
patching file ./kern/kern_execve.c
patching file ./kern/kern_exit.c
patching file ./kern/kern_fork.c
patching file ./kern/kern_malloc.c
patching file ./kern/kern_physio.c
patching file ./kern/kern_proc.c
patching file ./kern/kern_sig.c
patching file ./kern/kern_subr.c
patching file ./kern/makesyscalls.sh
patching file ./kern/subr_rlist.c
patching file ./kern/subr_rmap.c
patching file ./kern/sys_process.c
patching file ./kern/syscalls.master
patching file ./kern/tty.c
patching file ./kern/tty_pty.c
patching file ./kern/tty_ring.c
patching file ./kern/tty_subr.c
patching file ./kern/uipc_mbuf.c
patching file ./kern/vfs__bio.c
patching file ./kern/vfs_bio.c
patching file ./net/af.h
patching file ./net/bpf.c
patching file ./net/bpf.h
patching file ./net/bpfdesc.h
patching file ./net/if.h
patching file ./net/if_arp.h
patching file ./net/if_dl.h
patching file ./net/if_llc.h
patching file ./net/if_sl.c
patching file ./net/if_slvar.h
patching file ./net/if_types.h
patching file ./net/netisr.h
patching file ./net/radix.h
patching file ./net/raw_cb.h
patching file ./net/route.h
patching file ./net/slcompress.h
patching file ./netinet/icmp_var.h
patching file ./netinet/if_ether.h
patching file ./netinet/in.h
patching file ./netinet/in_pcb.h
patching file ./netinet/in_proto.c
patching file ./netinet/in_systm.h
patching file ./netinet/in_var.h
patching file ./netinet/ip.h
patching file ./netinet/ip_icmp.h
patching file ./netinet/ip_var.h
patching file ./netinet/tcp.h
patching file ./netinet/tcp_debug.h
patching file ./netinet/tcp_fsm.h
patching file ./netinet/tcp_seq.h
patching file ./netinet/tcp_timer.h
patching file ./netinet/tcp_var.h
patching file ./netinet/tcpip.h
patching file ./netinet/udp.h
patching file ./netinet/udp_var.h
patching file ./nfs/nfs.h
patching file ./nfs/nfs_subs.c
patching file ./nfs/nfs_vnops.c
patching file ./nfs/nfscompress.h
patching file ./nfs/nfsdiskless.h
patching file ./nfs/nfsiom.h
patching file ./nfs/nfsm_subs.h
patching file ./nfs/nfsmount.h
patching file ./nfs/nfsnode.h
patching file ./nfs/nfsrvcache.h
patching file ./nfs/nfsv2.h
patching file ./nfs/rpcv2.h
patching file ./nfs/xdr_subs.h
patching file ./stand/printf.c
patching file ./stand/saerrno.h
patching file ./stand/saioctl.h
patching file ./sys/acct.h
patching file ./sys/buf.h
patching file ./sys/callout.h
patching file ./sys/cdefs.h
patching file ./sys/clist.h
patching file ./sys/conf.h
patching file ./sys/dir.h
patching file ./sys/disklabel.h
patching file ./sys/dkbad.h
patching file ./sys/dkstat.h
patching file ./sys/dmap.h
patching file ./sys/domain.h
patching file ./sys/errno.h
patching file ./sys/exec.h
patching file ./sys/fcntl.h
patching file ./sys/fifo.h
patching file ./sys/file.h
patching file ./sys/filedesc.h
patching file ./sys/gprof.h
patching file ./sys/ioctl.h
patching file ./sys/ioctl_compat.h
patching file ./sys/ipc.h
patching file ./sys/kernel.h
patching file ./sys/kinfo.h
patching file ./sys/kinfo_proc.h
patching file ./sys/ktrace.h
patching file ./sys/malloc.h
patching file ./sys/map.h
patching file ./sys/mapmem.h
patching file ./sys/mbuf.h
patching file ./sys/mman.h
patching file ./sys/mount.h
patching file ./sys/msgbuf.h
patching file ./sys/mtio.h
patching file ./sys/namei.h
patching file ./sys/param.h
patching file ./sys/proc.h
patching file ./sys/protosw.h
patching file ./sys/ptrace.h
patching file ./sys/reboot.h
patching file ./sys/resource.h
patching file ./sys/resourcevar.h
patching file ./sys/seg.h
patching file ./sys/shm.h
patching file ./sys/signal.h
patching file ./sys/signalvar.h
patching file ./sys/socket.h
patching file ./sys/socketvar.h
patching file ./sys/specdev.h
patching file ./sys/stat.h
patching file ./sys/syscall.h
patching file ./sys/syslimits.h
patching file ./sys/syslog.h
patching file ./sys/systm.h
patching file ./sys/tablet.h
patching file ./sys/termios.h
patching file ./sys/time.h
patching file ./sys/timeb.h
patching file ./sys/times.h
patching file ./sys/tprintf.h
patching file ./sys/trace.h
patching file ./sys/tty.h
patching file ./sys/ttychars.h
patching file ./sys/ttydefaults.h
patching file ./sys/ttydev.h
patching file ./sys/types.h
patching file ./sys/ucred.h
patching file ./sys/uio.h
patching file ./sys/un.h
patching file ./sys/unistd.h
patching file ./sys/unpcb.h
patching file ./sys/user.h
patching file ./sys/vadvise.h
patching file ./sys/vcmd.h
patching file ./sys/vlimit.h
patching file ./sys/vmmeter.h
patching file ./sys/vnode.h
patching file ./sys/vsio.h
patching file ./sys/vtimes.h
patching file ./sys/wait.h
patching file ./ufs/dinode.h
patching file ./ufs/dir.h
patching file ./ufs/fs.h
patching file ./ufs/inode.h
patching file ./ufs/lockf.h
patching file ./ufs/mfs_vnops.c
patching file ./ufs/mfsiom.h
patching file ./ufs/mfsnode.h
patching file ./ufs/quota.h
patching file ./ufs/ufsmount.h
patching file ./vm/device_pager.h
patching file ./vm/lock.h
patching file ./vm/pmap.h
patching file ./vm/queue.h
patching file ./vm/swap_pager.c
patching file ./vm/swap_pager.h
patching file ./vm/vm.h
patching file ./vm/vm_fault.c
patching file ./vm/vm_glue.c
patching file ./vm/vm_inherit.h
patching file ./vm/vm_kern.c
patching file ./vm/vm_kern.h
patching file ./vm/vm_map.h
patching file ./vm/vm_object.h
patching file ./vm/vm_page.h
patching file ./vm/vm_pageout.h
patching file ./vm/vm_pager.h
patching file ./vm/vm_param.h
patching file ./vm/vm_prot.h
patching file ./vm/vm_statistics.h
patching file ./vm/vm_swap.c
patching file ./vm/vm_user.h
patching file ./vm/vnode_pager.h

Clearly the move from Net/2 to 386BSD 0.0 was not trivial.  Which I’ve always wondered, as quotes like this:

Closing the gap from the Networking Release 2 distribution to a fully functioning system did not take long. Within six months of the release, Bill Jolitz had written replacements for the six missing files. He promptly released a fully compiled and bootable system for the 386-based PC architecture which he called 386/BSD.

Make it sound like Bill spent six months on six files.

I guess the real question is can I find a so called encumbered 4.4 BSD, and compare that to the lite to see the magical “six files” and then check the drift into Net/2, to 386BSD 0.0 …

386BSD 0.1 running on a 386sx

Looking around, I found this blog, which kind of reads under google translate where someone went ahead and booted up 386BSD 0.1 on his 386sx laptop. Sadly he doesn’t have a 80387sx so things like PS explode as it has a %f in the code…

Oh well it’s kind of fun to see things go round and round.

—-update…

I should mention I was thinking of 0.0 that didn’t include the floating point support.. Also “the fuck it crashes” is as good as any other google xlate disaster… 🙂

Multiuser DOS

This has been a fun thing to go through, but at one point it was a popular trend to convert big expensive 386 computers from the late 1980’s into multi-user, multi-tasking beasts much like a mainframe. But instead of CICS, and PROFS people ran Dbase III, WordPerfect, and all kinds of email solutions from ccmail, to MS mail, and even some dbase programs, compiled by clipper into being email clients.

In a way things were more ‘simple’ back then, and the 80386 CPU had a card up it’s sleeve v86 mode. v86 mode provides hardware emulation of a 8086, allowing the base OS to spawn dozens of these virtual machines. All that was up to the ‘supervisor’ was to create virtual peripherals, much like how Windows/386 of the day ran multiple MS-DOS VM’s on a single machine that you could see at once, these solutions provide the output to multiple terminals.

While Windows/386 sat on top of MS-DOS, these multitasking DOS’s had the v86 mode multitasking as part of it’s core, and some of the later ones were themselves protected mode operating systems.

But juggling multiple MS-DOS applications at one could be quite a challenge. And of course there was the whole dos extender thing, leading up to VCPI, and DPMI.

While MP/M-86 is a grand daddy to a bunch of Digital Research derived OS’s, it’s not 386 specific so I’m going to omit it for now. I’m sure it’ll be worth doing it’s own write up.

I’m sure I’m going to miss a bunch of these, but let’s have a quick rundown.

  • Concurrent DOS/386
  • DR-Multiuser-DOS 5.0
  • Real/32
  • TSX-32
  • PC-MOS/386
  • VM/386
  • VMOS/3

If anyone knows of any others feel free to give me a shout. It does seem that multiuser DOS was a good market at one point.

Old Unix tree’s

Well I was looking for a good way to see what changed between Net/2, 386BSD 0.0 and 386BSD 0.1 and it appears that nobody has a cvsweb of these early versions….

What is strange, is that cvsweb package for debian is lacking the actual cgi file.. So after going insane with cvsweb, I set one up.

http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/#dirlist

I’ve never really setup a CVS repository before so this was my first shot…

rm -rf /var/lib/cvs
mkdir -p /var/lib/cvs
cvs -d /var/lib/cvs init
cd /var/www/unix.superglobalmegacorp.com/source/Net2
cvs -d /var/lib/cvs import -m “Net/2” Net2 CSRG Net2
cd /var/www/unix.superglobalmegacorp.com/source/386BSD-0.0
cvs -d /var/lib/cvs import -m “386BSD 0.0” Net2 BJolitz Jolix00
cd /var/www/unix.superglobalmegacorp.com/source/386BSD-0.1
cvs -d /var/lib/cvs import -m “386BSD 0.1” Net2 BJolitz Jolix01
cd /var/www/unix.superglobalmegacorp.com/source/NetBSD-0.8
cvs -d /var/lib/cvs import -m “NetBSD 0.8” Net2 NetBSD NetBSD08
cd /var/www/unix.superglobalmegacorp.com/source/NetBSD-0.9
cvs -d /var/lib/cvs import -m “NetBSD 0.9” Net2 NetBSD NetBSD09 

From what I saw the more the directories align, the better, so I moved all the i386 and other platform stuff into arch directories to better match NetBSD 0.9 …

I also setup src2html to browse various levels, it’s great for quickly finding things that may have moved… It’s here.

Now I just have to see about doing ‘forks’ in CVS and adding in the 4.4 lite stuff.

NetBSD 0.8 kernel boots!

Well, ok it’s not 100% the NetBSD 0.8 kernel, as a good chunk of the files have been intentionally removed from CVS. However from the announcement, it does make it clear that NetBSD 0.8 is 386 BSD pl22 with some pre pl23 changes thrown in. Since patch level 22 is lost, however patch level 23 is still around, then it wasn’t to hard to install a 386 BSD system, patch it to level 23, then unpack the NetBSD 0.8 sources, and fill in the missing parts.

I guess this is the Jurassic Park of kernels?

386bsd-pl22 booted

Anyways, here is the 386 BSD pl 23 kernel booting up

And now..

NetBSD 0.8 booted

NetBSD 0.8 booted

As you can see there is some differences in the boot strings, but at the same time, because so many files were just pulled in from 386 BSD, and I’m still using a 386 BSD userland, it reports itself as 386BSD.

dmesg’s were so small back then, here is the whole thing from the kernel:

386BSD 0.1 (GENERICISA) #2: Sun Dec  5 13:30:14 PST 2010
 [email protected]:/usr/src/sys.386bsd/arch/compile/J
real mem  = 67104768
avail mem = 64663552
pc0 at 0x60-0x6f irq 1 on isa
pc0: color
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: 
wd0 at wdc0 slave 0
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
ne0 at 0x320 irq 10 on isa
 ethernet address 52:54:00:12:34:56
npx0 at 0xf0 irq 13 on isa

Oh well it was moderately interesting.

For the insane, the merged source is here. I’ll provide a snapshot of my build environment, under Qemu here.