Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
Like this article? We recommend

NetBSD

The NetBSD tag line is "of course it runs NetBSD," and a long-running joke was that NetBSD was the OS you ran on your toaster. This ceased to be a joke a few months ago when the NetBSD team proudly demonstrated a toaster running their OS.

BSD has traditionally been easy to port to new architectures. The system contains a few platform-specific files, and the rest of the code uses an abstraction layer to implement features. The memory subsystem, for example, has a handful of (simple) platform-dependent functions, with the vast majority being implemented in a cross-platform way.

NetBSD builds on this. NetBSD 2.1 was released with support for 48 architectures. In the context of NetBSD, support for an architecture means that a boot-loader exists, can boot the kernel, and all of the userland components in the base system work.

NetBSD makes extensive use of cross-compilation. The entire system can be built on any platform that runs NetBSD (and some others) for any hardware running NetBSD. For example, it is possible to use a fast Windows machine to build NetBSD using the Cygwin POSIX emulation layer to install it on an old m68K Mac that would take a week or two to built the system itself. Thus, it is easy to test NetBSD on less-powerful hardware because every change can be compiled easily on a faster machine.

Recently, NetBSD has begun to focus more on performance. The new threading system is based on an N:M model, where the kernel schedules N threads, and a userspace scheduler multiplexes this to M user-visible threads. This is the same model used by Solaris, which is well-known for its multithreading performance, and similar to that used by FreeBSD 5 and later.

Many people who don’t use NetBSD are familiar with it because of pkgsrc, the system used for distributing third-party applications. pkgsrc runs on a number of other operating systems, including the Solaris and Mac OS X, and the NetBSD team recently received a donation from Sun to help the Solaris support.

The focus on portability gives NetBSD a very clean code base, making it a good system to study in an academic setting. One side effect is that it is often chosen as a base when implementing experimental new features. If these features are successful, they usually end up being ported to the other BSDs.

  • + Share This
  • 🔖 Save To Your Account