Hybrid (micro)kernels

By: Tzvetan Mikov (tmikov.delete@this.gmail.com), May 9, 2006 10:17 am
Room: Moderated Discussions
Bill Todd (billtodd@metrocast.net) on 5/9/06 wrote:
---------------------------
>>Although you are factually correct, I disagree with your interpretation. The resemblance
>>you are refering to is not in important aspects of the design - it is like saying
>>that a car resembles a train because they both have windows.
>
>Hmmm - sounds a bit like blustering to me, and from someone who didn't understand
>the difference between IRPs and messages that may not be surprising.

Oh, come on, nice way to elevate the discussion :-) After writing system software and kernel drivers for Windows for more than 10 years (having the pleasure of debugging user mode libraries and kernel numerous times), I understand quite a bit of Windows architecture, much more intimately that I'd like to, as a matter of fact. Three years ago I started working with Linux, slowly moving towards the same level expertise (its been fun), and it gave me a whole new perspective on things and the ability to "cut through the crap", so to say. Many things which I thought were unique NT design decisions turned out to be just cosmetics and implementation details. The OS personalities are one of them, and so is LPC.

You did not address my analogy with Wine. Does running an application under Wine suddenly turn Linux into a hybrid kernel ?

>The 'sharing of architectural concepts or mechanisms' says nothing about the relative
>importance of doing so - just about some level of commonality in approaches. Nor
>does calling something a 'hybrid' suggest that it's anything close to identical
>to any parent - again, just that it shares some characteristics, to some degree.
>

Of course. However calling it a hybrid must mean that it shares enough important characteristics with the parent. I still think (and I have shown it with examples - Wine and X) that NT shares far more with Linux (which we know for a fact to be a monolithic kernel) than with QNX, for example. In parcticular, exactly the features which according to you make NT a hybrid happen to be implemented in a similar way in Linux.

>>
>>In my understanding, the personalities (Win32,OS/2,POSIX) are mostly user-mode
>>libraries mapping the calls to the kernel API possibly with the support of some
>>daemons to maintain state.
>
>Your understanding is incorrect. Support for the original graphics interface,
>for example, was completely contained in the Win32 user-mode environment subsystem
>(which was even called by the POSIX and OS/2 subsystems to perform any grahpics
>activity on their behalf, adding yet another level of user-mode indirection). Only
>in NT 4 and later did graphics support move largely into the kernel and (mostly)
>get called directly there via linked libraries rather than via a subsystem process.

Please, show me how my understanding is incorrect. Moving the GDI back and forth between kernel and user mode is a well known fact, but I don't see how it changes anything. I think you are being confused (no offense) by history:
- Windows 3.x and Windows 95 (which was basically the Win 3.x kernel) had the GDI in the kernel of course.
- Dave Cuttler did the right thing when designing NT _from scratch_ (with strong VMS influence) by putting the GDI where it belongs - in user mode - although if the book "Showstopper" is to be believed he had to overcome quite an opposition.
- Eventually in NT4 they decided to move the GDI to kernel for performance reasons.

So, you are basically saying "GDI is a kernel component, which was moved to user space, which is what a micro-kernel would do", while I claim that GDI is an user-mode component which was artifically injected into the kernel. I realize it is a matter of interpretation and I think I understand your point - the original GDI and OS personalities implementation did resemble techniques used in a microkernel. Also GDI did have to go to some deliberate lengths to enable running the display driver in user mode - like separating the video miniport driver, etc.

>Also, please explain what you consider the dramatic differences to be between 'daemons
>that maintain shared state' and the user-mode processes of a classic micro-kernel
>implementation. There is indeed a major difference in the *degree and number* of
>kernel activities between NT and a classic mirco kernel (which is why no one called
>NT a micro-kernel implementation per se, but only a 'hybrid'), but they both use
>protected user-mode processes to support functions and state shared between processes
>which in a classic monolithic kernel would instead be supported by kernel-mode code.

I must agree that it is all a matter of degree and labelling.

For me a kernel should ideally provide and expose to user mode just enough basic primitives to be able to implement efficiently any API (Posix, Win32, etc) - that doesn't make it any less monolithic - it is just a matter of design priorities. In short, I don't think that the user mode API is a part of the kernel and so implementing it in user mode is not a sign of a micro-kernel-like design. A true microkernel implements things like subsytems and device drivers in separate address spaces (it need not be user mode) and for something to be considered a hybrid it should at least provide an option for some of them.

Obviously you hold the more conservative view that a monolithic literally kernel provides user API syscalls. This is certainly a valid view, although I don't think it is an useful one, because calling something a "hybrid" using such criteria doesn't actually tell us much.

>The main *practical* difference between a monolithic kernel and a micro-kernel
>is the ability of the latter to survive problems in one or more of its user-mode
>service processes which would crash the system had the problems occurred in kernel
>code. For some activities this makes a lot of sense (at least if one does not pay
>too high a price in performance obtaining it) - bogus device drivers for random
>ancillary devices come to mind - but for others, such as the main file system, it's
>a bit difficult to imagine the system continuing to run productively if that activity
>dies (and indeed even early NT implementations depended upon the continuing functions
>of the graphics support despite the fact that it was a user-mode process, though
>one could argue that this was an implementation flaw rather than an architectural one).

No argument here.

>In any event, while the fact that NT (even early-on) evicted far less of the code
>from the kernel than it *could* have evicted indeed disqualifies it from being called
>a classic micro-kernel, the fact that it *did* evict *some* such code makes calling
>it a 'hybrid' defensible (even if some might not choose to do so because in their
>estimation more should have been moved to user space).

We can say that NT "evicted" code to user mode, only if we assume that code initially or naturally belonged in the kernel and we apparently disagree there. Even if it did, I am not sure this is enough. Here is another Linux example: does FUSE (http://fuse.sourceforge.net/) turn Linux into a hybrid kernel ? It doesn't, because Linux wasn't designed with the explicit goal of executing kernel components into separate address spaces and surviving crashes in them.

>Then again, the issue seems like a tempest in a teapot, so I won't bother pursuing it farther.

Well, I don't know, and I am grateful for all responses even if we don't agree. It is certainly interesting and the ultimate goal is to perhaps make the Wikipedia article more accurate. Now I know that while my view seems to be in the majority (judging by the other responses), it is not universally accepted as true and I have much better insight why, so I don't think I will be editing the article myself.

regards,
Tzvetan
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Hybrid (micro)kernelsTzvetan Mikov2006/05/08 03:41 PM
  Hybrid (micro)kernelsS. Rao2006/05/08 05:14 PM
  Hybrid (micro)kernelsBill Todd2006/05/08 05:16 PM
    Hybrid (micro)kernelsTzvetan Mikov2006/05/08 06:21 PM
      Hybrid (micro)kernelsnick2006/05/08 06:50 PM
      Hybrid (micro)kernelsBill Todd2006/05/09 12:26 AM
        There aren't enough words...Rob Thorpe2006/05/09 01:39 AM
          There aren't enough words...Tzvetan Mikov2006/05/09 02:10 PM
            There aren't enough words...Rob Thorpe2006/05/14 11:25 PM
        Hybrid (micro)kernelsTzvetan Mikov2006/05/09 10:17 AM
          Hybrid (micro)kernelsBill Todd2006/05/09 03:05 PM
  Hybrid (micro)kernelsrwessel2006/05/08 10:23 PM
    Hybrid kernel, not NTRichard Urich2006/05/09 05:03 AM
      Hybrid kernel, not NT_Arthur2006/05/09 06:06 AM
        Hybrid kernel, not NTRob Thorpe2006/05/09 06:40 AM
          Hybrid kernel, not NT_Arthur2006/05/09 07:30 AM
            Hybrid kernel, not NTRob Thorpe2006/05/09 08:07 AM
              Hybrid kernel, not NT_Arthur2006/05/09 08:36 AM
                Linux vs MacOSX peformance, debunked_Arthur2006/05/18 06:30 AM
                  Linux vs MacOSX peformance, debunkedRob Thorpe2006/05/18 07:19 AM
                    Linux vs MacOSX peformance, debunkedAnonymous2006/05/18 11:31 AM
        Hybrid kernel, not NTLinus Torvalds2006/05/09 07:16 AM
          Hybrid kernel, not NTAndi Kleen2006/05/09 01:32 PM
            Hybrid kernel, not NTmyself2006/05/09 02:24 PM
              Hybrid kernel, not NTmyself2006/05/09 02:41 PM
              Hybrid kernel, not NTBrendan2006/05/09 04:26 PM
                Hybrid kernel, not NTLinus Torvalds2006/05/09 07:06 PM
                  Hybrid kernel, not NTBrendan2006/05/13 12:35 AM
                    Hybrid kernel, not NTnick2006/05/13 03:40 AM
                      Hybrid kernel, not NTBrendan2006/05/13 08:48 AM
                        Hybrid kernel, not NTnick2006/05/13 06:41 PM
                          Hybrid kernel, not NTBrendan2006/05/13 08:51 PM
                            Hybrid kernel, not NTnick2006/05/14 04:57 PM
                              Hybrid kernel, not NTBrendan2006/05/14 09:40 PM
                                Hybrid kernel, not NTnick2006/05/14 10:46 PM
                                  Hybrid kernel, not NTBrendan2006/05/15 03:00 AM
                                    Hybrid kernel, not NTrwessel2006/05/15 06:21 AM
                                      Hybrid kernel, not NTBrendan2006/05/15 07:55 AM
                                        Hybrid kernel, not NTLinus Torvalds2006/05/15 08:49 AM
                                          Hybrid kernel, not NTnick2006/05/15 03:41 PM
                                          Hybrid kernel, not NTtony roth2008/01/31 01:20 PM
                                    Hybrid kernel, not NTnick2006/05/15 05:33 PM
                                      Hybrid kernel, not NTBrendan2006/05/16 12:39 AM
                                        Hybrid kernel, not NTnick2006/05/16 01:53 AM
                                          Hybrid kernel, not NTBrendan2006/05/16 04:37 AM
                  Hybrid kernel, not NTAnonymous2008/05/01 09:31 PM
                    Following the structure of the treeMichael S2008/05/02 03:19 AM
                      Following the structure of the treeDean Kent2008/05/02 04:31 AM
                        Following the structure of the treeMichael S2008/05/02 05:02 AM
                        Following the structure of the treeDavid W. Hess2008/05/02 05:48 AM
                          Following the structure of the treeDean Kent2008/05/02 08:14 AM
                            Following the structure of the treeDavid W. Hess2008/05/02 09:05 AM
                              LOL!Dean Kent2008/05/02 09:33 AM
                              Following the structure of the treeanonymous2008/05/02 02:04 PM
                                Following the structure of the treeDean Kent2008/05/02 06:52 PM
                                Following the structure of the treeFoo_2008/05/03 01:01 AM
                                  Following the structure of the treeDavid W. Hess2008/05/03 05:54 AM
                                    Following the structure of the treeDean Kent2008/05/03 09:06 AM
                                      Following the structure of the treeFoo_2008/05/04 12:06 AM
                                        Following the structure of the treeMichael S2008/05/04 12:22 AM
            Hybrid kernel, not NTLinus Torvalds2006/05/09 04:19 PM
              Microkernel Vs Monolithic KernelKernel_Protector2006/05/09 08:41 PM
                Microkernel Vs Monolithic KernelDavid Kanter2006/05/09 09:30 PM
                  Sigh, Stand back, its slashdotting time. (NT)Anonymous2006/05/09 09:44 PM
                  Microkernel Vs Monolithic Kernelblah2006/05/12 07:58 PM
                  Microkernel Vs Monolithic KernelRob Thorpe2006/05/15 12:41 AM
          Hybrid kernel, not NTAnalGuy2006/05/16 02:10 AM
            Theory versus practiceDavid Kanter2006/05/16 11:55 AM
              Distributed algorithmsRob Thorpe2006/05/16 11:53 PM
              Theory versus practiceHoward Chu2006/05/17 01:54 AM
                Theory versus practiceJS2006/05/17 03:29 AM
          Play online poker, blackjack !!! Gamezonex2007/08/16 12:49 PM
  Hybrid (micro)kernelsphilt2006/05/14 08:15 PM
    Hybrid (micro)kernelsLinus Torvalds2006/05/15 07:20 AM
      Hybrid (micro)kernelsLinus Torvalds2006/05/15 10:56 AM
        Hybrid (micro)kernelsRob Thorpe2006/05/16 12:22 AM
          Hybrid (micro)kernelsrwessel2006/05/16 10:23 AM
            Hybrid (micro)kernelsRob Thorpe2006/05/16 11:43 PM
              Hybrid (micro)kernelsrwessel2006/05/17 12:33 AM
                Hybrid (micro)kernelsRob Thorpe2006/05/19 06:51 AM
                  Hybrid (micro)kernelsrwessel2006/05/19 11:27 AM
      Hybrid (micro)kernelstechIperson2006/05/15 12:25 PM
      Hybrid (micro)kernelsmas2006/05/15 04:17 PM
        Hybrid (micro)kernelsLinus Torvalds2006/05/15 04:39 PM
          Hybrid (micro)kernelsColonel Kernel2006/05/15 08:17 PM
            Hybrid (micro)kernelsWink Saville2006/05/15 09:31 PM
              Hybrid (micro)kernelsLinus Torvalds2006/05/16 09:08 AM
                Hybrid (micro)kernelsWink Saville2006/05/16 08:55 PM
          Hybrid (micro)kernelsrwessel2006/05/16 10:31 AM
            Hybrid (micro)kernelsLinus Torvalds2006/05/16 11:00 AM
        Hybrid (micro)kernelsBrendan2006/05/16 12:36 AM
        Hybrid (micro)kernelsPaul Elliott2006/09/03 07:44 AM
          Hybrid (micro)kernelsRob Thorpe2006/09/04 08:25 AM
      Hybrid (micro)kernelsphilt2006/05/15 11:55 PM
        Hybrid (micro)kernelspgerassi2007/08/16 06:41 PM
  Another questionable entry on Wikipedia?Chung Leong2006/05/18 09:33 AM
  Hybrid (micro)kernelsisrael2006/05/20 03:25 AM
    Hybrid (micro)kernelsRob Thorpe2006/05/22 07:35 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell avocado?