A Comparison of Solaris, Linux, and FreeBSD Kernel
v1x writes "An article at OpenSolaris examines three of the basic subsystems of the kernel and compares implementation between Solaris 10, Linux 2.6, and FreeBSD 5.3.
From the article: 'Solaris, FreeBSD, and Linux are obviously benefiting from each other. With Solaris going open source, I expect this to continue at a faster rate. My impression is that change is most rapid in Linux. The benefits of this are that new technology has a quick incorporation into the system.'"
A Comparison of Solaris, Linux, and FreeBSD Kernels
by Max Bruning
October 14, 2005
I spend most of my time teaching classes on Solaris internals, device drivers, and kernel crash dump analysis and debugging. When explaining to classes how various subsystems are implemented in Solaris, students often ask, "How does it work in Linux?" or, "In FreeBSD, it works like this, how about Solaris?" This article examines three of the basic subsystems of the kernel and compares implementation between Solaris 10, Linux 2.6, and FreeBSD 5.3.
The three subsystems examined are scheduling, memory management, and file system architecture. I chose these subsystems because they are common to any operating system (not just Unix and Unix-like systems), and they tend to be the most well-understood components of the operating system.
This article does not go into in-depth details on any of the subsystems described. For that, refer to the source code, various websites, and books on the subject. For specific books, see:
* Solaris Internals: Core Kernel Architecture by McDougall and Mauro (visit Solaris Internals)
* The Design and Implementation of the FreeBSD Operating System by McKusick and Neville-Neil (visit The Design and Implementation of the FreeBSD Operating System)
* Linux Kernel Development by Love (visit Linux Kernel Development, 2nd Edition) and Understanding the Linux Kernel by Bovet and Cesati (visit Understanding the Linux Kernel, 2nd Edition)
If you search the Web for Linux, FreeBSD, and Solaris comparisons, most of the hits discuss old (in some cases, Solaris 2.5, Linux 2.2, etc.) versions of the OSes. Many of the "facts" are incorrect for the newest releases, and some were incorrect for the releases they intended to describe. Of course, most of them also make value judgments on the merits of the OSes in question, and there is little information comparing the kernels themselves. The following sites seem more or less up to date:
* "Solaris Vs. Linux" is pretty one-sided for Solaris 10 over Linux.
* "Comparing MySQL Performance" on Solaris 10, Linux, FreeBSD, and others.
* "Fast Track to Solaris 10 Adoption" has some comparisons between Linux and Solaris.
* "Solaris 10 Heads for Linux Territory" is not really a comparison, but reviews Solaris 10.
One of the more interesting aspects of the three OSes is the amount of similarities between them. Once you get past the different naming conventions, each OS takes fairly similar paths toward implementing the different concepts. Each OS supports time-shared scheduling of threads, demand paging with a not-recently-used page replacement algorithm, and a virtual file system layer to allow the implementation of different file system architectures. Ideas that originate in one OS often find their way into others. For instance, Linux also uses the concepts behind Solaris's slab memory allocator. Much of the terminology seen in the FreeBSD source is also present in Solaris. With Sun's move to open source Solaris, I expect to see much more cross-fertilization of features. Currently, the LXR project provides a source cross-reference browser for FreeBSD, Linux, and other Unix-related OSes, available at fxr.watson.org. It would be great to see OpenSolaris source added to that site.
Scheduling and Schedulers
The basic unit of scheduling in Solaris is the kthread_t; in FreeBSD, the thread; and in Linux, the task_struct. Solaris represents each process as a proc_t, and each thread within the process has a kthread_t. Linux represents processes (and threads) by task_struct structures. A single-threaded process in Linux has a single task_struct. A single-threaded process in Solaris has a proc_t, a single kthread_t, and a klwp_t. The klwp_t provides a save area for threads switching between user and kernel modes. A single-thre
It would appear they have not, or if support is available they do not include it with the core FreeBSD code.
It's not in the kernel modules portion of the FreeBSD CVS repository:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lkm/
Nor is such code with the other filesystem code:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/
Cyric Zndovzny at your service.
Yeah, it's more of a life style choice.
Do you even lift?
These aren't the 'roids you're looking for.
I put the title in all caps because I am responding to dozens of people claiming Solaris is monolithic. It is not. The Solaris microkernel is a stripped-down SVr4 kernel. Drivers are loaded from it and run in the same context for performance reasons, everything else outside of scheduling, interrupts, and a few other services runs strictly in user space and is dynamically loadable. I've heard the model referred to as an "object-oriented" architecture, since modules can call functions in other modules, though Mach, the famous microkernel, is also pretty thoroughly object-oriented, as is Windows XP's kernel, so this is somewhat confusing when used as a term to differentiate the architecture from a microkernel.
(%i1) factor(777353);
(%o1) 777353