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

Porting Unix to the 386: A Practical Approach



William & Lynne Jolitz


Started open source UNIX.

Appeared in part as a 17 article magazine series in 1991-1992.

Documented the "how, what, why, who, when" of porting BSD to the 386.

Done while BSD was becoming "open source".





Porting Unix to the 386: A Practical Approach - root filesystem

root filesystem:

Porting Unix to the 386: Three Initial PC Utilities

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.

The Purpose of Our PC Utilities

Why we wrote PC utilities to port UNIX with - the advantage of working from a primitive OS that runs on the absolute machine.

The Second PC Utility: cpfs.exe

First thing the kernel does is open its root filesystem - so we need a way to write a filesystem onto the hard disk, adjacent to the DOS filesystem, which is what this utility does.

The Third PC Utility: cpsw.exe

Once the system is debugged and tested, the next step was to load on more code to expand with. So we moved "tar balls" to the swap space with this utility to provide a primative file upload capability.

Where Do We Go From Here

With cross tools we could make utility programs for our nascent system. The next step would be incorporating them into a filesystem so that they could run on the native 386, with the kernel program.

Porting Unix to the 386: The Initial Root Filesystem

We build the first instance of the root filesystem - before any operational system is present on the 386 to build one. Part of the bootstrapping cycle of getting up the first running system on a new architecture.

The Role of the Root Filesystem

The root filesystem is a small, essential portion of disk storage, providing functionality to expand its resources to use storage other than the root itself, and configure system operations. The root usually survives intact when a system crash occurs, allowing system operation during recovery.

A Brief Review of the Root

A breakdown of the various uses of the root filesystems, and the considerations for each as we prove out the operation of the system step by step.

Installation: /stand

Portions of the root allow the kernel to be installed as the fundamental component of the operating system. These standalone programs occupy space within the root filesystem.

Initialization: /sbin/init, /dev/console, and /bin/sh

With the kernel running, we do a "high level bootstrap" to initialize the operating system, by executing certain programs located in the root filesystem.

Utilities: /bin and /sbin

A basic set of utilities is present on the root, both of general user operation as well as necessary supervisory utilities for system recovery and operation.

Operation: /tmp and /var

In operation, directories in the root are reserved for temporary and persistant data, such as compiler temporary files and accounting records.

Other Directories: /lib, /mnt, /usr, /root, and /sys

A number of additional directorys are present in the root to handle a variety of other purposes, but these are more to do with full operation of the system beyond the initial root filesystem.

Filesystem Creation

Where do you get the root filesystem, when you need it to make itself? Answer - you make it on another system, in this case one quite different, and then you break the recursion.

Filesystem Downloading

Having made the initial filesystem on another kind of system, we need to move it into place on the system we are running the kernel on.

Filesystem Debugging

Nothing ever goes right the first time, so a incremental process of bringing up the filesystem, from standalone utilities to system initialization allows us to debug flaws in filesystem creation, often artifacts of its non-native creation.

What's in a Filesystem?

What is it that makes up a filesystem? This depends very much on what kind of filesystem we are talking about.

Why Do We Need a Root Filesystem?

Whats different about operating systems like Unix that use a root filesystem, and other systems that don't require a filesystem to be mounted initially to operate?

The Filesystem Metaphor and its Importance in Future Work

Filesystem as metaphor allows us to restructure the way we organize system operation - perhaps other arrangements of the filesystem can achieve more enhanced operation, possibly rethinking how to bring up the system in the future.





Copyright 2006 TeleMuse Partners, William Jolitz and Lynne Jolitz