Hybrid kernel
From Wikipedia, the free encyclopedia
Hybrid kernel is a kernel architecture based on combining aspects of microkernel and monolithic kernel architectures used in computer operating systems. The category is controversial due to the similarity to monolithic kernel; the term has been dismissed by some as just marketing. The usually accepted categories are monolithic kernels and microkernels (with nanokernels and picokernels seen as more extreme versions of microkernels).
The idea behind this quasi-category is to have a kernel structure similar to a microkernel, but implemented as a monolithic kernel. In contrast to a microkernel, all (or nearly all) services are in kernel space. As in a monolithic kernel, there is no performance overhead associated with microkernel message passing and context switching between kernel and user mode. Also, as with monolithic kernels, there are none of the benefits of having services in user space.
Contents |
[edit] Controversy
That leads to the controversy - does having a microkernel-like structure in a monolithic kernel make such a distinct difference that another category of kernels is needed?
[edit] Proponents
Microsoft normally uses the term "microkernel" and sometimes "modified microkernel", "modified microkernel or macrokernel"<ref name="MSNT">MS Windows NT Kernel-mode User and GDI White Paper</ref> when describing the kernel part of the architecture of the Windows NT operating system line. The whole architecture is said to be composed of a "modified microkernel", drivers, Executive, and HAL, and GDI/GDI+ all in kernel space. There are user space APIs supporting different OS environments.
[edit] Opponents
Many operating systems and kernel experts have dismissed the label as meaningless, and just marketing:
Linus Torvalds said of this issue: "As to the whole 'hybrid kernel' thing - it's just marketing. It's 'oh, those microkernels had good PR, how can we try to get good PR for our working kernel? Oh, I know, let's use a cool name and try to imply that it has all the PR advantages that that other system has'"<ref>Linus Torvalds, Real World Technologies Discussion Forum (2006-05-09)</ref>
Sonny Rao of the IBM LTC Kernel Performance File/IO team said: "It's wrong...I think this talk ... was born from some kind of half-assed marketing game to try and make XXX kernel seem 'more advanced.' 'Micro' and 'hybrid' are always better/more advanced than 'Monolithic' right??<ref>Sonny Rao, Real World Technologies Discussion Forum (2006-05-08)</ref>
Tzvetan Mikov (compiler practitioner) writes: "Networking, storage, filesystems, usb, audio and everything else is in the same kernel address space, sharing data structures, etc, and has always been since the very inception of NT. That's how it was designed and as far as I know, there was never any intent to implement any of that in user mode... I guess we could call it a hybrid if it was designed to support user-mode drivers, at least optionally, e.g. for USB, file systems, and it offered at least some guarantees that a crash in such a user-mode driver would not bring down the system, but it isn't."<ref>Tzvetan Mikov, Real World Technologies Discussion Forum (2006-05-08)</ref>
[edit] Hybrid kernel example - NT kernel
[edit] Description
The best known example of a hybrid kernel is the NT kernel inside Windows NT, Windows 2000, Windows XP, Windows 2003, and Windows Vista. All Windows NT kernel services run in kernel space. The HAL, Executive, and drivers are all also in kernel space. Since NT 4.0, the graphical/printing subsystem (GDI, later GDI+) was also brought into kernel space to improve performance (see diagram).
The lower levels of the architecture are in kernel mode. They consist of the lowest level - the HAL. Then the kernel and drivers which sit between the HAL and the NT executive. The Executive provides the equivalent of microkernel servers but, unlike microkernels, faster interfacing can be used in order to optimize performance.
The higher levels of the architecture are in fact in user mode, firstly the Native API which calls routines in the Executive. Above the Native API are system call interfaces providing APIs for different operating systems - Win32 (Win32 API), OS/2 (OS/2 API), POSIX (POSIX API). It is also worth noting that the OS/2 and POSIX APIs are built upon the Win32 API, and not the Native API.
[edit] Classification
Microsoft uses various terms including macrokernel<ref name="MSNT">MS Windows NT Kernel-mode User and GDI White Paper</ref>. The NT kernel is predominantly monolithic (that is kernel mode), structured internally in a similar way to a microkernel, but it is only slightly microkernel due to user mode OS APIs. That has always been the case - even before NT 3.51. Ironically, monolithic kernels normally have graphics/printing in user mode, NT 4.0 and newer contain the GDI (or later GDI+) in kernel mode.
[edit] Hybrid kernel example - Plan 9 kernel
[edit] Description
One of the main design goals is to represent all resources as files and use a single communication protocol for both local and remote resources. The Plan 9 kernel uses both in-kernel (kernel mode) but more commonly user mode servers. Communication with user mode servers - fileservers - uses 9P. Kernel mode examples are device drivers and network interfaces (ethernet). Examples of user mode are networking (IP stack), environment, mailboxes, serial-console multiplexor, spam filter, CD interpreter, foreign filesystems and tapes, backup system, window system, and /proc <ref>Why Plan 9 matters, Geoff Collyer (2006-09-12)</ref>.
[edit] Classification
Due to the extensive use of user mode fileservers together with some in-kernel systems, this is a simpler candidate for inclusion as a hybrid kernel.
[edit] Putative hybrid kernel examples
- BeOS kernel
- Haiku kernel
- BSD-based
- DragonFly BSD (first non-Mach BSD OS to use a hybrid kernel)
- XNU kernel (core of Darwin, used in Mac OS X)
- NetWare kernel
- Plan 9 kernel
- Inferno kernel
- NT kernel (used in Windows NT, 2000, 2003; XP, Vista)
- ReactOS kernel
[edit] Notes
<references/>
[edit] References
- Linus Torvalds on Real World Tech
- Hybrid Kernel category criticised
- Sysinternals article about the NT Native API

