8.7 KiB
FAQ: BSD
Had history been slightly different, you’d be reading FreeBSD Voice today…
So what’s the deal with this Birsa Seva Dal then? Isn’t it a political group in India?
Very funny – you looked up the “BSD” disambiguation page on Wikipedia just to make that joke, didn’t you? Here we’re talking about the Berkeley Software Distribution, a family of operating systems that are much more widely used than you might think.
Sorry, I couldn’t help myself. OK, so what’s the deal with these OSes?
There are three main BSD operating systems in use today. They are based on Unix, they are open source, they tend to be used in server roles, but can also make good desktops and workstations as well. They run KDE, Firefox, LibreOffice, Apache, MySQL and pretty much any open source application you can name. They’re reliable, secure and support a lot of different hardware.
Congratulations – you’ve just described GNU/Linux…
True. Linux has all of the things I’ve just mentioned, and that’s why a lot of people never investigate BSD. In day-to-day usage, there isn’t a lot of difference between the BSD family and Linux, largely because they all have Unix underpinnings, and also because they share a lot of software. You could be logged into a remote machine, hacking some Python code in Vim, and checking your email in Mutt, and you wouldn’t know you were running BSD. Or you could be using an internet terminal in a cafe somewhere and not know it’s BSD.
The biggest differences are in the development model and licence, and to understand this, we need to step back in time. The B in BSD refers to the University of California, Berkeley, which was a hotbed of open source Unix development back in the 1980s. As the 90s came, x86-based PCs were becoming popular and many people were interested in having a Unix-like OS on their home computers. A project called 386BSD was released in 1992 to provide just that.
And where were all the Linux distributions at this time?
Good question! You might know that one year before, Linus Torvalds had announced his kernel, which, when paired with the GNU project, formed a complete open source operating system. Linus had been following GNU’s own kernel (Hurd) and 386BSD, and said that had either of them been ready for daily use, he probably wouldn’t have created Linux. So the first few years of the 90s were tremendously lively for open source operating systems, and nobody was really sure which ones would succeed.
Then it got messy for BSD. AT&T, the original developer of Unix, was trying to monetise its work on the operating system and claimed that BSD infringed its intellectual property rights. This culminated in a lawsuit in 1992 which severely held back BSD development. In the end, various chunks of the BSD source code had to be rewritten – while all this time, GNU/Linux was gaining features, stability and popularity.
BSD was arguably in a more mature state than GNU/Linux in the early 1990s, and without these legal complications it could have become the standard on x86 PCs. We could all be using it today instead of Linux.
But you said earlier that BSD is still widely used, so things improved after that?
Yes. 386BSD development stagnated, but two teams of developers working over the internet created separate successor projects. FreeBSD became the most widely used flavour of BSD, and is now the closest to Linux as a desktop and server operating system, while NetBSD focused on portability (today it runs on over 50 platforms, all built from the same codebase). The third flavour, OpenBSD, forked off from NetBSD just a few years after NetBSD started due to a developer spat, and today it’s well known for its concentration on security. Over the years, OpenBSD has created many programs that have become standard on Linux, such as OpenSSH – and now we have LibreSSL too.
So these three flavours of BSD are like Linux distributions?
Yes and no. Each BSD has a separate codebase and separate development teams, although there is a lot of code-flow between them (especially for hardware drivers). But they are standalone operating systems with their own features, pros and cons.
We mentioned that the development model of the BSDs is one feature that really distinguishes them from GNU/Linux. There’s nobody in charge of GNU/Linux as a whole: some teams are working on the GNU components, some are working on the kernel, some on boot scripts, some on manual pages, some on libraries, and so forth. The development model is often called “wild west”, with a lack of central authority, and distributions do all the hard work of fitting everything together.
The BSDs, in contrast, are developed as complete projects from centralised source code trees. The kernel, the libraries, the system utilities and the manual pages are all stored and worked on in the same place. Many BSD fans argue that this gives the operating systems more coherency and stability, and from our years of dabbling with BSD we can attest that the manual pages are largely superb.
Don’t the BSDs use anything from GNU/Linux?
Yes, especially GCC. The GNU Compiler Collection has been the de-facto standard compiler on free Unix systems for decades, although FreeBSD has recently moved to LLVM/Clang. It’s important to note that the BSDs also use other open source projects that aren’t specifically GNU or Linux, such as the X Window System (XFree86 and X.org), Perl and so forth. And thanks to standards such as POSIX, most programs that run on Linux can be recompiled to run on the various BSD flavours.
So, you could replace the L in a LAMP (Linux, Apache, MySQL and PHP) stack with FreeBSD, and get pretty much the same environment, with a different set of features (eg variations in filesystem and driver support). And there are some mega, super, huge users of FreeBSD, such as Netflix, which serve up ridiculous amounts of data every day. While FreeBSD makes a good desktop OS, its strengths really lie in the server room, with exceptional reliability and network performance.
OpenBSD tends to be used in smaller web serving, file hosting, firewall and gateway roles where security is imperative. NetBSD is the least popular of the main BSD flavours – it can run on almost anything though, including old Amigas and Acorn boxes, and sometimes finds itself inside closed-source network devices.
Hang on – how can someone close the source code? That ain’t kosher in Linux!
Correct, and here we come to the other major difference with GNU/Linux. The licence for the BSD flavours (called, funnily enough, the BSD Licence) is very different to the GPL that we know. For starters, it’s much shorter. The BSD Licence essentially says: do what you want with this code, but give the original developers credit for writing it, and don’t try to sue them if it blows up your computer.
So there’s nothing in the licence that forces the code to stay open, unlike with the GPL, which requires that users of the code also make their modifications freely available. This crucial difference has sparked countless flame wars over the years, with BSD fans saying that their licence is more free (because it’s less restrictive), while GNU/GPL fans say that their licence is actually more free (because it preserves freedom down the road).
Blimey. Anyway, now that you’ve piqued my interest, where can I try out all these lovely BSD flavours?
You can probably guess the websites – www.openbsd.org, www.freebsd.org and www.netbsd.org – where you can download ISO images, boot them in VirtualBox, and play around. If you’ve been using Linux for a while, you won’t find any of them too difficult, although you’re expected to know your way around the command line. If you’re looking for something more newbie-friendly, PC-BSD
(www.pcbsd.org) is a customised version of FreeBSD focused on the desktop, with a fancy graphical installer and super-simple management of software. Have fun exploring!
via: http://www.linuxvoice.com/faq-bsd-2/
作者:Mike Saunders 译者:译者ID 校对:校对者ID