/joh'liks/ n.,adj. 386BSD

Porting Unix to the 386: A Practical Approach

William & Lynne Jolitz

The second article in the "PORTING UNIX TO THE 386" series discussed the utilities we had to build to test the port on an actual 80386 PC.
By far, the most popular article.

William & Lynne:
"We did this before for PDP and NS32000 computers before. "Bulldozing DOS off the PC" appealed to DOS developers.

But the real significance was that with these utilities, anyone could do a port of an operating system to the PC, because these were tested and known to work."

Jolitz Heritage - Three Initial PC Utilities
386BSD - Three Initial PC Utilities
Porting Unix to the 386: Three Initial PC Utilities

William Frederick Jolitz and Lynne Greer Jolitz

Copyright (c) 1990 TeleMuse.

In last month's installment, we discussed the elements of the 386BSD port, which required planning prior to the actual coding. In brief, the specification we outlined emphasized BSD compatibility, efficient use of the 80386 architecture, interoperability with extant commercial standards, and rapid implementation to leverage BSD UNIX to port the rest of itself. We also discussed the conflicts inherent between a segmented architecture and a virtual memory system which prefers paging, other microprocessor idiosyncrasies and requirements, and the basic planning for the surrounding hardware. By taking a "practical approach" to this port and focusing on "hard adherence" to BSD operability and high-performance, we identified the key milestones required for this (or any) advanced operating system port and set the stage for our next effort: Writing the PC utilities that allow us to initially load the first programs and data onto our 386 target host.

With this in mind, we'll now examine code from three PC-based utilities -- boot.exe, cpfs.exe, and cpsw.exe -- that facilitate the basic access to the hardware from MS-DOS needed to begin a UNIX port. boot.exe executes a GCC-compiled program (using the Free Software Foundation's GNU C Compiler) in protected mode from MS-DOS. (Note that GCC generates only 32-bit protected-mode code.) cpfs.exe installs a root filesystem onto the hard disk. cpsw.exe copies files to a shared portion of disk so that MS-DOS and UNIX can exchange information.

In examining these areas, we will illustrate how the UNIX bootstrap process functions, because these programs mimic that process to a great degree. This will be important in later articles when we discuss the code and strategies used to build the bootstraps that allow the newly ported system to become independent of MS-DOS.

Porting Unix to the 386: Three Initial PC Utilities


Copyright 1989, 1990, 2006 TeleMuse Partners, William Jolitz and Lynne Jolitz