Berkeley Software Distribution

From Wikinfo

Jump to: navigation, search
Screenshot of a computer with a desktop BSD system installed
Screenshot of a computer with a desktop BSD system installed

During the 1980s and 1990s, the Berkeley Software Distribution was an operating system for the PDP-11 computers and the VAX computers. BSD was a platform for both research projects and commercial projects in computer science. Most importantly, BSD pioneered the practice of computer networking using the Internet Protocol.

Today, several teams continue to improve the source code. The BSD family of operating systems now run on PCs and laptops, servers and embedded devices; BSD is especially popular on internet servers. BSD has a reputation for being reliable (difficult to crash), secure (difficult to crack), and portable (running on many types of computers). To keep users happy, there are many programming languages and many computer games for BSD.

Today's BSD systems include at least DragonFly BSD, FreeBSD, MirOS BSD, NetBSD, and OpenBSD. There are thousands of BSD systems, see http://www.bsdstats.org/ for those who bothered to count themselves.

Overview of BSD

BSD has its origins at the University of California, Berkeley. Its students and faculty started with some PDP-11s and some VAXes running the AT&T Unix operating system. Through several research projects, support from the United States Governments, and outside contributors, Berkeley added much to their Unix system, including the networking features that implement the Internet Protocol. Eventually, Berkeley separated its own BSD source code from the encumbered AT&T Unix source code so that everyone could use the BSD source code, free from royalty.

So BSD is a modification of the original Unix system, but with all of the Unix parts removed! BSD belongs to the same extended family of operating systems as both GNU/Linux and Solaris. Some say that BSD systems are Unix-like systems or Unix clones, while others still refer to BSD Unix. Though BSD looks, feels, and acts like Unix, but BSD is not Unix, because Unix is a trademark of the Open Group.

BSD license

Meanwhile, Berkeley made its source code available under the BSD license, free software license that permits everyone to share the BSD source code and to use it in their software. This is what makes BSD so unique and important. The BSD license allows both commercial and noncommercial use, in both free and proprietary software.

Today, projects like NetBSD and FreeBSD provide free versions of BSD, but commercial vendors also sell non-free versions of BSD, and the BSD community accepts this. Many other operating systems, especially other Unix systems and clones, contain some pieces copied from BSD.

Innovation

BSD also has a long history of innovation. BSD pioneered the Internet Protocol for communication around the internet. BSD applications access the computer network by using an application programming interface called Berkeley sockets. These sockets are now available on most Unix systems and clones. BSD is also the origin of important programs including sendmail, which routes email around the internet; and BIND, which powers the Domain Name System. Today, with the KAME project, BSD is again pioneering the next version of the internet, IPv6.

Other BSD originals include vi, an early text editor; and rogue, the first of the entire genre of roguelike games.

Systems in the BSD Family

Note that 4.4BSD was the last release of the BSD system from Berkeley. These days, there are many variants of the BSD system, though we refer to any of them as BSD. Note that though the BSD license is a permissive free software license, some BSD systems also contain proprietary software.

Free variants of 4.4BSD

The Free Software Foundation has focused on four freedoms that all free software must provide, but BSD emphasises two: free redistribution and free modification.

Many internet sites offer a free variant of BSD for download, and many vendors sell copies of a free variant of BSD. Of course, a free operating system must have full source code, because programmers need the source code to make modifications.

In the free column:

Also free, but more obscure:

  • MirOS BSD - http://www.mirbsd.org - MirOS BSD comes as a "live CD", so you can boot and try it before installing it. It has removed some lesser-used programs from the base system to its ports collection, MirPorts. It has made replacements to some components, including the reintroduction of some AT&T Unix programs. It makes bigger changes sooner, and does what few dare to do, for example moving many of the users' dotfiles into ~/.etc/. It has spawned portions of itself into portable packages for other systems. It is free software and provides full source code. MirOS BSD is a good choice for those who want all of its features.
  • Debian GNU/kFreeBSD - http://www.debian.org/ports/kfreebsd-gnu/ - Debian is a distribution of the GNU system. Debian GNU/kFreeBSD is like Debian GNU/Linux, except that they replaced the Linux kernel with the kernel from FreeBSD! It is free software and provides full source code. It is good choice for those who like the FreeBSD kernel but really want to be using GNU, not BSD.

In the non-free column:

  • Mac OS X - http://www.apple.com/macosx/ - Apple chose to use FreeBSD code as the foundation of Mac OS X, the system software of the Apple Macintosh, a very successful consumer and office platform. Mac OS X runs both BSD and Mac software. It fully supports all recent Macintosh hardware from Apple Computer, but does not really run on anything else. An upgrade can cost more than USD 100, but new upgrade versions appear less than anually and are still cheaper and better than Microsoft Windows. In contrast to free systems, Mac OS X will not have trouble drawing accelerated 3D graphics, using Bluetooth, or putting a laptop to sleep. Source code for the lower-level components, Apple Darwin, can be difficult to find and build, but is worth looking at. The Mac OS X kernel "xnu" has merged code from the Mach microkernel. Its device drivers are completely different from those of other BSD systems. It truthfully boasts of being the only Unix (clone) that can do Microsoft Office. Mac OS X is a good choice for those desiring easy setup and use and a large, friendly user community.
  • Many non-free variants of FreeBSD, NetBSD and OpenBSD have found their way into networking hardware, cell phones, and other devices.
  • Most other Unix variants include some BSD code. For example, SunOS (now Solaris) started as a BSD variant and founded the first big wave of Unix workstations.

From AT&T Unix to Free Software

First came AT&T Unix, the original Unix system for PDP-11 computers. Unix was timesharing (so it could support many simultaneous users and programs) and relatively easy to program, because of its C programming language. However, AT&T was the telephone monopoly in the United States and could not enter the operating system business, so it instead gave cheap Unix licenses to government and universities.

The University of California, Berkeley received a Unix license, including a copy of Unix for its PDP-11, and complete Unix source code. UCB and its students began extending the system through research. Among many other developments, they moved the operating system from the PDP-11 to the VAX and they created the original networking code for the internet. UCB made their software available (to other holders of Unix licenses from AT&T) on tapes called the Berkeley Software Distribution. This way, other universities obtained copies of BSD and BSD became popular.

Eventually the sum total of the systems that Berkeley students had developed from scratch for their research had replaced essentially every component of Unix. So Berkeley set out to release the full Berkeley source code to the public, without the requirement for a Unix license. In 1991, Berkeley made a public release of the full 4.3BSD source code, minus files with AT&T copyrights, under a very generous free software license called the BSD license. Berkeley made two more releases: 4.4BSD-Lite in 1994 and 4.4BSD-Lite 2 in 1995. The license allowed anyone to copy, modify, and redistribute it, without payment of royalties, with the requirement to preserve the copyright notices. For example, somone with a free version of BSD could install it on an unlimited number of computers, share copies of it, profit from selling copies of it, and make any changes to the source code.

Importantly, a version of BSD that contains no Unix code is not Unix, by reason of trademark. However, because it consists of replaced Unix components, it feels like Unix (though there peculiarities that make it feel like BSD!) and many users call it "Unix" or "Unix-like".

However, the free edition of BSD was missing some essential pieces. Meanwhile, the GNU project had been trying to write its own free software replacement for Unix. Various persons combined BSD, GNU, and other free programs together to form free distributions of working operating systems. The *BSD systems use mostly BSD code, while the GNU/Linux systems use mostly GNU code.

The main difference between the BSD and GNU codebases is in the copyright licenses. A typical BSD license gives permission for any sort of changes, including non-free modifications. For example, you can modify BSD, sell a commercial version, sell royalties, and never reveal any source code. In contrast, the GNU General Public License is based upon the concept that non-free software is unethical. It is a "copyleft" and gives you permission to change a program only if you license your changes under the same GNU license. (This license for this Wikinfo article about BSD is the GNU Free Documentation License, a copyleft license for documentation. This is because this article is derived from one at Wikipedia.) Thus the generous BSD license goes beyond the GNU General Public License by allowing you to do what "copyleft" would disallow.

BSD for PDP-11 and VAX Today

Some historians prefer the versions of BSD before the many changes that happened after 4.3BSD but before 4.4BSD. Two distributions of pre-4.4BSD exist today:

  • Quasijarus - http://ifctfvax.harhan.org/Quasijarus/ - It is a revival of the historical 4.3BSD release for the VAX. Everything about this system feels ancient. You may not have a real VAX to run it on, so you might use a VAX emulator like SIMH.
  • 2.11BSD - It is a continuation of the 2BSD series for the PDP-11, but has some of the features from 4.3BSD.

The Unix Heritage Society has more information.

Features

The students at Berkeley had an entire operating system to work with, and in the course of their work made several enhancements, often adding or replacing entire components of the system. The various *BSD teams continue to make more enhancements today.

  • BSD's Fast File System, for storing information on disk, replaces the original Unix file system. Like the previous system, FFS was a hierarchial system of directories containing files (of text or any arbitrary array of bytes) and other directories. However, the old file system became inefficient after files started to fill space left by earlier deleted files. FFS tried to optimize the use of disk geometry and allocate large files on consecutive free blocks of disk space, thus reducing fragmentation. FFS also gained some miscellaneous improvements including the symbolic link.
  • BSD supports virtual memory, though it was not the first to do so. Virtual memory, which allows a computer to conserve Random Access Memory and run more programs by swapping unused memory to disk, requires supporting hardware. The VAX hardware of Digital Equipment Corporation (DEC) offered the hardware, and DEC made an operating system called the Virtual Memory System (VMS) to use it. However, VMS was not anything like Unix, and no Unix on the VAX could use virtual memory until Berkeley added that feature.
  • BSD implements the Internet Protocol (IP) and related protocols for connecting to the ARPAnet, the network which became the internet. They called their implementation, Berkeley sockets. Though AT&T later made a proprietary implementation called STREAMS, the BSD sockets are free, well-respected, and still power the *BSD variants today, including Mac OS X. BSD sockets also exist in Microsoft Windows. Sockets act like existing Unix file descriptions, thus programs can read and write data across the computer network as well as they can on a disk. Further, AT&T STREAMS, though featuring better architectural layers, lacked the equivalent of the BSD select system call for waiting upon multiple open sockets (for example, until one received data), so almost no person switched from BSD sockets to STREAMS. (In a reversal, STREAMS later added a poll system call, an improvement over select. Today, *BSD includes poll but no other part of STREAMS!)
    • BSD included rlogin/rsh/rcp to copy files between and access command lines on remote computers, but those programs were very insecure. Now we use SSH instead; most everyone uses uses OpenSSH from the OpenBSD project.)
    • KAME is an IPv6 stack for *BSD, created in Japan. IPv6 is the next Internet Protocol that will replace IPv4. KAME is the leading IPv6 implementation and has been installed onto many devices in east Asia. With KAME, BSD is ready for the future internet.
  • Since 4.4BSD, the system supports the concept of a securelevel to lock a few critical parts of the system even if some intruder gains root access and root priveleges.
  • OpenBSD contains CARP, a "redundancy protocol" allowing multiple computers to share an internet address, and PF, a powerful but free firewall. There are ports of CARP and PF to other BSD variants including NetBSD.
  • FreeBSD includes the FreeBSD Ports and Packages Collection for easily installing third-party Unix software onto FreeBSD. Though the GNU/Linux community has the Debian and RPM package systems, the FreeBSD Ports Collection is notable in how it uses "Makefiles" to automate everything, including dependencies (so if you need to install x before building y, ports knows what to do). The ports developers have worked as far as to make complex packages like Mozilla Firefox, OpenOffice.org and KDE work with FreeBSD. OpenBSD has its variant, the OpenBSD Ports Collection, while NetBSD has pkgsrc.
  • BSD supports binary emulation of some the kernels of some other Unix systems. This often requires installing libraries or other files from those other Unix systems. The *BSD with the most binary emulations is NetBSD.

Curses

Another important BSD feature is the libcurses library, which programs use to draw text on arbitrary positions on a character-cell terminal. Before libcurses, computer users worked on computer terminals featuring a keyboard to input text and a printer or screen to output text. (This is after they were making holes in patterns on punch cards, but before it became common to draw graphics or have a mouse.) Text went from left to right and top to bottom, with no easy way to move the cursor leftward or upward.

At some point, screens with "addressable cursors" became available. Now you could move the cursor around the screen, dropping a letter "a" (or any character of the available alphabet or a space) anywhere. However, you had to know the correct escape sequences to do this.

The curses or libcurses software library makes it easy to do things like go to position (20, 15) and draw the word "BSD". It uses a "terminal capabilities" or termcap database to look up the correct escape sequences for the terminal. (Today, most systems replace termcap with terminfo, and libcurses uses terminfo. FreeBSD and OpenBSD have replaced the original BSD curses with ncurses, "new curses".)

Because libcurses was free software, it has become part of other Unix distributions, not only BSD. However it was BSD that gave several interesting applications to libcurses:

  • Starting in 1982 with 4.2BSD, BSD distributed a computer game called Rogue. In a randomly-generated dungeon drawn with punctuation, filled with monsters A through Z, the player as the rogue @ seeks the Amulet of Yendor. BSD spread Rogue to many universities, thus helping launch the entire genre of roguelike games. (BSD has long since replaced Rogue with a clone (also called Rogue) that includes source code, but most noticably replaces the death message tombstone with a skull.)
  • The vi (for VIsual editor) software allowes one to edit a text file while looking at it. That is, one can move the cursor around in the file, and then perform operations like inserting and deleting text. Though there are now many other visual editors (Vim, GNU Emacs, Windows Notepad, ...), and those editors make vi seem crude and difficult, vi continues to be an old Unix tradition. (The original vi did not use curses, but nvi does. Here nvi or "new vi" is a reimplementation of vi, with no AT&T code, today included in BSD.)

References

External Links

Further Reading

On the history of BSD:

On the installation and use of a BSD system:

History

Personal tools