MusingsUSENIX

  farrow_captain

by Captain Farrow
<rik@spirit.com>

When he's not exploring other galaxies, Rik Farrow provides UNIX and Internet security consulting and training. He is the author of UNIX System Security and System Administrator's Guide to System V.


"Make it so." With these three words, and perhaps only ten minutes before the end of the show, Picard, a now legendary manager (as well as Starfleet captain), sets his crew scurrying into motion. Each crew member has provided suggestions, and Picard has weighed their possible consequences, and made his decision. Well within the assigned time limit, they solve whatever technical problems they had, and peace in the quadrant is again assured.

If only the real world worked so well.

I have been waving my magic wand for years now, to little effect. Perhaps global warming can be blamed on me (all the hot air). Or, perhaps I forgot the magic words: "Make it so." Maybe it's the lack of enough venture capital funding? No, just kidding. I have heard from several people what a nightmare quarterly reports can be (unless you are already quite profitable).

And then, someone said to me, "Why don't you quit waving that thing around, and open your eyes to what already exists?" Well, what a fine idea.

The first thing I noticed was the proliferation of free UNIX. The UNIX operating system was once enslaved, the intellectual property of a very large networking company, the one with the death star logo. You know the one. A very small (at the time) networking company, with strong roots in UNIX and UUCP, decided it was time to take the bull by the horns, and announced that they had created an unencumbered version of UNIX. In order to do this, they had to replace the parts of the Berkeley UNIX kernel that were owned by the big company. Some programmers with no prior knowledge (in particular, Bill Jolitz) were hired to produce the missing pieces.

Virtual Memory

Memory management was one of the more critical, and arcane, missing pieces. By creating and publishing (in Dr. Dobbs) this information, UNIX became free. Well, almost. To the bitter end, the large company maintained that it had protected its intellectual property rights. As proof, they could point to the number of companies that had been forced to change the last four digits of their phone numbers from 8649 (UNIX) to something else. The large company's lawyers would also send yearly letters out to anyone who had misused the adjective "UNIX." That is, you could not publish something that read "UNIX," but could say "the UNIX operating system."

The argument grew quite heated, even as the lawyers became richer and the small company poorer. Fortunately, the large company was not totally humorless -- they stipulated that anyone who had ever seen UNIX source code was "contaminated." That is, anyone who had worked with the large company's source code would forever be in thrall and unable to produce code that had not been influenced by the experience. Many people in the UNIX community responded by wearing badges labeling themselves as "mentally contaminated."

Eventually, it was determined that out of thousands of source files, only four could be said to be in dispute. The large company, AT&T, lost, and the rest of us, and UUNET and BSDI, won. BSDI still sells and supports 4.4 BSD UNIX, and three other organizations support free versions of BSD (OpenBSD <http://www.openbsd.org>, FreeBSD <http://www.freebsd.org>, and NetBSD <http://www.netbsd.org>).

Around about the same time, Linus Torvalds, a student in Finland, began working on task switching and the 80386 protected memory mode, writing in assembly. He was inspired by Andrew Tanenbaum's Minix, a UNIX-like operating system not based on an existing code, and used as a teaching tool. With the rudiments of memory management, and a crude disk device driver, Linux version .01 was released in 1991.

Linux most closely resembles System V UNIX, and it is more popular today than Windows NT. Of course, there are more commercial applications that run under NT, but Linux systems don't have to be rebooted as often. With a cast of thousands working on improving Linux (Microsoft employs between 200 and 300 programmers for NT), it is a wonder that Linux has not grown to be the size of NT 5 (40 million lines of code). Personally, I doubt that would ever happen to a UNIX-like operating system.

Media Driven

The roots of UNIX go back almost 30 years. Although Linux is a "new" operating system, it is also based on UNIX. What about something completely different, starting from scratch? Like BeOS.

BeOS shares little with UNIX -- the Bash shell, a POSIX interface, and about 150 UNIX commands (including Perl). It also has memory protection (as any real operating system should), virtual memory, and preemptive multitasking. Beyond that, it is an entirely new operating system which Be PR describes as the "Media OS." This is perhaps not so far fetched, as the goal of Be is to support digital media -- video, audio, 3D models, and other graphics. To accomplish this, BeOS is based on a microkernel design, using message passing and pervasive multithreading. The multithreading is supposed to aid even in single-processor systems by permitting faster preemption.

Be programmers designed BeOS for multiple-processor systems, using a purely symmetric architecture. In asymmetric multiprocessing, one processor acts as "master" and runs the operating system, while other processors, the "slaves" can only run application code. Symmetric systems permit any processor to run OS code, but there usually is a problem. The kernel contains many "critical sections" code that cannot be interrupted and certainly not executed simultaneously by a second processor. The usual solution is to protect critical sections with locks, mutexes, and semaphores, to guard against multiple access. OS designers have a lot of trouble deciding exactly where to place the locks, and most multiprocessor OSs start out with coarse-grained control -- locks that guard large hunks of code. Be claims to have built an OS avoiding this problem.

The filesystem supports files 264 in size, or single devices as large as 18 million terabytes (18 billion gigabytes). While this might seem ridiculous today, you can already buy drives that exceed 10 gigabytes, while the maximum file size supported by a 32-bit integer size is 4 gigabytes. Peeking into the BSDI source, the file offsets are also 64 bits, so no problem there.

BeOS does support other filesystems as well: the Mac OS HFS, DOS Fat 16 and 32, and NFS. Currently, all BeOS files appear to be owned by "baron"; there are hooks for adding either UNIX/POSIX-style owner and group, or NT ACLs, as each file includes extended attributes which can hold anything the programmer desires.

Networked

Only TCP/IP is supported, although BeOS can print to AppleTalk printers. As mentioned, there is native support for NFS, FTP, and Telnet, and both an integrated Web browser and rudimentary server are included.

The ties of its founder, Jean-Louis Gassée, and the VP of engineering, Steve Sakoman, to Apple, where they both worked, are obvious. You probably remember when Apple, Inc. considered using BeOS as a replacement for the venerable MacOS, a spaghetti OS with roots in the early 1980s. I am not very fond of MacOS, because I have to support my wife and son and their PowerPC. An OS that does not protect memory or offer true multitasking is really lame. MacOS 10 will be based on Next's Mach kernel, an improvement I pray I live to see (there was a nice invited talk about this at the USENIX 1998 conference in New Orleans).

Apple did not choose BeOS, but BeOS's native platform is the PowerPC-based Mac. Last spring, a version of BeOS for Pentium systems appeared, but it still has limited hardware support. I really wanted to load this on a "spare" Intel box, just to see how it compared performance-wise to Windows 95, but BeOS for Intel failed to discover the CD-ROM, and does not support SCSI CD-ROMs for installation, leaving out my other Intel boxes.

Although BeOS protects memory and devices, it does provide direct access to video card memory, something that game and graphic designers want (and need). The development platform is C++, with an object-based API. BeOS also includes Silicon Graphics' OpenGL for 3D graphics. Be claims that the objects provided with the system encourage pervasive multithreading, and that the message passing means that disparate applications can communicate without difficulty.

Because BeOS is new, its API does not suffer from having to support old, complex, and backward-compatible interfaces. I must admit this really attracted me; the Win32 API and Mac API are enormous, and X, while smaller, is not very simple. Gcc is included, as is a basic development environment. The official development tool costs $129. BeOS itself costs $100 (although it is on sale for $70 at the time I write this). Check out <www.be.com> for more details.

Enthusiasm

Be appears to have an exciting new OS, with a small, dedicated group of devotees. I wanted to talk about it because it is an interesting approach, with many, but not all, of the features I have been looking for in a new OS. What's missing? Built-in security is important to me. Broader support for hardware is currently lacking, although I imagine that will come (hard to image a high-performance filesystem that cannot run on SCSI drives on Intel platforms). Still, there is an interesting future here for fledgling hackers who want to write graphics software or like having built-in MIDI capabilities.

BeOS is proprietary -- no source code. I am looking for something like BeOS, but more open. Still, the price is right, and BeOS appears to be a very good alternative to Windows (Rich Text Format conversion is already supported, and one developer has plans for full conversion of Word files for their word processor).

It seems like I install one operating system a month, mostly upgrades or on new hardware. Sometimes this is easy, like installing BSDI or Linux, where you answer some questions and walk away, or difficult, like NT, where you must babysit for an hour or so. In all cases, dealing with the video adapter and monitor causes the most problems (except in notebooks, where the PC cards are problematical).

Sometimes I wish I could just say, "Make it so," and some minion would hop to it. But then I would miss all the fun.

 

?Need help? Use our Contacts page.
First posted: 1st February 1999 jr
Last changed: 1st February 1999 jr
Issue index
;login: index
USENIX home