This is really a paper about almost any BSD derived operating system. I believe the following to be true for at least NetBSD, FreeBSD, and OpenBSD, and may well extend to commercial implementations such as BSD/OS. For brevity, I will use `*BSD' to stand for these, but any specific examples have been verified on NetBSD and FreeBSD unless otherwise noted.
The purpose of this paper is to convince you:
I disagree with the term `myth' being used to describe incorrect beliefs about software. A myth is usually a belief that was held because it was not testable at the time, and most of the things we call myths are not believed anymore. I prefer the term `dogma'. A dogma is a belief that is testable, but the believer either has not put it to the test or will not acknowledge refuting evidence. (With respect to operating systems, the latter case is usually referred to as `religion'.) Here I present common dogmas about *BSD and refuting evidence.
What particular piece of hardware are you worried about? Is it:
Given the above evidence and given that the number of USB devices is growing quickly, it is safe to say that for a given hardware device your chances of finding a driver are as good or better for *BSD than they are for Linux. In any case, it should be clear that hardware support in *BSD is actually very rich. In fact, it was not until I started researching this that I realized just how well *BSD is doing in this area compared to Linux, because I was constantly assuming that Linux already supported things like USB and Firewire.
I've heard this dogma in many variations, but I think they are all based on a small set of misconceptions. In particular:
http://www.netbsd.org/gallery/in-Action/ag-quake-native.jpg: NetBSD running KDE (and incidentally, QuakeWorld)It is the case that it may be more difficult to install GNOME or KDE on a *BSD system due to the fact that there is not (currently) as much development being done on making *BSD install procedure simple for end-users. For advanced users (anyone reasonably familiar with the Unix make program for example), installing something huge like GNOME is a matter of:
http://www.netbsd.org/gallery/in-Action/rh-gnomewm.png: NetBSD running GNOME (and scanning a photo with XSane scanner software)
and waiting for some number of hours while the system automatically downloads all of the source code necessary for GNOME and the standard applications from the Internet, unpacks and patches them (when necessary), and installs it all.# cd /usr/ports/x11/gnome # make install PREFIX=/opt
*BSD should in no way be considered outdated or obsolete. Aside from having beaten Linux to at least two important hardware interfaces (USB and Firewire), the *BSD teams continue to make important innovations in the core operating system.
It's not completely fair to call this a dogma, since whether it is or not is mostly a matter of opinion depending on how much you care about the ability to run commercial, closed-source programs natively. (For the purposes of teaching Computer Science, there are almost none of these.)
On the other hand, it seems that many people dismiss the *BSD operating system compatibility support far too easily. OS compatibility is nothing like cross platform emulation such as SoftWindows on SGI MIPS. In particular, it is not at all slow or flakey. The *BSD OS emulation is simply a way of mapping the system call interface of one Unix system to another. Not only does this allow *BSD systems to run commercial Linux software very well but software compiled on other systems as well. For example, NetBSD running on SPARC and UltraSPARC architectures is able to run SunOS and Solaris binaries, NetBSD running on DECStations is able to run ULTRIX binaries, etc. This allows organizations to upgrade to a modern OS while keeping their legacy applications (ULTRIX does not support shared libraries, but NetBSD running on a DECStation does, and will still run your old ULTRIX programs).
I am routinely running the Linux versions of Adobe Acrobat Reader 4.0, Netscape Communicator 4.7 with RealPlayer G2, and StarOffice on my FreeBSD system without problems. Installation of these programs is as simple as:
# cd /usr/ports # make search key=acroread Port: acroread-4.0 Path: /usr/ports/print/acroread4 Info: View, distribute and print PDF documents Maint: dima@FreeBSD.org Index: print B-deps: R-deps: gdbm-1.8.0 linux_base-5.2 rpm-2.5.6 # cd print/acroread4 # make install PREFIX=/opt >> linux-ar-40.tar.gz doesn't seem to exist on this system. >> Attempting to fetch from ftp://ftp-pac.adobe.com/pub/adobe/acrobatreader/unix/4.x/. [...Automatic download and install here]
If I hadn't had the Linux compatability module installed already, that would have been done automatically also. Compared to the Linux method of locating an RPM (assuming one exists), downloading it, and running RPM on it, this is a breeze.
If we do not consider `application support' in the commercial-third-party sense, then *BSD actually has greater support than Linux. Besides running all of the same Unix software that Linux can, *BSD is continually beating Linux in implementing the new software interfaces that applications rely on. For specific examples, FreeBSD was the first free OS to support T/TCP a.k.a TCP for Transactions (3 years before the first Linux implementation), while NetBSD was the first free OS to include IPv6 support.
Undoubtedly, there are fewer (maybe even far fewer) users of *BSD than there are of Linux. On the other hand, there are a good deal of companies using FreeBSD. Here's a quote from a July 1999 ZDNN story:
The list of big-name companies and Web sites that use BSD is impressive. Yahoo, UUNet, Mindspring and Compuserve are on the list - in fact, perhaps 70 percent of all Internet service providers use BSD. Also on the list - Walnut Creek CDROM Inc. and its CD-ROM FTP download site, which the company says delivers more than 1 terabyte of data to visitors every day. [BS99]
Suppose you are a Computer Science student. With which operating system would you like to have gained 4 years of experience by the time you graduate? If you are thinking of working for an Internet service provider, then the obvious answer is *BSD (even Microsoft has job openings that require FreeBSD experience [MS00]). But even if you aren't, having experience with systems other than Linux will set you apart from the droves of applicants who have `Run Linux at home' on their resumes.
The most important reason why I consider *BSD to be a superior choice for teaching Computer Science can be stated as ``Because *BSD serves as an excellent example.'' I believe that students can learn programming skills faster and better if they are taught using a *BSD operating system than other systems, for a lot of reasons, but two in particular.
One of the nice things about *BSD is that you can always find the
source code. On Linux systems, finding the source code for the kernel is
trivial, but what about the source for the ping,
traceroute, or even telnet programs? Because `The
Linux Operating System' is actually the combination of the Linux kernel with
the GNU system's standard Unix tools, finding the source to a specific program
requires first deducing which package it is contained in (SRPMs for
Red Hat systems), then downloading and installing the package. If it is
important to have the exact version that is currently install, then add a
separate step for checking that.
On *BSD systems, if you know where the program is, then you can find the
source. If I want to look at the source code for the exact version of
telnet that is installed on my FreeBSD machine, this is all I have
to do:
[~]0$ which telnet /usr/bin/telnet [~]0$ cd /usr/src/usr.bin/telnet [/usr/src/usr.bin/telnet]0$ ls Makefile defines.h main.c sys_bsd.c tn3270.c README externs.h network.c telnet.1 types.h authenc.c fdset.h ring.c telnet.c utilities.c commands.c general.h ring.h terminal.c [/usr/src/usr.bin/telnet]0$
I can even build the entire system from scratch by doing make
world in /usr/src. This is very powerful.
When source code is this available, students will refer to it all the time.
And they'll be gaining knowledge of how real Unix programming is done every
time. [Note: On some systems, the source code is stored on a file server to
avoid duplicating it on all machines. For the UNLV College of Engineering, the
location of the BSD source is
/src/1/OS/NetBSD/<version>/src. Of course the systems
could be configured so that /usr/src was linked to this directory
if desired.]
Being able to locate the source with such ease is great, but where *BSD
really shines is in their commitment to code quality and
clarity. The NetBSD kernel is built with switches cc
-Wall -Werror, which basically means that the code will be absolutely
free of compiler warnings, or it won't compile at all.
But having the source code is useless if it is difficult to understand, so
using a system where the developers have a real commitment to clarity is
important. As a simple example, let's look at the definition of the
sockaddr structure. This structure is a part of the standard
Unix socket interface (of which *BSD is universally considered to be the
reference implementation), and is normally located in
/usr/include/sys/socket.h. On my FreeBSD system, it is defined
as:
/*
* Structure used by kernel to store most
* addresses.
*/
struct sockaddr {
u_char sa_len; /* total length */
u_char sa_family; /* address family */
char sa_data[14]; /* actually longer; address value */
};
which is exactly what you will see on most Unix-like systems, and in almost
any textbook. On Linux or other GNU-based systems, what we find in
/usr/incude/sys/socket.h is:
/* This is the type we use for generic socket address arguments.
With GCC 2.7 and later, the funky union causes redeclarations or
uses with any of the listed types to be allowed without complaint.
G++ 2.7 does not support transparent unions so there we want the
old-style declaration, too. */
#if (!defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7))
# define __SOCKADDR_ARG struct sockaddr *
# define __CONST_SOCKADDR_ARG __const struct sockaddr *
#else
/* Add more `struct sockaddr_AF' types here as necessary.
These are all the ones I found on NetBSD and Linux. */
# define __SOCKADDR_ALLTYPES \
__SOCKADDR_ONETYPE (sockaddr) \
__SOCKADDR_ONETYPE (sockaddr_at) \
__SOCKADDR_ONETYPE (sockaddr_ax25) \
__SOCKADDR_ONETYPE (sockaddr_dl) \
__SOCKADDR_ONETYPE (sockaddr_eon) \
__SOCKADDR_ONETYPE (sockaddr_in) \
__SOCKADDR_ONETYPE (sockaddr_in6) \
__SOCKADDR_ONETYPE (sockaddr_inarp) \
__SOCKADDR_ONETYPE (sockaddr_ipx) \
__SOCKADDR_ONETYPE (sockaddr_iso) \
__SOCKADDR_ONETYPE (sockaddr_ns) \
__SOCKADDR_ONETYPE (sockaddr_un) \
__SOCKADDR_ONETYPE (sockaddr_x25)
# define __SOCKADDR_ONETYPE(type) struct type *__##type##__;
typedef union { __SOCKADDR_ALLTYPES
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));
# undef __SOCKADDR_ONETYPE
# define __SOCKADDR_ONETYPE(type) __const struct type *__##type##__;
typedef union { __SOCKADDR_ALLTYPES
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
# undef __SOCKADDR_ONETYPE
#endif
The author of this code has made very clever use of C preprocessor macros to
make it easier to write sloppy programs. Specifically, it is done so that any
of the sockaddr_* structures may be passed to a function having a
sockaddr parameter without using a typecast. Unfortunately, this
has also means that the file is useless as a learning tool. By searching
through all of the include files, we finally find the definition of
sockaddr in /usr/include/bits/socket.h:
/* Structure describing a generic socket address. */
struct sockaddr
{
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
};
but with yet another clever macro. We find the definition of the
__SOCKADDR_COMMON macro in
/usr/include/bits/sockaddr.h, and can finally begin to decipher
what it all means.
There seems to be a belief that there much more research being done on Linux than *BSD (see Dogma 2). As an informal test, I looked at all of the papers presented at the FREENIX Track of the 1999 USENIX Annual Technical Conference to see which of them pertained to (or were substantially developed on) *BSD vs. Linux. The score is *BSD: 16, Linux: 4, Other/Neither: 11. Although there may be far fewer *BSD books of the form ``Learn *BSD in 21 Days For Dummies'', it is apparent that `the literature' prefers *BSD. See the Appendix for a list of papers with comments.
*BSD is a good choice for teaching Computer Science. The *BSD projects maintain a strong commitment to code quality and clarity, while continuing to do innovative and ground-breaking work without covert agendas or hype. Most of the reasons normally given for not choosing *BSD are based on dogma or popularity contests. But since any argument beginning with ``Linux is more popular...'' reduces to ``...therefor we should use Windows'', it would be better to concentrate on the technical merits.
| [BS99] | Bob Sullivan, MSNBC, ``BSD a better OS than Linux?'', July 22, 1999, ZDNN, Available as: http://www.zdnet.com/filters/printerfriendly/0,6061,2299366-2,00.html , Accessed: 7 Feb 2000 |
|---|---|
| [DS99] | Dennis Sellers, ``Linux creator dismisses FireWire'', MacCentral Online, 11 Aug 1999, Accessed: 7 Feb 2000. |
| [EP00] | Emanuel Pirker, ``What is the current status of the Linux IEEE 1394 project?'', http://eclipt.uni-klu.ac.at/ieee1394/kb/linux1394faq/948523941, Accessed: 7 Feb 2000. |
| [KK99] | Katsushi Kobayashi, ``The Design and Implimentation of Fireware device driver on FreeBSD'', USENIX '99 FREENIX Track. Available as Postscript for USENIX members |
| [LL00] | The Linux USB webpage, http://www.linux-usb.org/, Accessed: 7 Feb 2000. |
| [ML00] | The Metro Link Incorporated website, http://www.metrolink.com/, Accessed: 6 Feb 2000 |
| [MS00] | Microsoft, ``Microsoft Jobs'', http://www.microsoft.com/Jobs/BAYAREA/HOTMAIL.HTM, Accessed: 8 Feb 2000. |
| [VP00] | Vojtech Pavlik, ``The v2.2 Linux USB drivers backport'', http://www.suse.cz/development/usb-backport/, Accessed: 7 Feb 2000. |
| [XF8699] | Various email messages read by the author on the XFree86 developers' mailing list during 1999. |
| [XF8600] | The XFree86 Project website, http://www.xfree86.org/, Accessed: 06 Feb 2000. |
| [XG00] | The Xi Graphics website, http://www.xig.com/, Accessed: 6 Feb 2000. |
| Title | OS |
|---|---|
| Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem | *BSD |
| Design and Implementation of a Transaction-Based Filesystem on FreeBSD | FreeBSD |
| The Global File System: A Shared Disk File System for *BSD and Linux | Both |
| Standalone Device Drivers in Linux | Linux |
| Design and Implementation of Firewire Device Driver on FreeBSD | FreeBSD |
| newconfig: A Dynamic-Configuration Framework for FreeBSD | FreeBSD |
| The Vinum Volume Manager | FreeBSD |
| Porting the Coda File System to Windows | Neither1 |
| A Network File System over HTTP: Remote Access and Modification of Files and files | Neither |
| A Future-Adaptable Password Scheme | OpenBSD |
| Cryptography in OpenBSD: An Overview | OpenBSD |
| Minding Your Own Business: The Platform for Privacy Preferences Project and Privacy Minder | Unknown2 |
| Trapeze/IP: TCP/IP at Near-Gigabit Speeds | FreeBSD |
| Managing Traffic with ALTQ | FreeBSD |
| Opening the Source Repository with Anonymous CVS | OpenBSD |
| Open Software in a Commercial Operating System | *BSD3 |
| Business Issues in Free Software Licensing | Neither |
| Doing Well, Doing Good, and Staying Sane: A Hybrid Model for Sustainably Producing Innovative Open Software | Unknown2 |
| Sendmail Evolution: 8.10 and Beyond | Neither4 |
| The GNOME Desktop Project | Linux5 |
| Meta: A Freely Available Scalable MTA | Unknown2 |
| Porting Kernel Code to Four BSDs and Linux | Both |
| strlcpy and strlcat--Consistent, Safe, String Copy and Concatenation | OpenBSD |
| pk: A POSIX Threads Kernel | Neither6 |
| Berkeley DB | Neither4 |
| The FreeBSD Ports Collection | FreeBSD |
| Multilingual vi Clones: Past, Now and the Future | Neither |
| Improving Application Performance Through Swap Compression | Linux |
| New Tricks for an Old Terminal Driver | *BSD |
| The Design of the Dents DNS Server | Neither |
| Notes |
|---|
| 1The Coda file system is available and included with both *BSD and Linux |
| 2Paper not available online |
| 3About MacOS X, Apple's new BSD-based operating system |
| 4Although it originates from BSD |
| 5Not available online, but it is well known that the GNOME Project mainly uses Linux for development work, although GNOME runs on *BSD as well. |
| 6But uses the BSD license |
*Opinions in this document are those of Steve Lumos only, and not the Information Science Research Institute or the University of Nevada, Las Vegas.