Slashdot Mirror


Microkernel: The Comeback?

bariswheel writes "In a paper co-authored by the Microkernel Maestro Andrew Tanenbaum, the fragility of modern kernels are addressed: "Current operating systems have two characteristics that make them unreliable and insecure: They are huge and they have very poor fault isolation. The Linux kernel has more than 2.5 million lines of code; the Windows XP kernel is more than twice as large." Consider this analogy: "Modern ships have multiple compartments within the hull; if one compartment springs a leak, only that one is flooded, not the entire hull. Current operating systems are like ships before compartmentalization was invented: Every leak can sink the ship." Clearly one argument here is security and reliability has surpassed performance in terms of priorities. Let's see if our good friend Linus chimes in here; hopefully we'll have ourselves another friendly conversation."

112 of 722 comments (clear)

  1. Eh hem. by suso · · Score: 3, Insightful

    Current operating systems are like ships before compartmentalization was invented

    Isn't SELinux kinda like compartmentalization of the OS?

    1. Re:Eh hem. by Anonymous Coward · · Score: 3, Informative

      SE Linux provides security models to compartmentalize your programs and applications and such. This is a completely different beast then compartmentalizing your individual kernel parts. Modules was kind of a primitive step in the direction of a microkernel, but still a long ways off from a technical standpoint.

    2. Re:Eh hem. by Ohreally_factor · · Score: 4, Funny

      Ship analogies are confusing and a tool of the devil.

      Could someone out this into an easy-to-understand car analogy, like the good Lord intended?

      --
      It's not offtopic, dumbass. It's orthogonal.
    3. Re:Eh hem. by Kjella · · Score: 3, Informative

      Isn't SELinux kinda like compartmentalization of the OS?

      No, it's compartmentalization of the applications. Besides, the analogy is really bad because a ship with a blown compartment is quite useful. Computers with a blown network driver will e.g. break any network connections going on, in other words a massive failure. What about a hard disk controller which crashes while data is being written? Drivers should not crash, period. Trying to make a system that could survive driver failure will just lead to kernel bloat with recovery code.

      --
      Live today, because you never know what tomorrow brings
    4. Re:Eh hem. by dascandy · · Score: 2, Funny

      An OS is like a car, you have a good bit of it that takes care of moving your car (the kernel / engine compartment) and a good bit that takes care of you ("user space" for both). The idea is, you can do whatever you want in any passenger seat (login as user, can't crash the system), when you're root (driver) you can crash the system (into a tree or an oops, whichever suits your fancy). Now, when there's a flaw with the suspension that causes your wheels to drift out from under the car, this microkernel mechanism allows you to leave the car in floating condition in the middle of the highway, call the emergency service, they'll reattach the wheels and you can drive on. The same for engine failure, when it fails you'll just stop and you can get another and you can continue. Theoretically, you could have a failed battery after which your car just stops somewhere and you can't run off. Of course, all runs on the car power, so you can't dial emergency help and you're stuck with a perfectly good car that doesn't move. Or, for the analogy, a kernel that can't load a new disk driver off disk.

      The kernel should run the drivers that need system level access and shouldn't have been running any other tasks in kernel mode in any case.

  2. O Tanenbaum... by ZombieRoboNinja · · Score: 3, Funny

    ...I got nothing.

    1. Re:O Tanenbaum... by cbiltcliffe · · Score: 5, Funny

      O Tanenbaum, O Tanenbaum
      Your microk3rn3l rul3z!
      O Tanenbaum, O Tanenbaum
      Those m0n0lithic foolz!
      They build a kernel all-in-one,
      Where all the bugs can have free run.
      O Tanenbaum, O Tanenbaum
      Those Linux guys just drool. ;)

      --
      "City hall" in German is "Rathaus" Kinda explains a few things......
  3. The unsinkable Kernel by Random+Destruction · · Score: 5, Funny

    So this microkernel is the unsinkable kernel?
    FULL SPEED AHEAD!

    --
    :x
    1. Re:The unsinkable Kernel by C_nemo · · Score: 2, Informative

      May i Point out that the Titanic was divided into compartments, but only in the vertical direction. No horizontal compartments, and hence since she sutained damage to critical_number_of_compartments + 1, trimming of the ship + water ingress allowed the remaing compartments to be progressively filled.

    2. Re:The unsinkable Kernel by tenchiken · · Score: 3, Interesting

      It also should be noted that for some insane reason, the Titanic crew didn't counterflood. If they had they might have been able to significantly slow down the entire drop of the ship, and almost certainly the frame of the ship would have remained intact on the water rather then having the stern of the ship rise out of the water, and then the entire ship snapping.

    3. Re:The unsinkable Kernel by this+great+guy · · Score: 3, Funny

      Andrew should name such an unsinkable kernel TiTanenbaum.

  4. How hard... by JonJ · · Score: 3, Interesting

    Would it be to convert Linux to a microkernel? And Apple is using Mach and BSD as the kernel XNU, are they planning to make it a true microkernel? AFAIK it does some things in kernel space that makes it not a microkernel.

    --
    -- Linux user #369862
    1. Re:How hard... by cp.tar · · Score: 2, Funny

      Well, I hear that GNU/HURD is in the making...

      --
      Ignore this signature. By order.
    2. Re:How hard... by mmkkbb · · Score: 2, Informative

      Linux can be run on top of a Mach microkernel. Apple supported an effort to do this called mkLinux which ran on both Intel and PowerPC hardware.

      --
      -mkb
    3. Re:How hard... by iabervon · · Score: 4, Interesting

      This is actually sort of happening. Recent work has increased the number of features that can be provided in userspace. Of course, this is done very differently from how a traditional microkernel does it; the kernel is providing virtual features, which can be implemented in user space. For example, the kernel has the "virtual file system", which handles all of the system calls, to the point where a call to the actual filesystem is needed (if the cache, which the VFS handles, is not sufficient). The actual calls may be made to userspace, which is a bit slow, but it doesn't matter, because it's going to wait for disk access anyway.

      The current state is that Linux is essentially coming around to a microkernel view, but not the classic microkernel approach. And the new idea is not one that could easily grow out of a classic microkernel, but one that grows naturally out of having a macrokernel but wanting to push bug-prone code out of it.

    4. Re:How hard... by Sique · · Score: 2, Insightful

      Check out mkLinux and L4Linux. The efforts are made. The userland linux service on a microkernel is a reality.

      --
      .sig: Sique *sigh*
    5. Re:How hard... by rg3 · · Score: 2, Insightful

      Another example of this approach is libusb. Instead of providing drivers for USB devices inside the kernel, you can do that with libusb. It gives you an interface to the USB system. Many scanner and printer drivers use it, and the drivers are included in the CUPS or SANE packages.

    6. Re:How hard... by samkass · · Score: 2, Informative

      Years before mkLinux, CMU experimented with some software called MacMach. It ran a "real" BSD kernel over Mach, and MacOS 6.0.7 on top of that. (By "real" I mean that you had to have one of those uber-expensive old BSD licenses to look at the code.) You could even "ps" and get MacOS processes in the list, although they weren't full peers of a unix process. I believe the most recent machine MacMach could run on was a Mac ][ci.

      Also, in the early 90's Tenon Intersystems had a MacOS running on Mach that had some UNIXy stuff underneath as well.

      Then, of course, there was mkLinux, known for being almost compatible with Linux, almost compatible with most hardware, and almost as fast as just running Linux.

      All of them ran reasonably well, but neither really embraced the kernelized design from UI to drivers to hardware, and all were to varying degrees slower than the mainstream versions of their software.

      --
      E pluribus unum
  5. Or... by Mr.+Underbridge · · Score: 5, Funny
    You could just have a small monolithic kernel, and do as much as possible in userland.

    Best of both worlds, no? Wow, I wish someone would make such an operating system...

    1. Re:Or... by Zarhan · · Score: 2, Interesting

      Considering how much stuff has recently been moved to userland in Linux (udev, hotplug, hal, FUSE (filesystems), etc) I think we're heading in that direction. SELinux is also something that could be considered "compartmentalized".

  6. NT4 by truthsearch · · Score: 2, Interesting

    NT4 had a microkernel whose sole purpose was object brokering. What I think we're missing today is a truely compartmentalized microkernel. The NT4 kernel handled all messages between kernel objects, but all it did was pass them along. One object running in kernel space could still bring down the rest. I assume that's still the basis of the XP kernel today.

    I haven't looked at GNU/Hurd but I have yet to see a "proper" non-academic microkernel which lets one part fail while the rest remain.

    1. Re:NT4 by segedunum · · Score: 4, Interesting

      NT4 had a microkernel whose sole purpose was object brokering.

      Well, I wouldn't call NT's kernel a microkernel in any way for the very reason that it was not truly compartmentalised and the house could still be brought very much down - quadruply so in the case of NT 4. You could call it a hybrid, but that's like saying someone is a little bit pregnant. You either are or you're not.

    2. Re:NT4 by Xiaran · · Score: 2, Informative

      Indeed. Microsoft have also been forced time and time again to make compromises to get better performance. An example of this is known to people that write file filter ddrivers for NT. Basically they seemingly couldnt make(a reasonably nice) object model run fast enough in some circumstance. So now there are effectively *two* file system interfaces for and NT files system : one that uses the regular IRP passing schmantics and the other doing direct calls into your driver to speed things up.

      This, as people can imagine, complicates everything(in a particular part of NT that is already complicated enough and not terribly well documented).

  7. Trusted Computing by SavedLinuXgeeK · · Score: 2, Interesting

    Isn't this similar, in idea, to the Trusted Computing movement. It doesn't compartamentalize, but it does ensure integrity at all levels, so if one area is compromised, the nothing else is given the ability to run. That might be a better move, than the idea of compartamentalizing the kernel, as too many parts are interconnected. If my memory handler fails, or if my disk can't read, I have a serious problem, that sinks the ship, no matter what you do.

    --
    je suis parce que j'aime
    1. Re:Trusted Computing by Chandon+Seldon · · Score: 2, Insightful

      Trusted computing merely checks that the code hasn't changed since it was shipped. This verifies that no new bugs have been added and that no old old bugs have been fixed.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
  8. multicompartment isolation by maynard · · Score: 2, Insightful

    didn't save the Titanic. Every microkernel system I've seen has been terribly slow due to message passing overhead. While it may make marginal sense from a security standpoint to isolate drivers into userland processes, the upshot is that if a critical driver goes *poof!* the system still goes down.

    Solution: better code management and testing.

    1. Re:multicompartment isolation by LurkerXXX · · Score: 4, Insightful

      BeOS didn't seem slow to me. No matter what I threw at it.

    2. Re:multicompartment isolation by Bush+Pig · · Score: 2, Interesting

      The Titanic wasn't actually _properly_ compartmentalised, as each compartment leaked at the top (unlike a number of properly compartmentalised ships built around the same time, which would have survived the iceberg).

      --
      What a long, strange trip it's been.
    3. Re:multicompartment isolation by WindBourne · · Score: 2, Insightful
      didn't save the Titanic.

      It actually took hitting something like half the compartments to sink her. If it had hit just one less compartment, she would have stay afloat. In contrast, one hole in a none compartmentalized ship can sink it.

      That is no different than an OS. In just about any monolithic OS, one bug is enough to sink them.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    4. Re:multicompartment isolation by gEvil+(beta) · · Score: 5, Funny

      So wait a second. In your analogy, which part of Linux plays the Leonardo DiCaprio role? (I'm curious to know which part of Linux I should take out back and kick repeatedly.)

      --
      This guy's the limit!
    5. Re:multicompartment isolation by Xiaran · · Score: 2, Informative

      You're still dependent on sane message passing for the system to function. Further, no one has yet to argue that message passing doesn't badly impact system performance. That's because it does.

      Ive coded under QNX a lot and would stronghly disagree with your view on the message passing overhead. From this QNX page.

      QNX interprocess communication consists of sending a message from one process to another and waiting for a reply. This is a single operation, called MsgSend. The message is copied, by the kernel, from the address space of the sending process to that of the receiving process. If the receiving process is waiting for the message, control of the CPU is transferred at the same time, without a pass through the CPU scheduler. Thus, sending a message to another process and waiting for a reply does not result in "losing one's turn" for the CPU. This tight integration between message passing and CPU scheduling is one of the key mechanisms that makes QNX message passing broadly usable. Most UNIX and Linux interprocess communication mechanisms lack this tight integration, although an implementation of QNX-type messaging for Linux does exist. Mishandling of this subtle issue is a primary reason for the disappointing performance of some other microkernel systems.

    6. Re:multicompartment isolation by renoX · · Score: 2, Informative

      And BeOS is called a "Modular Hybrid Kernel" by wikipedia: hybrid implies that you don't get the full protection..

  9. The thing is... by gowen · · Score: 5, Interesting

    Container ships don't have to move cargo from one part of the ship to another, on a regular basis. You load it up, sail off, and then unload at the other end of the journey. If the stuff in the bow had to be transported to the stern every twelve hours, you'd probably find fewer enormous steel bulkheads between them, and more wide doors.

    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    1. Re:The thing is... by crawling_chaos · · Score: 4, Insightful
      Compartmentalization had very little to do with the advent of the container ship. Titanic was partially compartmented, but they didn't run above the waterline, so that the breach of several bow compartments led to overtopping of the remainder and the eventual loss of the ship. Lusitania and Mauretania were built with full compartments and even one longitudinal bulkhead because the Royal Navy funded them in part to use as auxilliary troopships. Both would have survived the iceberg collision, which really does make one wonder what was in Lusitania's holds when those torpedoes hit her.

      Comparments do interfere with efficient operation, which is why Titanic's designers only went halfway. Full watertight bulkheads and a longitudinal one would have screwed up the vistas of the great dining rooms and first class cabins. It would also have made communication between parts of the ship more difficult as watertight bulkheads tend to have a limited number of doors.

      The analogy is actually quite apt: more watertight security leads to decreased usability, but a hybrid system (Titanic's) can only delay the inevitable, not prevent it, and nothing really helps when someone is lobbing high explosives at you from surprise.

      --
      You can only drink 30 or 40 glasses of beer a day, no matter how rich you are.
      -- Colonel Adolphus Busch
  10. Theory Vs. Practice by mikeisme77 · · Score: 3, Interesting

    This sounds great in theory, but in reality it would be impractical. 2.5 million lines of code handling all of the necessary things the Linux Kernel handles really isn't that bad. Adding compartmentalization into the mix will only make it more complicated and make it more likely for a hole to spring somewhere in the "hull"--maybe only one compartment will be flooded then, but the hole may be harder to patch. However, I wouldn't rule compartmentalization out completely, but it should be understood that doing so will increase the complexity/size and not necessarily lower the size/complexity. And isn't Windows XP or Vista like 30 million lines of code (or more)? That's a LOT more than double the size of the Linux kernel...

    1. Re:Theory Vs. Practice by Shazow · · Score: 3, Informative
      wouldn't rule compartmentalization out completely, but it should be understood that doing so will increase the complexity/size and not necessarily lower the size/complexity.

      Just to clear things up, my understanding is that Tanenbaum is advocating moving the complexity out of kernel space to user space (such as drivers). So you wouldn't be lowering the size/complexity of the kernel altogether, you'd just be moving huge portions of it to a place where it can't do as much damage to the system. Then the kernel just becomes one big manager which tells the OS what it's allowed to do and how.

      - shazow
    2. Re:Theory Vs. Practice by mikeisme77 · · Score: 3, Interesting

      But then you'd have issues with performance and such. The reason the current items are in the kernel to begin with have to do with the need for them to be able to easily communicate with one another and their need to be able to have system override access to all resources. It does make his claim more valid, but it's still not a good idea in practice (unless you're primary focus for an OS is security rather than performance). I also still think that this method would make the various "kernel" components harder to manage/patch--I put kernel in quotes because the parts that would be moved to user land would still be part of the kernel to me (even if not physically).

    3. Re:Theory Vs. Practice by zhiwenchong · · Score: 5, Funny

      In theory, there is no difference between theory and practice. But, in practice, there is.

      - Jan L.A. van de Snepscheut

      Sorry, couldn't resist. ;-)

    4. Re:Theory Vs. Practice by ronanbear · · Score: 2, Informative

      The 30 or so million lines of code in XP refers to everything. The XP kernel is only a fraction of XP but is still larger than the linux kernel.

      --
      the more they over-think the plumbing the easier it is to stop up the pipe
  11. Re:Feh. by AKAImBatman · · Score: 5, Interesting

    It holds no more true in practice today than it did when he started.

    WRONG.

    Tanenbaum's research is correct, in that a Microkernel architecture is more secure, easier to maintain, and just all around better. The problem is that early Microkernel architectures killed the concept back when most of the OSes we use today were being developed.

    What was the key problem with these kernels? Performance. Mach (one of the more popular research OSes) incurred a huge cost in message passing as every message was checked for validity as it was sent. This wouldn't have been *so* bad, but it ended up worse because a variety of flaws in the Mach implementation. There was some attempt to address this in Mach 3, but the project eventually tappered off. Oddly, NeXT (and later Apple) picked up the Mach kernel and used it in their products. Performance was fixed partly through a series of hacks, and partly through raw horsepower.

    Beyond that, you might want to read the rest of TFA. Tanenbaum goes over several other concepts that are hot at the moment, include Virtual Machines, Virtualization, and driver protection.

  12. A compromise needs to be made. by Ayanami+Rei · · Score: 5, Interesting

    Most drivers don't need to run in kernel mode (read: any USB device driver)... or at least they don't need to run in response to system calls.
    The hardware manipulating parts kernel should stick to providing higher-level APIs for most bus and system protocols and provide async-io for kernel and user space. If most kernel mode drivers that power your typical /dev/dsp and /dev/input/mouse and such could be rewritten as kernel-threads that dispatch requests to and from other kernel threads servicing physical hardware in the system you can provide fault-isolation and state reconstruction in the face of crashes without incurring much overhead. Plus user processes could also drive these interfaces directly so user space programs could talk to hardware without needing to load in dangerous, untrusted kernel modules (esp. from closed-source hardware vendors).

    Or am I just crazy?

    Yeah but microkernels seems like taking things to an extreme that can be accomplished with other means.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
    1. Re:A compromise needs to be made. by Ayanami+Rei · · Score: 3, Interesting

      This is true.
      It doesn't necessarily make it less crash prone. But it does make it instrumentable if it proves to be unstable (you could easily trace, debug, intercept, or otherwise validate the requests the blob made if so needed).

      Furthermore, the kernel mode portion would merely be relaying commands to trusted memory-mapped regions and IO space requested by the process initially (limited by configuration files, perhaps). Most kernel crashes are the cause of errors (pointer mistakes, buf overflow, race condition, etc.) in the complex driver code which "trap" the system in kernel space. The user space portion would likely instead SIG11 and die... if it left the hardware in a weird state it could be fixed by simply restarting the driver program which would, at its outset, send RESET type commands to the device putting it in a known state.

      The largest problem I see is that it isn't possible to easily recast a userspace driver program into a device node without a mechanism like FUSE. It only works if the hardware target in question is nearly always accessed behind a userspace library (OpenGL, libalsa/libjack/OpenAL, libusb).

      --
      THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  13. Proof is in the pudding by Hacksaw · · Score: 4, Interesting

    I won't claim that Professor T is wrong, but the proof is in the pudding. If he could produce a kernel set up with all the bells and whistles of Linux, which is the same speed and demonstrably more secure, I'd use it.

    But most design is about tradoffs, and it seems like the tradeoff with microkernels is compartmentalism vs. speed. Frankly, most people would rather have speed, unless the security situation is just untenable. So far it's been acceptable to a lot of people using Linux.

    Notably, if security is of higher import than speed, people don't reach for micro-kernels, they reach for things like OpenBSD, itself a monolithic kernel.

    --

    All the technology in the world won't hide your lack of vision, talent, or understanding.

    1. Re:Proof is in the pudding by WindBourne · · Score: 3, Insightful

      OpenBSD's security strength has NOTHING to do with the kernel. It has to do with the fact that mulitple trained eyes are looking over code. The other thing that you will note is that they do not include new code in it. It is almost all older code that has been proven on other systems (read netbsd, apple, linux, etc). IOW, by being back several revs, they are gaining the advantage of everybody else as well as their own.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    2. Re:Proof is in the pudding by Anonymous Coward · · Score: 2, Informative

      A minor nitpick, but you'll learn something for the future:

      "The proof is in the pudding" is actually an INCORRECT usage of the actual saying. If you think about it, it makes no sense -- what proof is in the pudding (and what pudding?!)?

      Instead, the actual, proper phrase is: "The proof of the pudding is in the eating."

    3. Re:Proof is in the pudding by Duncan3 · · Score: 2, Insightful

      Actually, it's been proven over and over that microkernel designs dont HAVE to be slow. Read the Liedtke paper on IPC in L3 from 1993 as one example.

      The problem is the hardware is optimized for something else now. Also, modern programmers that only know Java can't code ASM and understand the hardware worth a damn. I should know, I have to try and teach them.

      And yes, all people care about is speed, becasue you cannot benchmark securrity, and benchmarks are all marketing people understand, and gamers need something to brag about.

      --
      - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
    4. Re:Proof is in the pudding by polemistes · · Score: 4, Funny

      You mean: "If you don't eat your meat, you can't have any pudding. How can you have any pudding if you don't eat your meat?"

    5. Re:Proof is in the pudding by Elastri · · Score: 2, Informative

      I actually saw Tanenbaum giving a talk above Minix a few weeks ago. He brought up the speed issue, saying that in modern (and future) hardware the performance hit from the microkernel will be less and less relevant. Even my current computer is probably more power than I need almost all the time, and I need a lot more computing power than a casual user. Tanenbaum firmly believes that the stability and modularity will be prefered over a slight speed increase. After he showed all of the benefits of the Minix architecture, I was inclined to agree.

      One thing which hasn't really been touched on in this thread yet is exactly what the modularity means for end users. It isn't just that the kernel is simplified. When the drivers and other subsystems are external to the kernel, their failure can become a non-issue. This *does not* just mean that they won't take the whole system down. Minix has a process called the ressurection server. It monitors all of the various drivers and subsystems and, if one of them fails, will attempt to get it running again. Professor Tanenbaum showed us data where the hard disk controller was failing a rediculous number of times per second, but the system was still maintaining about 90% of the speed that it would have if it wasn't failing at all. The OS design can actually make up for poorly designed drivers.

    6. Re:Proof is in the pudding by Lord+Ender · · Score: 2, Insightful

      Wrong. OpenBSDs strength is partially because of their testing and code review policy, but ALSO because of design issues (like kernel memory management).

      Certain types of security flaws are much harder to exploit when the OS addresses memory in unpredictable ways.

      Other design principles, which encourage access log review, aid to the security of the system without having anything to do with code review.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  14. Minix3 by wysiwia · · Score: 2, Interesting

    A paper might show the concept but only a real working sample will provide answers. Just wait until Minix3 (http://www.minix3.org/) is finished and then lets see if it's slower or not and if it's saver or not.

    O. Wyss

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
  15. Not entirely accurate by WindBourne · · Score: 3, Insightful

    Back in the 80's and 90's, the argument for monolithic was performance. Considering that CPUs were so small, it made sense. If Linux had been on a micro kernel design, it would have been slower than MS. IOW, it would never have gotten off the ground.
     
      The 2'nd approach(paravirtualization) could actually be used WRT linux as a means of not only separating the usermode from the device drivers, but it would also allow for some nice networking capabilities. After all, the average systems does not really need all the capabilities that is has. If a simple server(s) can be set up for the house and then multiple desktops without driver is set up, it simplifies life.

    --
    I prefer the "u" in honour as it seems to be missing these days.
  16. Lessons on evolutionary theory for Andy... by csoto · · Score: 2, Insightful

    Dearest Andy, please take some University courses on evolutionary biology. Perhaps you will take away a meaningful sense of the differences between "optimal" and "sufficient." I agree 100% with what you say. "Microkernels are better." That being said, this does nothing to diminish the viability of Linux, or any other monolithic system. Evolution only requires that a species retain sufficient qualities to ensure survivability (and therefore reproduction) in a given environment. "Perfection" never enters the equation (not even qualifiers such as "best" or "better" - just "good enough").

    So, let's all agree with Andy, then go on using the best tools for our purposes. If that happens to be Linux (or even Windoze), then so be it...

    --
    There exists no way of exchanging information without making judgments. --Bene Gesserit Axiom
  17. Hindsight is 20/20 by youknowmewell · · Score: 3, Insightful

    From the link to the Linus vs. Tanenbaum arguement:

    "The limitations of MINIX relate at least partly to my being a professor: An explicit design goal was to make it run on cheap hardware so students could afford it. In particular, for years it ran on a regular 4.77 MHZ PC with no hard disk. You could do everything here including modify and recompile the system. Just for the record, as of about 1 year ago, there were two versions, one for the PC (360K diskettes) and one for the 286/386 (1.2M). The PC version was outselling the 286/386 version by 2 to 1. I don't have figures, but my guess is that the fraction of the 60 million existing PCs that are 386/486 machines as opposed to 8088/286/680x0 etc is small. Among students it is even smaller. Making software free, but only for folks with enough money to buy first class hardware is an interesting concept. Of course 5 years from now that will be different, but 5 years from now everyone will be running free GNU on their 200 MIPS, 64M SPARCstation-5."

    1. Re:Hindsight is 20/20 by Ohreally_factor · · Score: 2, Funny

      I think Prof. T misspelled "running OS X on their G5 Powermac".

      Oops!

      I misspelled "Duo Core Intel Mac"!

      --
      It's not offtopic, dumbass. It's orthogonal.
  18. Screenshot of GNU Hurd by njchick · · Score: 2, Funny

    $ ls /dev
    Computer bought the farm

  19. A false dichotomy by The+Conductor · · Score: 5, Insightful
    I seem to find this microkernel vs. monolithic argument a bit a of a false dichotomy. Micorkernels are just at one end of a modularity vs. $other_goal trade-off. There are a thousand steps in-between. So we see implementations (like the Amiga for example) that are almost microkernels, at which the purists shout objections (the Amiga permits interrupt handlers that bypass the OS-supplied services, for example). We also see utter kludges (Windows for example) improve their modularity as backwards compatibility and monopolizing marketing tactics permit (not much, but you have to say things have improved since Win3.1).

    When viewed as a Platonic Ideal, a microkernel architechture is a useful way to think about an OS, but most real-world applications will have to make compromises for compatibility, performance, quirky hardware, schedule, marketing glitz, and so on. That's just the way it is.

    In other words, I'd rather have a microkernel than a monolithic kernel, but I would rather have a monolithic kernel that does what I need (runs my software, runs on my hardware, runs fast) that a micokernel that sits in a lab. It is more realistic to ask for a kernel that is more microkernel-like, but still does what I need.

  20. Interesting corollation by youknowmewell · · Score: 2, Interesting

    The same arguements for using monolithic kernels vs. microkernels is the same sort of arguement for using C/C++ over languages like Lisp, Java, Python, Ruby, etc. I think maybe we're at a point that microkernels are now practical, same as with those high-level languages. I'm no kernel designer, but it seems reasonable that a monolithic kernel could be refactored into a microkernel.

  21. Re:Oh Dear by igb · · Score: 4, Insightful
    It's tempting for people who work in fields where performance matters to assume it matters for everyone, all the time. Do I need my big-iron Oracle boxes to be quick? Yes, I do, which is why they are Solaris boxes with all mod cons. Do I need the GUI on my desk to be pleasant to use? Yes, which is why it's increasingly a Mac that I turn to first. Sure, a G4 Mac Mini isn't quick. But there's a room full of Niagaras, Galaxies and 16-way Sparc machines to do `quick' for me.

    All I ask is that the GUI is reasonably slick, the screen design doesn't actively give me hives and the mail application is pleasant. Performance? Within reason, I really couldn't care less.

    ian

  22. friendly conversation by audi100quattro · · Score: 3, Insightful

    That friendly conversation is hilarious. "Linus: ...linux still beats the pants of minix in almost all areas"

    "Andy: ...I still maintain the point that designing a monolithic kernel in 1991 is a fundamental error. Be thankful you are not my student. You would not get a high grade for such a design :-)"

    The most interesting part: "Linus: The very /idea/ of an operating system is to use the hardware features, and hide them behind a layer of high-level calls. That is exactly what linux does: it just uses a bigger subset of the 386 features than other kernels seem to do. Of course this makes the kernel proper unportable, but it also makes for a /much/ simpler design. An acceptable trade-off, and one that made linux possible in the first place."

  23. Re:Feh. by Anonymous Coward · · Score: 3, Informative

    Performance was fixed partly through a series of hacks, and partly through raw horsepower.

    O RLY

  24. Re:Feh. by panthro · · Score: 2, Insightful

    The industry has better and more important things to worry about.

    Like what? Reliability and security ought to be paramount. The IT industry (relating to multipurpose computers, anyway) is currently a joke in that area - compare to virtually any other industry.

    --
    If you're not part of the solution, you're part of the precipitate.
  25. OS X - First make it work, then make it fast by alispguru · · Score: 5, Insightful

    How many times have we all heard that the proper way to develop software is:

    First make it work, then make it fast

    Specifically:

    Write it as simply and cleanly as you can,

    THEN check performance,

    THEN optimize, but ONLY where measurement tells you to.

    Judging by the performance improvements over time, this is what the OS X team has been doing. Their stuff has been getting bigger, with more functionality, AND faster on the same hardware, with each release. If anyone else has been doing that, I haven't heard of it.

    --

    To a Lisp hacker, XML is S-expressions in drag.
    1. Re:OS X - First make it work, then make it fast by pavon · · Score: 2, Insightful

      You left out the first step:

      FIRST design the system, and make sure the algorithms and architecture are sufficiently straightforward and efficient.

      No amount of optimizing will save you if your system is slow by design, and there is no place where this was more true than in the early microkernals. That is why the microkernel architecture was rejected by linux and windows kernel developers.

      The Mach kernal has some fundamental effeciency issues, and while it has been improved since it's introduction, there are limits to how fast it can get. As such, Darwin is slower at many things compared to some monolithic kernels, and will continue to be slower unless they do some major revamping (ie redesign and rewrite the kernel) under the hood, not just tweeking.

      In the end it is about trade-offs. The "make it right, then make it fast" approach depends on your idea of right. If you really want an example of "doing it right" with regards to security and stability, look to QNX or OpenBSD. None of the desktop OSes compare to those, because they all made compromises. Windows NT and Linux both decided that the loss of efficency was not worth the gains in stability / security that you get from having a microkernel. And honestly, this particular decision hasn't greatly harmed the stability / security of those systems as a whole.

    2. Re:OS X - First make it work, then make it fast by JulesLt · · Score: 2, Insightful

      We've heard it many times, but I do sometimes wonder what the consequences of Knuth's piece of advise are.

      While it stops developers tweaking every possible piece of code to be an unreadable high-performance mess, I've also seen it used as an excuse to 'not think about performance now' at design time. Even when you are showing them evidence that they are repeating a known performance problem - and some performance problems require major restructuring - i.e. the stuff you can't fix by tuning the code inside a class, but because some dimwit designer is working at such an abstract level, they can't see that calling a web-service located in China, once per object, for thousands of objects, was NEVER going to work.

      'Premature optimisation' is a usefully vague phrase - you can only know it was premature with hindsight. Rant over.

      (But yes, it's nice that Apple improve performance with each release, although with Tiger it looks like that has been at the cost of needing more memory).

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
  26. Titanic by PIPBoy3000 · · Score: 3, Insightful

    I think the real question is what risks computers are facing these days. The Titanic had multiple compartments (up to a point), but the ice berg tore along the side, ripping off rivets and letting water pour in multiple compartments at once.

    How is kernel compartmentalization going to protect against users installing spyware and doing things they're already authorized to do?

  27. This has always bugged me about this argument by joshv · · Score: 3, Insightful

    I never really understood why buggy drivers constantly restarting is a desirable state. Say what you will about the monolithic kernel, but the fact that one bad driver can crash the whole works tends to make people work much harder to create solid drivers that don't crash.

    In Andrew Tanenbaum's world, a driver developer can write a driver, and not even realize the thing is being restarted every 5 minutes because of some bug. This sort of thing could even get into a shipping product, with who knows what security and performance implications.

    1. Re:This has always bugged me about this argument by voodoo_bluesman · · Score: 3, Insightful

      Certainly there would be a logging facility to capture that sort of event. Yeah, it might not blow up the machine, but a bouncing driver *should* make a lot of noise.

  28. QNX ! by alexhs · · Score: 4, Informative

    I have yet to see a "proper" non-academic microkernel which lets one part fail while the rest remain.

    QNX, but it isn't open source.

    VxWorks and a few other would also fit.

    --
    I have discovered a truly marvelous proof of killer sig, which this margin is too narrow to contain.
    1. Re:QNX ! by Kristoph · · Score: 3, Insightful

      The QNX Neutrino kernel is a very good microkernel implementation (albeit not as purist as, say the Ka micro-kernel line, but the fact that it is not open makes it unusable.

      The sheduler, for example, is real time only so for non-real time applications is questionable at best. A simple problem to address in the open source world but, apparently "not a high priority" for the manufacturer of this fine technology.

      -rant-

      I fail to understand the point of closed source kernel implementations. The kernel is now a commodity.

      -/rant-

      ]{

  29. Mklinux by barutanseijin · · Score: 3, Informative

    Mklinux, one of the first versions of linux-for-ppc, had a microkernel architecture. So it's been done, at least for ppc. Mklinux will run on a 10yr old mac. I don't know about newer ppc machines.

  30. QNX for teh win :) by WinPimp2K · · Score: 4, Informative

    Not only does the "Q" stand for "Quick", but when Quantum Software Systems Ltd (now know as QNX) first released their "microkernal", 'message passing", "real time" OS for the 8086 processor in the early 80's they called it "QUNIX". After a brief discussion with AT&T's legal staff, they determined that the vowels were way too expensive and renamed it to "QNX". The microkernal took up less than 64K.

    Unlike certain other OS's, QNX is used in control applications with life and death implications. (nuclear reactors and medical equipment for example)

    QNX has been through a lot of changes since then. And I have not kept up with most of them. I do know that as of a few years ago they did make a "free for personal use" release that included their development system. And a few years before that, they had a 1.44meg demo disk that had their entire OS, GUI and web browser on it.

    But don't take my word for it go check out their website.

    --

    You either believe in rational thought or you don't
  31. Less a comeback than hardware has caught up by Junks+Jerzey · · Score: 3, Interesting
    Lots of big ideas in programming get pooh-poohed for being too resource intensive (a.k.a. big and slow), but eventually we look back and think how silly we were to be worried about such details, and that of course we should go with the cleaner, more reliable option. Some examples:

    zbuffering - go back to any book from the 1970s, and it sounds like a pipe dream (more memory needed for a high-res zbuffer than in entire computer systems of the time)

    Lisp, Prolog, and other high-level languages on home computers - these are fast and safe options, but were comically bloated on typical hardware of 20 years ago.

    Operating systems not written in assembly language - lots of people never expected to see the day.

  32. Re:Metaphors eh? by AKAImBatman · · Score: 3, Interesting

    Methinks a better analogy is: Snap your timing chain on a high performance engine and watch the entire machine tear itself into a piece of junk. Snap a belt or two on a more pedestrian engine and watch it stop until the belt is replaced.

  33. Re:Metaphors eh? by misleb · · Score: 3, Insightful

    The problem I have with the compartmentalized ship metaphor is that I question the value of being able to run a system that has one compartment "breached." The system may technically still run, but is it goign to be of any use in such a state? Aren't you going to want to reboot it anyway or is the theory that you can restart a component without rebooting? Is this realistic? Seems to me that a system would get into a pretty funky state depending on which component failed.

    -matthew

    --
    "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  34. Virtualization by jefu · · Score: 5, Insightful
    I suspect that virtualization may well signal the rise of the microkernel (exokernel?) again.

    It seems reasonable to think that a tiny microkernel built for virtualization and able to support multiple virtual os's with minimal overhead is really going to be a very attractive platform. If we then get minimal, very application specific kernels to run on top of it for specific needs, we could get an environment in which various applications (http servers, databases, network servers of other sorts, browsers) could run in secure environments which could leverage multi-processor architectures, provide for increased user security, make inter-os communications work nicely and generally be a Good Thing. Certainly that would not prohibit running complete unix/MS/??? systems from running as well. (Granting, of course, that OS vendors go along with the idea, which some of the big players may find economically threatening.)

    Could be very fun stuff and make viable setups that are currently difficult or impossible to manage well.

    1. Re:Virtualization by Znork · · Score: 2, Interesting

      "It seems reasonable to think that a tiny microkernel built for virtualization"

      The article (bad me, dont read linked articles, I know) actually mentions hypervisors as sort-of microkernels, so yes. Xen and VmWare ESX fits rather well into such a mapping, as they both have their own 'kernel', and where the controller domain is merely another virtual machine.

      "If we then get minimal, very application specific kernels to run on top of it for specific needs"

      You can accomplish a similar setup by just fudging your definitions a bit again. For example, a bare stripped linux kernel capable of running only on top of the Xen hypervisor isnt all that huge. Combine that with simple single-purpose OS installs doing, for example, fileserving, security services, etc, and communicate over the network for everything, and you more or less have a serverized 'microkernel' architecture. The server is the network is the server is the OS. So to speak. Postmodernistic computing.

      "Granting, of course, that OS vendors go along with the idea,"

      Yes, well, they can go along with it or we can run free software. Yet another indication of the advantages of adaptability.

  35. Re:Practice != Theory by Anonymous Coward · · Score: 2, Insightful

    His research is no more PRACTICAL than it was 20 years ago. Sure, in theory it is great that you can isolate faults and restart servers. In practice, what good does it do when restarting a crashed filesystem server process means that all the real user programs crash because their file descriptors have become invalid?

    To use his metaphor, what good does sealing off the one leaking compartment do if crew can not survive without it? Sure the ship may still float, and you can replace the crew, but they are still just as dead as if the ship had sunk.

  36. Re:Feh. by AKAImBatman · · Score: 3, Interesting

    Look a few posts up at the fellow who mentioned the L4 kernel. While the L4 was really too little, too late (all the OSes we use today were written by that time), it managed to prove that Microkernels *can* be speed demons. What they require, however, is a radically different architecture. If you simply attempt to shoehorn a microkernel into existing Unix systems - precisely what Mach did - you're going to run into trouble.

    On the other hand, if you architect the system so that it is impossible to pass a bad message, you may find that performance can actually be *increased*. My own preference has always been an OS based on a VM like Java where it is literally impossible to write code that can cross memory barriers. The result would be that the hardware protection of an MMU would be unnecessary, as would the firewall between the kernel and usermode. Performance would increase substantially due to a lack of kernel mode (i.e. Ring 0) interrupts or jumps.

  37. Re:Feh. by LWATCDR · · Score: 4, Interesting

    "I see people hitting YEARS of up-time with Linux/BSD/Solaris and hell, even win2k machines. "
    Are they not upgrading the kernel? I know that Win2K has had some critical updates in the last few years that required a reboot.
    Microkernels do have the potential to be easier to secure than monolithic kernels.
    In theory a secure system is a secure system. It is possible to make a monolithic kernel as secure as a microkernel, however it will be harder to make a monolithic kernel as secure as a microkernel.
    Just like everything else it is a trade off.
    Monolithic
    Easier to make a hi-performance kernel.
    Harder to secure and to test security.

    Microkernel.
    Easier to make secure and to test security.
    Harder to make hi-performance.

    There are secure monolithic systems OpenBSD, Linux, Solaris, and Z/OS jump to my mind.
    There are fast microkernels. QNX is a very nice system.

    I really like the idea of a microkernel OS. I will try out the first stable, useful OSS Microkernel OS that I find.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
  38. Cue the peanut gallery. by Inoshiro · · Score: 5, Interesting

    Slashdot may be news for nerds, but it has a serious drawback when it comes to things such as this. The drawback is that what is accepted as "fact" by most people is never questioned.

    "Fact": Micorkernel systems perform poorly due to message passing overhead.

    Fact: Mach performs poorly due to message passing overhead. L3, L4, hybridized kernels (NT executive, XNU), K42, etc, do not.

    "Fact": Micorkernel systems perform poorly in general.

    Fact: OpenBSD (monolithic kernel) performs worse than MacOS X (microkernel) on comparable hardware! Go download lmbench and do some testing of the VFS layer.

    Within the size of L1 cache, your speed is determined by how quickly your cache will fill. Within L2, it's how effecient your algorithm is (do you invalidate too many cache lines?) -- smaller sections of kernel code are a win here, as much as good algorithms are a win here. Outside of L2 (anything over 512k on my Athlon64), throughput of common operations is limited by how fast the RAM is -- not IPC throughput. Most microkernel overhead is a constant value -- if your Linux kernel us O(n) or O(1), then it's possible to tune the microkernel to be O(n+k) or O(1+k) for the equivalent operations. The faster your hardware, the smaller this value of k since it's a constant value. L4Linux was 4-5% slower than "pure" Linux in 1997 (See L4Linux site for the PDF of the paper).

    But none of this is something the average slashdotter will do. No, I see lots of comments such as "micorkernels suck!" already at +4 and +5. Just because Mach set back microkernel research by about 20 years, doesn't mean that all micorkernels suck.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Cue the peanut gallery. by galvanash · · Score: 5, Informative

      Do you actually want people to take you seriously when you post utter shit like this?

      Fact: Mach performs poorly due to message passing overhead. L3, L4, hybridized kernels (NT executive, XNU), K42, etc, do not.

      That is a veiled lie. Mach performed very poorly mostly because of message _validation_, not message passing (although it was pretty slow at that too). I.e. it spent alot of cycles making sure messages were correct. L3/L4 and K42 simple dont do any validation, they leave it up to the user code. In other words once you put back the validation in userland that Mach had in kernelspace, things are a bit more even. And for the love of god NT is NOT a microkernel. It never was a microkernel. And stop using the term "hybrid", all hybrid means is that the marketing dept. wanted people to think it was a microkernel...

      Now I will throw a few "facts" at you. It is possible with alot of clever trickery to simulate message passing using zero-copy shared memory (this is what L3/L4/K42/QNX/etc... any microkernel wanting to do message passing quickly). And if done correctly it CAN perform in the same league as monolithic code for many things where the paradigm is a good fit. But there are ALWAYS situations where it is going to be desirable for seperate parts of an OS to directly touch the same memory in a cooperative manner, and when this is the case a microkernel just gets in your damn way...

      Fact: OpenBSD (monolithic kernel) performs worse than MacOS X (microkernel) on comparable hardware! Go download lmbench and do some testing of the VFS layer.

      Ok... Two things. OpenBSD is pretty much the slowest of all BSD derivitives (which is fine, those guys are more concerned with other aspects of the system and its users are as well), so using it in this comparison shows an obvious bias on your part... Secondly, and please listen very closely because this bullshit needs to stop already, !!OSX IS NOT A MICROKERNEL!! It is a monolithic kernel. Yes it is based on Mach, just like mkLinux was (which also was not a microkernel). Lets get something straight here, being based on Mach doesnt make your kernel a microkernel, it just makes it slow. If you compile away the message passing and implement your drivers in kernel space, then you DO NOT have a microkernel anymore.

      So what you actually said in your post could be re-written like this:

      Fact: OSX is sooooo slow that the only thing it is faster than is OpenBSD. And you cant even blame its slowness on it being a microkernel. How pathetic... Wow, that says it all in my book :)

      And no, you dont have to believe me... Please read this before bothering to reply.

      --
      - sigs are stupid
  39. Some hurdles... by multimediavt · · Score: 2, Insightful

    After reading the paper and contemplating some issues, I do believe a microkernel-like approach is favorable for what Tanenbaum wants to focus on; reliability and security. I say "microkernel-like" because micro is a relative term when you think about the growing complexity of applications and devices a modern operating system has to deal with. I think his TV analogy falls flat on its face UNLESS you are willing to tailor individual operating system distributions to vertical markets. This is not at all practical in the open-source/FOSS space, and even less so in the commercial OS space. Who wants to write different kernels and services for every possible use a mixed set of hardware and software could be put to? His more reliable and secure consumer product examples are just that, embedded and highly specialized versions of an operating system. It can be done in the consumer electronics space because the cost of doing this is passed on to the customer and figured into the retail price. Since the OS and the hardware are removed from each other in all but a few cases, i.e. Apple and Mac OS, Sun and Solaris, and the now defunct SGI and IRIX, it is extraordinarily difficult (and costly) to achieve Tanenbaum's goals.

    So, to return to the microkernel-like statement, I think that modern OSes *ARE* trying to achieve the goals that Tanenbaum aspires to. The points he brings up *ARE* being addressed in Linux, Windows, and Mac OS X. The contention is that they will not happen overnight, and they will only happen faster as more negative feedback is fed into the mechanisms of change, i.e., the project development community or corporate entity doing the work. But, corporate entities in particular have to balance the equation. They can't just sacrifice performance and compatibility for the sole sake of reliability and security. I don't believe that Tanenbaum would disagree with that point. We are seeing more compartmentalization (modularization if you will) within the structure of most OS kernels. I think his wrapper idea for device drivers has merit. Personally, I'd rather see a common driver framework developed for categories of devices to help minimize the number of driver specific wrappers that would need to be created manually (455 seems like a tremendously large number). Virtualization is growing in popularity in the IT community at large. I think there are some huge benefits to this that will alter OS development in the future, the near future for some things. His two more holistic approaches are novel. I think the Multiserver approach may have more of a chance than the Laguage-Based approach, but time will tell which theory takes hold in practice, or if a new or hybrid approach may emerge.

    All-in-all a good read and definitely thought and discussion provoking.

  40. driver banishment by bperkins · · Score: 3, Interesting

    What I'd like to see is a compromise.

    There are quite a few drivers out there to support weird hardware (like webcams and such) that are just not fully stable. It would be nice to be able to choose that a driver be run in kernel mode, at full speed, or in a sort of DMZ with reduced performance. This could also make it easier to reverse engineer non-GPL kernel drivers, as well facilitate driver development.

  41. Re:Lessons on ID for csoto by Red+Flayer · · Score: 2, Insightful

    "So, let's all agree with Andy, then go on using the best tools for our purposes."

    That's looking at it from an end-user standpoint. The problem with that view is that the better method will never become viable.

    To extend your evolution metaphor, you're limiting yourself to a subset of the genepool. Sure, a species that has already been selected for / adapted to that particular niche would outcompete *now* in that niche; but that does not mean that another species allowed to adapt to that niche wouldn' out-compete the one that's already there -- especially should conditions change in that niche (as constantly happens with technology).

    To give a biological example, look at the large animals of the Americas. They evolved to fill niches in the absence of humans. Once humans came over, they were all killed off or died out most likely as a result of human interference -- they hadn't the traits to survive in the new niche (with the exception of the buffalo). Yet big animals in Africa survived alongside human hunters -- they would have been better suited to the 'new' American niche.

    My point is that just because something has the most developed tools for the job *now* doesn't mean that it's lineal successors would be the best tool for the job *later*. Who knows what we're missing if we limit ourselves to the current development lines?

    --
    "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
  42. Tanenbaum is wrong, and should know it by r00t · · Score: 4, Informative

    I'm more than a Linux hacker. I actually worked on a commercial microkernel OS.

    Kernels don't often crash for reasons related to lack of memory protection. It's quite silly to imagine that memory protection is some magic bullet. Kernel programmers rarely make beginner mistakes like buffer overflows.

    Kernels crash from race conditions and deadlocks. Microkernels only make these problems worse. The interaction between "simple" microkernel components gets horribly complex. It's truly mind-bending for microkernel designs that are more interesting than a toy OS like Minux.

    Kernels also crash from drivers causing the hardware to do Very Bad Things. The USB driver can DMA a mouse packet right over the scheduler code or page tables, and there isn't a damn thing that memory protection can do about it. CRASH, big time. A driver can put a device into some weird state where it locks up the PCI bus. Say bye-bye to all devices on the bus. A driver can cause a "screaming interrupt", which is where an interrupt is left demanding attention and never gets turned off. That eats 100% CPU. If the motherboard provides a way to stop this, great, but then any device sharing the same interrupt will be dead.

    I note that Tanenbaum is trying to sell books. Hmmm. He knows his audience well too: those who can't do, teach. In academia, cute theories win over the ugly truths of the real world.

    1. Re:Tanenbaum is wrong, and should know it by OwnedByTwoCats · · Score: 4, Insightful
      Kernels also crash from drivers causing the hardware to do Very Bad Things. The USB driver can DMA a mouse packet right over the scheduler code or page tables, and there isn't a damn thing that memory protection can do about it. CRASH, big time. A driver can put a device into some weird state where it locks up the PCI bus. Say bye-bye
      What if the USB driver
      • couldn't
      DMA a mouse packet over scheduler code (which ought to be read-only at the MMU) or the MMU's page table.

      That is what Tannenbaum's research is asking. Can such a system be built? Does it perform? What are the tradeoffs? Does the end result offer enough benefits (reliability and security) to overcome the costs (performance)?

    2. Re:Tanenbaum is wrong, and should know it by AKAImBatman · · Score: 3, Insightful

      Kernels don't often crash for reasons related to lack of memory protection.

      I do believe that Tanenbaum was addressing security in his article, not kmem protection. His point was that the segregation of the servers prevents a hole in these programs from opening an elevated privledge attack. Furthermore, he points out that the elevated permissions of the kernel are likely to be far more secure due to the miniscule size of the kernel itself.

      You make an interesting point about the stability of the kernel, but that wasn't his point in the slightest.

  43. Re:Oh Dear by NutscrapeSucks · · Score: 2, Interesting

    I've seen OS X kernel panic after plugging in a funky USB mouse, and when a SMB share suddenly disappears. These are both cases which a real microkernel could in theory recover from. So I don't believe there's any particular "reliability" in the OS X design.

    --
    Whenever I hear the word 'Innovation', I reach for my pistol.
  44. Re:Let's let the users sort it out... by Cheapy · · Score: 2

    [i]Let's let the users sort it out...[/i] ...and they chose the Windows kernel.

    --
    Would you kindly mod me +1 insightful?
  45. Hurd in Google's summer-of-code by Spy+der+Mann · · Score: 3, Informative
    I read their "what's new" and they're participating in Google's Summer of Code.


    27 April 2006

            The GNU Hurd project will participate in this year's Google Summer of Code, under the aegis of the GNU project.

            The following is a list of items you might want to work on. If you want to modify or extend these tasks or have your own ideas what to work on, please feel invited to contact us on the bug-hurd mailing list or the #hurd IRC channel.

                    * Make GNU Mach use more up to date device drivers.
                    * Work on GNU Mach's IPC / VM system.
                    * Design and implement a sound system.
                    * Transition the Hurd libraries and servers from cthreads to pthreads.
                    * Find and implement a reasonable way to make the Hurd servers use syslog.
                    * Design and implement libchannel, a library for streams.
                    * Rewrite pfinet, our interface to the IPv4 world.
                    * Implement and make the Hurd properly use extended attributes.
                    * Design / implement / enhance support for the...
                                o Andrew File System (AFS);
                                o NFS client and NFSd;
                                o EXT3 file system;
                                o Logical Volume Manager (LVM).

            Please see the page GNU guidelines for Summer of Code projects about how to make an application and Summer of Code project ideas list for a list of tasks for various GNU projects and information about about how to submit your own ideas for tasks.
  46. Has anyone tried? by Spazmania · · Score: 2, Insightful

    Why are TV sets, DVD recorders, MP3 players, cell phones, and other software-laden electronic devices reliable and secure but computers are not?

    Well, the nice thing about software in rom is that you can't write to it. If you can't inject your own code and unplugging and replugging the device does a full reset back to the factory code then there is a very limited about of damage a hacker can do.

    Then too, sets capable of receiving a sophisticated digital signal (HDTV) have only recently come in to wide-spread use. To what extent has anyone even tried to gain control of a TV set's computer by sending malformed data?

    --
    Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
  47. What, like VM boundaries are the only way? by jthill · · Score: 4, Insightful
    Microkernels are just one way to compartmentalize. Compartmentalization is good, yadda yadda momncherrypie yadda. We've known this for what, 20 years? 30? 40? Nobody suspects it's a fad anymore. The kinds of faults VM isolation guards against aren't the kinds of faults that worry people so much today. Panics and bluescreens aren't solved, but they're down in the background noise. Experience and diligence and increasingly good tools have been enough to put them there and will remain enough to keep them there, because the tools are getting better by leaps and bounds.

    "In the 1980s, performance counted for everything, and reliability and security were not yet on the radar" is remarkable. Not on whose radar? MVS wasn't and z/OS isn't a microkernel either, and the NCSC didn't give out B1 ratings lightly.

    One thing I found interesting is the notion of running a parallel virtual machine solely to sandbox drivers you don't trust.

    --
    As always, all IMO. Insert "I think" everywhere grammatically possible.
  48. Re:Feh. by Chris+Burke · · Score: 4, Informative

    I'm very skeptical of this. It would seem to me, at a fundamental level, that a microkernel architecture is simply a heavily reduced kernel with most accepted kernel functions now delegated to external "programs", and a high level of trust is now placed in each and every one of these programs. I can't see how this is good for security.

    Well, trust is placed in those user-land programs to perform the task for which they are responsible. Whereas in a monolithic kernel, trust is placed in each subsystem to not only perform the task it is responsible for, but also not to muck with the workings of every other subsystem in the kernel as they all reside in the same address space. Therefore in a microkernel you can have a bug in your network stack without compromising your file system driver or authentication module, while this isn't necessarily true in a macrokernel. Compartmentalization is very good for security.

    Which is just one of the reasons Mach is so popular as a research OS, despite never seeing any success in the real world. Compartmentalization also makes the OS easier to maintain, easier to understand, and easier to make modifications for. Plus it's very easy to port to new hardware, if that's required.

    In a sense, most OSes are "microkerneled" anyway. Most functionality is implemented by programs running on top of the kernel, which pass messages back and forth between themselves and the kernel. Perhaps my view on this is a little naive, but I don't see too much of a difference between a microkernel module and any other process on the machine.

    I think you underestimate the things that are handled by the kernel? Unix uses many user-land services, but also has many services integrated into the kernel. Take the concept of moving functionality into user space to the limit, and you have a microkernel. Your last observation isn't naive, it's correct: a microkernel module isn't necessarily any different than any other process on your machine.

    --

    The enemies of Democracy are
  49. Re:Metaphors eh? by mikiN · · Score: 2, Insightful

    Simple. With a compartmentalized ship you can repair or replace the faulty compartment while still at sea. With a single-compartment ship (with damage way below the waterline) you have to take it to the dry dock to do repairs (that is, if you're able to keep it afloat that long anyway...)

    --
    The Hacker's Guide To The Kernel: Don't panic()!
  50. Performance may be better by kbob88 · · Score: 2, Insightful

    Performance may be better in the long run with a microkernel. Sure, there is bound to be a performance penalty in message passing (and checking) with a modularized architecture. But since the developers would (hopefully) spend a lots less time tracking down bugs through a massive kernel, perhaps they could devote a lot more time to perfomance improvement work in the code? I have to imagine that kernels like Linux, OSX, and XP have lots of old, nightmare code that is horribly inefficient; the developers probably just haven't gotten around to improving it because they're too busy tracking down bugs and security breaches, or implementing drivers for the latest gadget.

  51. Re:A Good example? by buckhead_buddy · · Score: 2, Informative
    misleb wrote:
    What true microkernel are/were there? ... OS X? Ok, I guess, but it is slow and no more stable or secure than any other Unix. In fact, I've had OS X machines crash far more than any Linux or FreeBSD systems I've used.
    Mac OS X is not a true microkernel architecture. Apple has a kernel plug-in architecture and allows drivers to run in kernel space which goes against true microkernel design principles.

    How can the average user see this? When "Software Update" runs, almost any update to the system (not updates to an Apple application like iTunes) will require a restart of the whole machine. In a true Microkernel design you might need to relaunch the Finder or restart the communications architecture, but unless something changes kernel space code you wouldn't need to restart the whole computer.

    The uptime command would give Apple proponents much more to brag about if it were a true microkernel, but beyond hardware abstraction I don't think Apple has the same needs for a microkernel architecture as others. Since that's the case, I don't think it's fair to hold it up as an example of the fatal sins of microkernels in general. Nor do I think dragging in your personal valuations of speed and stability are rigorous indictments of Mac OS X's performance either.

  52. Minix by Espectr0 · · Score: 2, Informative

    I have a friend who is getting his doctorate in amsterdam, and he has tanenbaum next door.

    Guess what he told me. A revamped version of minix is coming.

  53. Re:Feh. by aristotle-dude · · Score: 4, Informative
    Yeah really. These tests were already debunked pretty much on the net already. I'm surprised people keep on quoting their "tests" for trolling purposes.

    There were several flaws in their tests:
    1. They used GCC 3.x compiler instead of GCC 4.x compiler shipping with Tiger because the linux distros they were comparing against had not updated to 4.x of GCC yet.
    2. They did not include the OS X specific patches to alter the threading mechanism. This caused a significant performance hit as MySQL was written for the linux threading model rather than a Mach one or more generic model.
    3. Binary builds with OS X specific patches were available for download via links from the official sites. There was no need to compile a crippled version.
    4. They should have also tested the free/evaluation versions of Oracle as there are optimized version available for both linux and OS X. Assuming this was not a test of only OSS but rather performance as a "server", I do not see why they did not include it.

    --
    Jesus was a compassionate social conservative who called individuals to sin no more.
  54. Analogies are like... something. by Pfhorrest · · Score: 3, Insightful

    Yeah, you got to be careful with analogies.

    When it comes to security, imagine aliens trying to take over your ship...


    This has got to be the best juxtaposition of two sentences ever found on Slashdot.

    --
    -Forrest Cameranesi, Geek of all Trades
    "I am Sam. Sam I am. I do not like trolls, flames, or spam."
  55. Re:Feh. by homer_ca · · Score: 3, Interesting
    You just described the fourth idea in TFA:
    The most radical approach comes from an unexpected source--Microsoft Research. In effect, the Microsoft approach discards the concept of an operating system as a single program running in kernel mode plus some collection of user processes running in user mode, and replaces it with a system written in new type-safe languages that do not have all the pointer and other problems associated with C and C++.
  56. Re:Feh. by moro_666 · · Score: 2, Interesting

    i have to agree on the rebooting thing.

    a microkernel can indeed be secure enough so that the system doesn't have to reboot for years, with a monolithic kernel and over a million lines of code, this is just a wet dream.

    infact, the microkernel if written well enough, can take a lot of updates, including updates to disk drivers or graphics drivers and stuff without restarting the whole system, so far the monolithic kernels have run flat on this feature.

    i would give away a few percentages of performance if the system will become more stable and will need less reboots. even bsd and linux boxes need to reboot every once in a while when some kind of new security thing is brought up or a critical fix has been issued, not all drivers can be reloaded even if they are only as modules (probably some hooks go way to deep in the kernel).

    however, until we have a nice usable microkernel system around, i'll stick with linux and freebsd, we can't just run our servers and desktops on hurd or minix out of the blue :)

    --

    I'd tell you the chances of this story being a dupe, but you wouldn't like it.
  57. Re:Metaphors eh? by srussell · · Score: 3, Informative
    Aren't you going to want to reboot it anyway or is the theory that you can restart a component without rebooting?
    Yeah, I think that's the point.

    The goal is to have a system such that you maximize the segregation of the parts. If the SCSI subsystem crashes -- for example -- you flush it and restart it. While it may not be possible to totally isolate every subsystem, with a microkernel subsystems should be more robust than in monolithic kernels.

    For all of Linus' scorn of microkernels, Linux borrows heavily from the concept, if not from the theory. One could almost say that Linux implements a microkernel poorly through the kernel module interface. It fails to be a true microkernel in a number of ways, though, not least of which is the low degree to which it isolates modules.

    In any case, your nervousness about a system where a "fundamental" subsystem craps out is understandable in someone who's main experience is with monolithic kernels, because the corruption of one subsystem often infects other systems. For example, IME when the Linux SCSI module starts barfing (which happens with distressing regularity), if you're lucky, you can unload and reload the SCSI modules, but eventually, you're going to have to reboot, because it never quite works well after a reload. In a microkernel, subsystems are just services that other subsystems may use, but aren't intimate with. A corruption in one subsystem shouldn't lead to corruptions in any other subsystem.

    --- SER

  58. Re:Feh. by diegocgteleline.es · · Score: 2, Informative

    NT is not a microkernel. Microkernels are supposed to mve things like drivers, filesystems, network stacks, etc, to userspace.

    Where does NT implements all that? In kernel space. A NULL pointer in that code brings the system down.

    Just because it was STARTED from a microkernel (like mac os x) doesn't means it's a REAL microkernel. How can you call "microkernel" to something that implements the filesystem in kernelspace?

  59. Re:Isn't Tannenbaum the one who said... by antientropic · · Score: 2, Insightful

    I think it is clear that Linux won that argument.

    This is not at all clear. By what metric do you claim that Linux won that argument? Popularity? Then surely the Windows kernel wins even more.

    Truth is, just because one technology is superior to another (in terms of, say, stability, maintainability, whatever) doesn't mean that it will immediately win in the marketplace. I think that Linux became a success because of other factors, such as that it was easy for people to contribute, and because it conservatively copied a 1970s design which everybody who wanted to contribute already understood.

    The performance argument is of course rapidly declining in importance. I would gladly spend a little bit of performance for increased stability. In the 60s some people claimed that high-level languages would never fly - too slow. Turns out that there are more important things than CPU cycles.

  60. Restarting drivers by Sits · · Score: 4, Informative

    I'm going to weigh in over here mainly becuase my quiet slumber in the minix newsgroup has been disturbed by a call to arms from ast to correct some of the FUD here on Slashdot.

    Drivers have measurably more bugs in them than other parts of the kernel. This has been shown by many studies (see the third reference in the article). This can also been shown empirically - modern versions of Windows are often fine until a buggy driver gets on to them and destablises things. Drivers are so bad that XP even warns you about drivers that haven't been through checks. Saying people should be careful just doesn't cut it and is akin to saying people were more careful in the days of multitasking without protected memory. Maybe they were but some program errors slipped through anyway, bringing down the whole OS when I used AmigaOS (or Windows 95). These days, if my my web browser misbehaves at least it doesn't take my word processor with it, losing the web browser is pain enough.

    In all probability you would know that a driver had to be restarted because there's a good chance its previous state had to be wiped away. However a driver that can be safely restarted is better than a driver that locks up everything that touches it (ever had an unkillable process stuck in the D state? That's probably due to a driver getting stuck). You might be even able to do a safe shutdown and lose less work. From a debugging point of view I prefer not having to reboot the machine to restart the entire kernel when driver goes south - it makes inspection of the problem easier.

    (Just to prove that I do use Minix though I shall say that killing the network driver results in a kernel panic which is a bit of a shame. Apparently the state is too complex to recover from but perhaps this will be corrected in the future).

    At the end of the day it would be better if people didn't make mistakes but since they do it is wise to take steps to mitigate the damage.

    1. Re:Restarting drivers by FireFury03 · · Score: 2, Informative
      Drivers are so bad that XP even warns you about drivers that haven't been through checks.

      However, the driver certification program is to some extent a waste of time anyway:
      • When MS sign the driver they cannot test all execution paths - there are known cases where the driver manufacturers have put the drivers into a safe (read: slow) mode for the certification and then switched to a completely different (fast) execution path in real life - this makes the driver no more stable than an uncertified driver
      • Many driver writers don't want the time and expense of getting MS to certify each release of their driver, so they release uncertified drivers - a large chunk of drivers are uncertified and so will pop up the warning upon installation
      • Windows gives the users so many pop up messages anyway (made worse by the previous point) that the users just ok the message without reading it - an unread warning is worse than no warning at all since the user is no better off and you just annoyed them by making them click yet another box.


      I think a big part of the problem is that it really isn't worth the driver writer's development costs to make the drivers stable. There is often a rapid turnover of hardware so they need to keep revising the driver and so long as it's stable enough that the average user doesn't realise it's that driver that's to blame before the product is end-of-lifed then what benefit is it to the manufacturer to spend the extra cash to make the driver stable?

      However a driver that can be safely restarted is better than a driver that locks up everything that touches it (ever had an unkillable process stuck in the D state? That's probably due to a driver getting stuck).

      The D state _is_ a bug, and in many cases an example of lazy coding. It's the "oops something went wrong but we don't want to complicate our code by catching the error and cleaning up so lets put the machine into an unrecoverable state".

      For example, if you pull a USB mass storage device while it's mounted (a very silly thing to do, but it really shouldn't break the machine) then all the processes that try to access it will probably drop into the D state. There is no good reason for this - the filesystem driver has asked the USB block device driver to read or write some data and the USB block device driver _knows_ full well that the device has gone away so it should return a failure which the filesystem driver and catch and (after cleaning up locks, etc.) can return to userland as a failed operation. Unfortunately, rather than catching this error gracefully, either the block driver or the filesystem driver just gives up and goes to sleep waiting for an i/o operation that will never complete.

      In this case, the D state is no better than a user's application bombing out on an ASSERT() failure - something went wrong, we can't be bothered to even save the user's work to a recovery file, lets bomb out losing the lot - if that's not a bug I don't know what is. (Yes, I'm aware that data integrity can't be guaranteed in many cases but you should at least dump out the (potentially corrupt) data to a recovery file).

      At the end of the day it would be better if people didn't make mistakes but since they do it is wise to take steps to mitigate the damage.

      I think there is some truth in the "less risk increases lazyness" idea, but I do agree that mitigating the damage is more important than scaring coders away from lazyness.
  61. ukernels are hard to code by Jon+Kay · · Score: 2, Insightful

    I played alot with AmigaDOS, a message-passing OS (it was a port of Tripos, an early research message-passing OS), as a teenager. That experience cured me of message-passing interest, because I found myself spending 75% of my time dealing with message-passing coding rather than dealing with the underlying hacks I was trying to perpetrate.

    Not only did one have to write more code to make an MP call (comm overhead code), but the bugs had a way of showing up in that snippet and being harder to debug. The tiniest change in a driver's interface meant an hour of coding, vs the ten minutes I saw later for BSD Unix. At that, I was lucky. If I'd been dealing much with nontrivial synchronization and threading, I expect I would've seen more like the factor of ten coding slowdown I've always seen dealing with threading problems (and to be fair, most ukernel code doesn't have to either, it's just that there are more threads, more sync points, and thus more potential for trouble).

    The basic problem is that modularization is a largely orthogonal problem from threading, address spaces, or messaging. If you split up modules into different threads, then now you don't just have to solve modularization, but you also have to solve threading, messaging, and address space problems, too. Now, address space separation seems like it might save some debugging troubles, and in fact, successful "monolithic" operating systems in fact deliver the simplest form of that. I've been a little surprised that attempts to push farther on that like Electric Fence or multi-address-space OS' with traditional system call architectures have gone nowhere. But they have, so the difficulties must exceed the return somehow.

    Thus, I haven't been surprised to see ukernel project after ukernel project fail. The idea is at least forty years old, and has seen many smart people try to take it on - if a ukernel was going to succeed broadly, it would've happened by now.

    If you like ukernel OS' even after reading this, I say go try one, and try hacking something in. Just watch how much time you spend actually writing code implementing the hack vs MPI / threading drudgery.

  62. Re:The unsinkable Kernel-Just add water. by tenchiken · · Score: 2, Interesting

    You miss the point. The problem was that the Titanic was overtopping the vertical dividers that were designed to keep areas os the ship isolated in case of a accident. If it were a issue with a total failure along the entire ship, then yes, counterflooding would be bad. The idea is to minimize when the tipping occurs to keep the ship slowly sinking, instead of rapidly sinking when the barriers were overtopped.

    Engineering estimates is that it might have added 3-5 hours onto titanics lifespan, enough to save lives, even if not enough to preserve the ship till help arrived.

  63. Re:Feh. by jadavis · · Score: 2, Insightful

    But I'd even more prefer to see the driver written correctly to start with!

    Microkernels actually may help with that as well. If it is very obvious to the OS -- and to the user -- which drivers are crashing, that will provide incentive for the hardware vendors to write drivers correctly. Right now there is no accountability, so as long as the whole system works most of the time, users will buy it. But with microkernels, if new hardware comes out and you have review sites saying "That hardware driver is crashing left and right", users won't buy it. Nobody can point fingers anymore.

    In particular, nobody will point fingers at MS Windows when the real problem is crappy 3rd party drivers.

    --
    Social scientists are inspired by theories; scientists are humbled by facts.
  64. Re:We can dream. by spun · · Score: 2, Funny

    Yes, good, good, you got it! You got the joke! Good job! Haha! Who's laughing now? You sure showed all those folks who called you "slow" or "differently abled," didn't you? No one can spot a joke like you, that's for sure.

    --
    - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
  65. Cue the peanut gallery redux. by Inoshiro · · Score: 2, Interesting

    "Fact: OSX is sooooo slow that the only thing it is faster than is OpenBSD. And you cant even blame its slowness on it being a microkernel. How pathetic... Wow, that says it all in my book :)"

    Actually, OS X was within a few percentage points of Linux on all hardware tested; actually outperforming it on memory throughput on PowerPC and some other tests. It's also faster than NT.

    "But there are ALWAYS situations where it is going to be desirable for seperate parts of an OS to directly touch the same memory in a cooperative manner, and when this is the case a microkernel just gets in your damn way..."

    I fail to see how L4's shared-memory is somehow magically different from Linux's shared-memory. Once you let more than 1 process have access to a page via a TLB mapping, it's all the same.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  66. Other better examples of microkernel by mcoon · · Score: 2, Informative

    For an even better example of what a microkernel can do, have a look at the L4 kernel: http://os.inf.tu-dresden.de/L4/LinuxOnL4/ where the kernel, designed in assembler + C++ has some decent performance stats run by IBM. The short version is that a linux personality on an L4 microkernel costs a 3.8% performance penalty. When you consider that this persnality that is being tested has in no particular way been tuned to fit the L4 kernel, this 3.8 percent penalty for another kernel under linux doesn't seem that bad. Infact, one wonders, if it were tuned, how much faster would it be?