Slashdot Mirror


Torvalds on the Microkernel Debate

diegocgteleline.es writes "Linus Torvalds has chimed in on the recently flamed-up (again) micro vs monolithic kernel, but this time with an interesting and unexpected point of view. From the article: 'The real issue, and it's really fundamental, is the issue of sharing address spaces. Nothing else really matters. Everything else ends up flowing from that fundamental question: do you share the address space with the caller or put in slightly different terms: can the callee look at and change the callers state as if it were its own (and the other way around)?'"

607 comments

  1. Linus Quote by AnalystX · · Score: 5, Informative

    This my favorite Linus quote from that whole thread:

    "In the UNIX world, we're very used to the notion of having
    many small programs that do one thing, and do it well. And
    then connecting those programs with pipes, and solving
    often quite complicated problems with simple and independent
    building blocks. And this is considered good programming.

    That's the microkernel approach. It's undeniably a really
    good approach, and it makes it easy to do some complex
    things using a few basic building blocks. I'm not arguing
    against it at all."

    1. Re:Linus Quote by Arker · · Score: 0, Redundant

      Looks like an interesting thread. Sadly their server is smoking already. I'll check it out in the morning.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    2. Re:Linus Quote by NoNickNameForMe · · Score: 1

      If this isn't selective quoting, I don't know what is. Please quote the rest of his comments. Basically he said that it's good for the simple case, but it falls flat for the more complex situations where pipes (and by analogy, microkernels) won't work well because there is multi-way interaction between the modules.

    3. Re:Linus Quote by AnalystX · · Score: 1

      All quoting is selective quoting. That's why it's called a quote. Not only that, I pointed out that it was my favorite quote. If I quoted something else, it would no longer be my favorite quote.

    4. Re:Linus Quote by Stormwatch · · Score: 1

      Wait, wait, you've read TFA? Around here that's called "cheating"!

    5. Re:Linus Quote by Anonymous Coward · · Score: 1, Interesting
      My favorite Linus quote:
      I also claim that Slashdot people usually are smelly and eat their boogers, and have an IQ slightly lower than my daughters pet hamster (that's "hamster" without a "p", btw, for any slashdot posters out there. Try to follow me, ok?).
      -- Linux
    6. Re:Linus Quote by ThePhilips · · Score: 1

      Devil in details.

      People tend to look into "bunch of small programs" aspect of Unix approach and disregard other important aspect - "connecting those programs with...".

      Human readable form of most of the information is text and represented quite often as text lines. And Unix, providing you the bunch of small applications and also way to interconnect them, facilitate solution of many day to day problems involving text. (Do not forget, even programs themselves are text.)

      Microkernels might look that way - OSs composed of bunch of interconnected programs (or processes). But to understand the problem and conflict between classical Unix approach and mucrokernels you have to look in second aspect - that's interconnections. Unix uses text and lines. Most of the exising microkernel OSs use very very very formal interface between the processes - normally called protocols. You can dissect Unix and put another application in pipeline in under five minutes - thus effectively changing behaviour of OS to the desired one. But in microkernel OS such changes might lead to change of the protocol what would lead to change in all applications in system using the process and protocol.

      To conclude, classical microkernel systems use binary messages. Traditional Unix uses text lines. Believe me - I have first hand use/development experience with both - Unix approach is *magnitude* easier to develop and comprehend. Under Linux/BSD, I do not remember myself spending even a single day finding problem with message passing. During my work with microkernel system debugging message passing and parsing eats up to half of my work time and can span sometimes up to *weeks*. In the end, what's easier to check on screen - text of beatified hex dump??

      --
      All hope abandon ye who enter here.
    7. Re:Linus Quote by ThePhilips · · Score: 1

      s/text of beatified hex dump/text or beatified hex dump/ # monday morning...

      P.S. Most wanted feature of microkernel OS - redirecting flow of message from/to file. In Unix you can split pipeling and use intermidiate files. Same is next to impossible with messages.

      --
      All hope abandon ye who enter here.
    8. Re:Linus Quote by /ASCII · · Score: 1

      It could be argued that the UNIX 'building block' concept was a sham from the beginning. All traditional shells implement lot's of commands like 'echo', 'kill' and 'printf' as builtins improve performance.

      I think this is a bad idae, since it only improves performance in cases where you fork of lots of processes, i.e. loops. But proper shellscripts avoid loops in favour of complex pipelines. So you only really notice the performance difference when you're doing something wrong in the first place.

      The drawbacks of keeping everything in the shell are mostly the same as the drawbacks from keeping everything in the kernel; a huge monolithic lump of code, if anything crashes then you're dead. But unlike in the microkernel case, you actually have a real chance of recovery if a component crashes. (How exactly do you recover if your process spawning demon dies?)

      Zsh takes this monolithic shell idea even further by implementing a regular expression-like language for matching inside the shell.

      --
      Try out fish, the friendly interactive shell.
    9. Re:Linus Quote by Anonymous Coward · · Score: 0

      beatified: Roman Catholic; proclaimed one of the blessed and thus worthy of veneration

      who do you work for where you have beatified hex dumps?

    10. Re:Linus Quote by Junks+Jerzey · · Score: 1

      It could be argued that the UNIX 'building block' concept was a sham from the beginning. All traditional shells implement lot's of commands like 'echo', 'kill' and 'printf' as builtins improve performance.

      And of course take a look at Perl (and Python and Ruby). Perl is the antithesis of the UNIX way, and yet it has become the UNIX way.

    11. Re:Linus Quote by countach · · Score: 1

      >The drawbacks of keeping everything in the shell are mostly the same as the drawbacks from keeping everything
      >in the kernel; a huge monolithic lump of code, if anything crashes then you're dead.

      Some shells allow linking in builtins via shared libraries. Even for a standard shell, the builtins are pretty much self-sufficient and have no need to rummage through other data structures in the shell.

    12. Re:Linus Quote by towsonu2003 · · Score: 1
      Here is my favorite quote:
      Bad Request (Invalid Hostname)
    13. Re:Linus Quote by anandsr · · Score: 1

      Why is perl the anti-thesis of the UNIX way. It is cryptic, it allows you to do one thing in as many ways as possible. It allows you to build your programs by re-using components (CPAN). It is very extendable.

    14. Re:Linus Quote by Junks+Jerzey · · Score: 1

      Why is perl the anti-thesis of the UNIX way. It is cryptic, it allows you to do one thing in as many ways as possible. It allows you to build your programs by re-using components (CPAN). It is very extendable.

      The UNIX way was to write small programs, each doing one thing well. The Perl way was to put all features into one giant program.

  2. Not unexpected... by Cryptnotic · · Score: 4, Informative

    He basically continues his previous argument that monolithic kernels are more efficient and easier to implement. Microkernels may seem simpler, but they have complexity in implementing all but the simple tasks. Microkernels have a more marketable name. "Microkernel" just sounds more advanced than "monolithic". He finishes off with the observation that the term "hybrid kernel" is a trick to grab marketing buzz from the microkernel side of things.

    --
    My other first post is car post.
    1. Re:Not unexpected... by drmerope · · Score: 1

      But he fails to discuss the one area where message passing makes a certain amount of sense. Even a single computer is beginning to look more like a distributed system today: SMP is becoming increasingly common. In these situations communication and coordination is often costly. The trouble with a monolithic kernel comes in precisely what it makes easy: sharing memory and data structures--the very sort of thing that if not done very carefully destroys SMP performance, e.g., by cache-line stumping.

      Taking a hybrid approach where a kernel thread runs on each CPU begins to make a certain amount of sense. Message passing becomes an analog to the interprocessor IPI messaging and shared memory bus-locked instructions.

      In other words: microkernel concepts (not implementation) become a discipline that helps you avoid doing seemingly simple things that are actually quite cycle-time expensive.

      Naturally though it isn't right to call this new idea "microkernel" it isn't subsystem partitioning per se. It is definitely a hybrid idea.

      Yes Hyrbid kernels can be more than marketing hype. On that point Linus is definitely just being an attention-whore by making a sweeping generalization.

    2. Re:Not unexpected... by hey! · · Score: 1

      "Microkernel" just sounds more advanced than "monolithic".

      That's an interesting marketing observation.

      Monolith: "Mono" (one) + "lith" (stone). Most people are vaguely aware that paleolithic ("old stone") and neolithic ("new stone") are archaeological terms. Even "neolithic" refers to a prehistoric, "stone age" period.

      Microkernel: "Micro" (small) + "kernel" (a seed or the edible core of a seed). This puts one in mind of the biblical parable: "The kingdom of heaven is like to a grain of mustard seed, which a man took, and sowed in his field:/Which indeed is the least of all seeds: but when it is grown, it is the greatest among herbs, and becometh a tree, so that the birds of the air come and lodge in the branches thereof." (Mt 13:31-32).

      To avoid having our judgement unconsciously influenced, we'd be better off choosing terms for alternative technologies that are drawn from the same roots. Instead "monolithic" vs. "microkernel", it should be "monolithic" vs. "polylithic" or "macrokernel" vs. "microkernel".

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    3. Re:Not unexpected... by Anonymous Coward · · Score: 0

      Well done, sir. Well done.

      One of the very few /. posts actually in merit for an "Informative" pat on the back. Good job ole boy. Smashing good show of metaphor. Well done, sir. Well done!

  3. pfff by Umbral+Blot · · Score: 4, Funny

    pfff, Linus, what would he know?

    1. Re:pfff by jounihat · · Score: 1

      Yea, you said it. Who is this Linus guy, anyway? I bet he hasn't done a bit _real_ OS kernel programming.

    2. Re:pfff by ChebaX · · Score: 1

      More or less the same as Bill G.

    3. Re:pfff by rolfwind · · Score: 1

      I think that Bill G. may touched code in the long, long ago, interpreting Basic. Real complex stuff, that.

    4. Re:pfff by Anonymous Coward · · Score: 0

      Actually, that's a completely valid question.

      What does Linus Torvalds know about microkernels? Has he ever designed one? Has he ever worked on one?

      Sure, we can assume he knows about monolithic kernel designs and can provide insight into them. This doesn't mean he'll be any use at all when it comes to talking about microkernels.

      It's really not that surprising that someone whose name has been used to describe one of the most popular open source monolithic kernels for something on the order of 15 years would defend that design. But I'm nowhere near convinced that Torvalds actually knows enough about microkernels - especially modern implementations of microkernels - to be able to adequately compare them to monolithic kernels.

      Lord knows I've had Linux panic plenty of times due to buggy kernel modules for weird hardware. Admittably these weren't modules that were accepted into the kernel tree - but in a microkernel design, they wouldn't have brought the system down.

    5. Re:pfff by Arandir · · Score: 1

      Right, this is the same guy that said the FreeBSD developers were incompetent.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    6. Re:pfff by Doctor+Faustus · · Score: 1

      Getting a BASIC interpreter running in 8K of RAM, including the user's code? Sorry, but I'm fairly impressed by that.

  4. Re:Just do it! by Vyvyan+Basterd · · Score: 1

    As fast as C++ would be a fairly lame goal for a kernel.

  5. Let me be the first to say... by Anonymous Coward · · Score: 0

    That's SOOO 1992!

  6. Re:Linus Quote - "not arguing against it at all" by j-stroy · · Score: 5, Informative

    Linus FTFA:

    "The fundamental result of access space separation is that you can't share data structures. That means that you can't share locking, it means that you must copy any shared data, and that in turn means that you have a much harder time handling coherency. All your algorithms basically end up being distributed algorithms.

    And anybody who tells you that distributed algorithms are "simpler" is just so full of sh*t that it's not even funny.

    Microkernels are much harder to write and maintain exactly because of this issue. You can do simple things easily - and in particular, you can do things where the information only passes in one direction quite easily, but anythign else is much much harder, because there is no "shared state" (by design). And in the absense of shared state, you have a hell of a lot of problems trying to make any decision that spans more than one entity in the system.

    And I'm not just saying that. This is a fact. It's a fact that has been shown in practice over and over again, not just in kernels. But it's been shown in operating systems too - and not just once. The whole "microkernels are simpler" argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel, the traditional kernel wins. By a huge amount, too.

    The whole argument that microkernels are somehow "more secure" or "more stable" is also total crap. The fact that each individual piece is simple and secure does not make the aggregate either simple or secure."

  7. Obvious by Scott+Swezey · · Score: 0, Troll

    Forgive me if I am wrong, but doesn't windows have a bloated kernel? (I really know nothing about the internals of computers... but it would seem like this makes sense) Obviously it would seem that windows isn't so great when it comes to stability or security... So, lets learn from what windows did wrong, and break things down to small parts that are easier to work with, more secure, and everything everyone else voting for the micro kernel idea said.

    Anyways, what do the Ubtuntu guys have to say about this? They seem to be doing pretty well...

    --
    Scott Swezey
    1. Re:Obvious by Anonymous Coward · · Score: 0

      a brilliant troll. this will come off nicely.

    2. Re:Obvious by Anonymous Coward · · Score: 0

      Please forgive my spelling, English is my first language.

      Apparently this is not the case. I have reviewed your comment, and it seems that Talkingoutofyourarse-ese is your first language.

      Really, is there any point to making comments like this when you freely acknowledge that you haven't got a clue what the fuck you are talking about?

    3. Re:Obvious by spacecowboy420 · · Score: 1, Offtopic

      Ok, I don't normally do this, but dude - either you're an idiot, or a troll.

      http://en.wikipedia.org/wiki/Linux/

      --
      ymmv
    4. Re:Obvious by Anonymous Coward · · Score: 0

      No, Windows NT, 2000, XP etc all have a hybrid kernel, based off the very successful Windows NT kernel.

      Mac OS X also uses a hybrid kernel based parly off the Mach kernel and partly from the FreeBSD kernel.

      The windows kernel is surprisingly advanced technologically. It's not the bloated patched up QBasic mess that people assume. The problem with windows is not the kernel, but Microsoft's management of the software development cycle and lack of vision.

    5. Re:Obvious by Anonymous Coward · · Score: 0

      do what? reply out of context?

    6. Re:Obvious by Anonymous Coward · · Score: 0

      I must disagree with you. And I might add that M$ LookOUT is another example of how bloated software causes all kinds of security issues. It becomes obvious the OS X kernel is the way to go.

      However we run into the problem of free (as in freedom, not beer) software developers only developing to scratch an itch. Mind you - it is entirely their right to do so! Just as it is their right to download music - after all this is most certainly not piracy!

      I think you will find though that the underlying issue is that C, and if coding at a higher level Perl, is far superior to, say, Java or .Net. When coding it makes far better sense to code in the fastest language possible.

      Overall we should listen to Linux Trovalds as he is the only person ever to have coded a kernel and invented the concept of free software - an amazing feat that was never previously accomplished, and quite possibly may never be accomplished again in our lifetime. This makes him the best and only authority on the matter which means that if anyone disagrees they are obviously not very intelligent.

    7. Re:Obvious by Skreems · · Score: 1

      Ok... but Linux is a monolithic kernel system as well. The security and (now outdated) stability concerns in Windows had to do with things going on in user space, more than inside the kernel itself. Are there ANY widely used microkernel systems today? I can't think of any... and from what Linus was saying in the article, there's a damn good reason for that fact.

      --
      Slashdot needs a "-1, Wrong" moderation option.
      The Urban Hippie
    8. Re:Obvious by ichin4 · · Score: 5, Insightful

      You are forgiven for being wrong, but not for spouting off nonsense despite knowing that you don't know what you're talking about, apparently applying the principal "if my argument involves M$ doing the wrong thing, it must be right".

      While neither NT nor Mac OS X are true microkernels, the architecture of both is strongly inspired by microkernel ideas. Like Linus, the developers of these kernels recognized the practical difficulties involved in making full-on microkernels work, but unlike Linus, instead of throwing in the towel completely and doing full-on monolithic kernels, they created cleanly seperated layers interacting via well-defined interfaces whenever they practically could.

      If you talk to kernel programmers, most will express a high degree of respect for the NT kernel, which is based on the DEC VMS kernel. It mostly the poor design of systems that sit on top of the kernel that has earned Windows its reputation.

    9. Re:Obvious by Anonymous Coward · · Score: 0

      "Overall we should listen to Linux Trovalds as he is the only person ever to have coded a kernel and invented the concept of free software - an amazing feat that was never previously accomplished, and quite possibly may never be accomplished again in our lifetime. This makes him the best and only authority on the matter which means that if anyone disagrees they are obviously not very intelligent."
       
       


      Hey Linus, how you doin..? It's been a while since we heard from you.

    10. Re:Obvious by Anonymous Coward · · Score: 1, Interesting
      The windows kernel is surprisingly advanced technologically. It's not the bloated patched up QBasic mess that people assume. The problem with windows is not the kernel, but Microsoft's management of the software development cycle and lack of vision.

      Sorry, but I have to ask. You speak as though you worked at MS. I worked at HP in 1994. At that time, the group next to me ported NT to the PA-RISC. While I was not part of that group, I got to look over the code and talk to several of the engineers who did it. And I can tell you, that it was total crap. Not a little bit, but honest to god total crap. It became one of the bigger jokes to go an look through the code and see what was there. They had obvious buffer overflows, uninitialized pointers, etc issues in a number of areas. The press, and people like you, were pushing coders from there as being good to great and it was obvious that they had a number a idiots on their kernel.

      While I did not go through the kernel (just examined a few files), the porters did. They pointed out how archiac it was, as well as badly coded.

      The truth was that it was fully ported to the pa. But HP never offered it, because it was so bad, that there was no way that it was going to be stable. So, what exactly do you (and press members) base your assement of windows on? Why do you state that it is advanced tech? What frame of reference do you base it on? Or are you just trolling here?

    11. Re:Obvious by Anonymous Coward · · Score: 0

      Parent is at -1, maybe you should lower your threshold.

    12. Re:Obvious by Anonymous Coward · · Score: 1, Interesting

      If you ever actually _coded_ anything in the NT Kernel you'd be eating your words. NT is a mess. A microkernel that turned into a monolith out of necessity. And it's _hardly_ clean in there [[shudder]].

    13. Re:Obvious by Dis*abstraction · · Score: 1

      Holy shit. The only way this succeeds as a troll is as a parody of piss-poor trolling. If that was your intent, I congratulate you, sir; otherwise, fail.

    14. Re:Obvious by quintesse · · Score: 1

      I don't know where you get the idea from the Windows instability comes from userspace programs but that's absolutely not the case. For example, stability was decreased greatly in NT the moment (around 3.1) they decided, for performance reasons, to put the display drivers back into kernel space (in 3.5 IIRC). Of course, it is also the same reason that you can today play the latest games on your NT-based Windows XP system. You win some you lose some.

    15. Re:Obvious by BitwizeGHC · · Score: 1

      The canonical story I hear w.r.t. NT is the usual "We made the Amiga; Commodore f*ed it up" story. Dave Cutler and his team, who designed VMS, came to Microsoft and produced a tight little 32-bit microkernel for their NT OS/2 project. Then NT became Windows NT, and the Microsoft marketroids came in and demanded features (like kernel-mode video) that helped make NT the wonderful piece of shite it is today.

      How does that story resonate with your experience?

      --
      N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
    16. Re:Obvious by ray-auch · · Score: 1

      Graphics moved into the kernel in NT4.

      Funnily enough... NT 3.51 was rock solid, NT4 was flaky (and although its successors have got better, they still aren't really back to where they were with 3.51).

    17. Re:Obvious by Slashcrap · · Score: 4, Funny

      While neither NT nor Mac OS X are true microkernels, the architecture of both is strongly inspired by microkernel ideas.

      What exactly does "inspired" mean in this case? I am "inspired" by John Holmes but that doesn't mean I have a 12" cock does it?

      If you talk to kernel programmers, most will express a high degree of respect for the NT kernel, which is based on the DEC VMS kernel. It mostly the poor design of systems that sit on top of the kernel that has earned Windows its reputation.

      So, did VMS have a graphics subsystem in the kernel as well? Also can you provide some examples of kernel experts praising the NT kernel for its microkernel properties? Thanks in advance.

    18. Re:Obvious by ratboy666 · · Score: 1

      Is NT based on VMS? Why does that rumour float around? Mind you, the source for NT *is* available (DEC supplied it on microfiche). BLISS-32.

      Now, as to the NT - VMS comparision. VMS has DCL. NT has cmd.exe. No similarity. VMS has HELP NT has /? No similarity. VMS has RMS. NT has ? No similarity. VMS has very fine grained permissions, NT has security on objects. No similarity. VMS doesn't really have threads, but does have good ways of tracking working set size, and tuning I/O. NT?

      No, NT comes from the Unix school, with a lot of OS/2 thrown in. At least externally VMS and NT are very different. VMS is NOT a microkernel OS. VMS *did* support multiple personalities (to support migration for PDP-11 users).

      So, why do these rumours persist?

      Ratboy.

      --
      Just another "Cubible(sic) Joe" 2 17 3061
    19. Re:Obvious by Skreems · · Score: 1

      I was talking more about security concerns, which come from file system permissions and running as root, rather than inherent kernel design issues.

      --
      Slashdot needs a "-1, Wrong" moderation option.
      The Urban Hippie
    20. Re:Obvious by cecom · · Score: 1

      What exactly does "inspired" mean in this case? I am "inspired" by John Holmes but that doesn't mean I have a 12" cock does it?

      LOL, dude ! If that isn't moderated funny, I don't what what should be!!!

    21. Re:Obvious by ichin4 · · Score: 2, Informative

      Also can you provide some examples of kernel experts praising the NT kernel for its microkernel properties?

      W2K does not have a pure microkernel architecture but what Microsoft refers to as a modified microkernel architecture. As with a pure microkernel architecture, W2K is highly modular. Each system function is managed by just one component of the operating system. The rest of the operating system and all applications access that function through the responsible component using a standard interface. Key system data can only be accessed through the appropriate function. In principle, any module can be removed, upgraded, or replaced without rewriting the entire system or its standard application program interfaces.

      William Stallings, "Operating Systems Internals and Design Principals", Fourth Edition, pp. 86-87.

    22. Re:Obvious by ichin4 · · Score: 2, Insightful

      So, did VMS have a graphics subsystem in the kernel as well?

      No. In NT 3.1, the graphics subsystem ran in user-space. In NT 4.0, it was moved into kernel-mode to avoid the performance hit of the context switch. As this history suggests, the actual architectures of the executive and the graphics subsystem are not tightly coupled. They share an address space for performance reasons, not in order to share state. (To be clear, I don't think this is a great thing, and it is a violation of microkernel principals. But the programmers made the smallest possible departure from microkernel principals to achieve their performance requirement.)

      I find it highly amusing that many of the same people who defend the monolithic Linux kernel architecture that tightly couples so many subsystems to the kernel also attack Windows for running the graphics subsystem in kernel mode.

    23. Re:Obvious by einhverfr · · Score: 1

      IIRC NT3.5 had a microkernel architecture and this was moved away from in NT4 due to performance reasons. In other words, in a server environment you have a tradeoff of performance and stability, especially when a larger number of processes is involved.

      With a microkernel, you can probably get better performance and stability for simple tasks (managing a program that flies an airplane, or managing a single program across a few dozen processors) but this may break down when you have a large number of userland processes involved.

      --

      LedgerSMB: Open source Accounting/ERP
    24. Re:Obvious by einhverfr · · Score: 1

      W2K does not have a pure microkernel architecture but what Microsoft refers to as a modified microkernel architecture.

      Maybe, but they didn't make it very good at isolating faults. For example if the Win32 subsystem dies (which is, BTW, a usermode process), you get a BSOD. WTF? Why is a usermode process supposed to be able to cause a BSOD? YOu used to be able to cause this by printing a couple of tabs and then a larger number of backspaces to the terminal, but they eventually fixed this one (which BTW, never affected Win9x).

      In principle, any module can be removed, upgraded, or replaced without rewriting the entire system or its standard application program interfaces.

      A lofty idea prevented only because of Windows' braindead filesystem, swapping, and file locking policies...

      IIRC, NT3.x had a microkernel architecture. But this was discarded in NT4 for performance reasons. Every modern kernel has some aspect of a microkernel design in it. But at some point you have to decide where the tradeoff between performance and stability is. NT of course provided neither...

      --

      LedgerSMB: Open source Accounting/ERP
    25. Re:Obvious by cecom · · Score: 2, Informative

      We see this misconception way too often. Modular design, well defined interfaces, etc. have nothing to do with a microkernel. You can apply those excellent design principles in a monolithic kernel, you can even apply them in regular applications :-) The one distinguishing feature of a microkernel is the separation of address spaces of its components.

    26. Re:Obvious by ichin4 · · Score: 1

      I won't argue over semantics, but obviously at least one author of a standard textbook on OS design does not share your strict definition of what can be called "microkernel-inspired".

      But even if we lay aside the loaded term "microkernel" and compare and contrast Linux and NT on the grounds of modularity, encapsulation, and interfaces, we will find that NT adheres to these principals much better than Linux does. Linux's view of these principals is like Perl's: if you want to respect them, that's fine, but it won't enforce them in any way. And, in practice, they are much less respected in Linux than in NT.

    27. Re:Obvious by Anonymous Coward · · Score: 0
      It mostly the poor design of systems that sit on top of the kernel that has earned Windows its reputation.

      So it's like Linux, then?

      kidding... (well, no...)

    28. Re:Obvious by cecom · · Score: 1

      OK, I'll bite. What is the definition of a micro-kernel according to this book ? I've thought about it some and the only useful definition that I can think of is the one I know - separate address spaces. Everything else is too fluid and can be applied to to many other things.

      Also, I am curious what is the name of the book and who is the author (and what are his credentials) ?

    29. Re:Obvious by ichin4 · · Score: 1

      I cited my source in the parent post: William Stallings, "Operating Systems Internals and Design Principals", Fourth Edition, pp. 86-87. It's a standard CS text.

      Certainly a full-on microkernel, as Tannenbaum envisions it, isolates different system services in seperate processes with seperate address spaces. That is the only way you can get some of the advantages he touts, such as the ability to swap out subsystems without a restart and isolation of buffer overruns.

      Think about what you have to do to engineer such a system. As Linus says, the big difficulty isn't how to do the message-passing; it's how to dis-entangle the state of your subsystem from the state of the rest of your kernel and define small, stable interfaces that allow the systems to coordinate their activities in real time. That is to say, the hard part of making a micro-kernel is getting the encapsulation and interfaces right. Once you have done that work, putting the systems in seperate processes is easy; it's just a matter of deciding to accept the performance hit of the message-passing.

      NT is a "microkernel-inspired" kernel because they have already done the hard part. They have isolated the graphics, networking, file, driver, and other subsystems into silos that interact with the executive via small, well-defined interfaces. They are already at the point where deciding whether to put these subsystems into a seperate process is just a matter of deciding whether to accept the message-passing overhead. From NT 3.1 to NT 4.0, they decided to move the graphics subsystem in to avoid the message-passing overhead. From XP to Vista, they decided to move many serial device drivers out. These are easy changes for them because they have already done the hard work of isolating the state of each of the subsystems.

      Linux has not done this work. (And Linus doesn't appear to believe that it would be worthwhile.) That is why, in Stalling's book, "monolithic" appears dozens of times in the Linux section and "microkernel" appears dozens of times in the NT section, even though everyone agrees that NT is not a "full-on" microkernel.

  8. Code talks by microbee · · Score: 5, Insightful

    The whole discussion of micro-kernel vs monolithic kernel is totally pointless. All popular OS kernels are monolithic. We can get back to the debate when we have a working fast microkernel in the market that is actually competitive.

    Linus is a pragmatist. He didn't write Linux for academic purpose. He wanted it to work.

    But you can always prove him wrong by showing him the code, and I bet he'd be glad to accept he was wrong.

    1. Re:Code talks by MacTenchi · · Score: 1

      You're forgetting Mac OS X is microkernel-based (on Mach BSD). Or maybe you don't consider it popular?

    2. Re:Code talks by microbee · · Score: 2, Informative

      A couple more things to mention.

      1. Windows has some essential system services running in the user space, such as Win32 environment (csrss.exe). But if it dies, you are pretty much hosed anyways. It doesn't necessarily make the system more stable in any meaningful way by running stuff in user space. Windows even had GDI in user space before, and later moved into the kernel for performance reasons, and GDI in user space didn't provide more stability.

      2. Linux kernel 2.6 now has support for user space filesystems. So it's already possible to have a user space filesystem running under a monolithic kernel.

      The fact is, microkernel proponents have not delivered. In reality people who tried those ideas have mostly abandoned them (see 1) because the gain couldn't justify the loss. We don't build our systems just on nice theory.

    3. Re:Code talks by moosesocks · · Score: 4, Informative

      HUH??

      Get your facts straight.

      Every popular Operating System developed in the past 15 years (and then some) apart from Linux has been either a microkernel or a hybrid kernel.

      Mach, upon which Darwin and OS X are based is a microkernel. OSX and Darwin borrow some monolithic-esque features, but not quite enough to make them hybrids it would seem...

      Windows NT, NetWare, ReactOS and BeOS are all Hybrid kernels. This model seems to be the most popular right now, and seems to be a reasonable compromise...

      The only thing that's left are the old big-iron Unices, Solaris, MS-DOS, and Linux. In other words, Linux is the only major player left using a monolithic kernel. I don't know enough about computer science to properly make an argument one way or another, but it would see that monolithic kernels have heavily fallen out of favor in the past 15 years.

      That said, perhaps a monolithic kernel is better suited to the open-source development process, which would seem counterintuitive at first because it discourages modularization, but who knows.... it could very well be true. I don't know enough to comment.

      --
      -- If you try to fail and succeed, which have you done? - Uli's moose
    4. Re:Code talks by Anonymous Coward · · Score: 5, Insightful

      Three letters: Q N X.

      Small, fast, real-time. http://en.wikipedia.org/wiki/QNX

    5. Re:Code talks by microbee · · Score: 5, Interesting

      "Hybrid" kernel? Sorry, I just don't buy this terminology (as Linus put it, it's purely marketing).

      Windows NT is monolithic. So is OS X. Anyone claims it to be microkernel please show me the proof other than "it is based on Mach".

    6. Re:Code talks by SanityInAnarchy · · Score: 3, Insightful

      The whole discussion of micro-kernel vs monolithic kernel is totally pointless. All popular OS kernels are monolithic.

      The whole discussion of Windows vs anything else is totally pointless. All popular OSes are Windows.

      Linus is a pragmatist. He didn't write Linux for academic purpose. He wanted it to work.

      That's true, and that's a good point. However, it's much easier to start a project if you already have some good people, even if the code is entirely from scratch. Therefore, making the point in a place like the kernel development lists is a good idea, because that's a good place to recruit people.

      Certainly in the case of OSes, there really isn't much of an opportunity for something like Linux to emerge from one person's efforts. As far as I can tell, Linux originally worked because enough people were interested in helping him early on in a hobby, doing things like sending him an actual copy of the POSIX specs, and he was mostly able to get it to where it actually duplicated Minix's functionality, and exceeded it in some cases.

      In fact, there was such a shortage of good OSes for this machine that really, Linux succeeded because it wasn't Minix and wasn't DOS. In fact, one has to wonder -- could an open Minix have done what Linux did? It's possible that, given all the programmers who eventually decided to work on Linux, the problems with microkernels could've been solved. Similarly, if all the programmers working on Linux suddenly decided to do a microkernel, it would succeed and it would replace Linux.

      But, that isn't going to happen. Not all at once, and probably not ever, unless it can be done incrementally.

      --
      Don't thank God, thank a doctor!
    7. Re:Code talks by Anonymous Coward · · Score: 0

      If you're going to twist words so hard that Windows is included as a hybrid, then Linux itself becomes hybrid. It has filesystems in userspace (FUSE), device drivers in userspace (anything that talks via USB), device management in userspace (udev) a GUI in userspace (X11, which is more microkernel-ish than Windows). Even with all these, it is a monolithic kernel.

      And it's pretty easy to see how popular NetWare, ReactOS, and BeOS are at the moment. Even the page you linked to states that XNU (the core of Mac OS X) is not a microkernel, but a hybrid. There are no popular microkernel-based systems.

      Some things simply cannot be easily broken down. Kernels are one of these. As Linux is split up into more userspace programs, a limit will be reached when such splitting simply does not become possible. And Linux will still be considered a macrokernel.

    8. Re:Code talks by Anonymous Coward · · Score: 0

      Uh, no offense but I don't think OS X counts since it's whole kernel runs as single mach process...

    9. Re:Code talks by Stephen+Williams · · Score: 5, Interesting

      That said, perhaps a monolithic kernel is better suited to the open-source development process, which would seem counterintuitive at first because it discourages modularization

      Not necessarily. Despite being a monolithic design, Linux is pretty modular. Device drivers, filesystems, network add-ons etc. are separate enough from the core of the kernel that they don't even need to be statically linked into it, but can be loaded as modules into a running kernel, as I'm sure you know.

      It's not a microkernel approach because all the modules are loaded into the kernel's address space. They're bits of extra functionality that are dynamically grafted to the monolithic kernel image, so to speak. Nevertheless, it's still a modular approach to kernel design.

      -Stephen

    10. Re:Code talks by earnest+murderer · · Score: 1

      HUH??

      Get your facts straight.

      Every popular Operating System developed in the past 15 years (and then some) apart from Linux has been either a microkernel or a hybrid kernel.

      Exactly, Linus doesn't know what he's talking about. He should know better than to be posing as some kind of credible source. Someone should write him an e-mail and let him know that he should have defered to someone more knowledgeable.

      it could very well be true. I don't know enough to comment.

      Sure enough.

      --
      Platform advocacy is like choosing a favorite severely developmentally disabled child.
    11. Re:Code talks by JPriest · · Score: 1

      A microkernel places everything in user space, if you have a kernel that does some things in the kernel address space (memory management, disk I/O etc.) and some things in user space (audio, drivers etc.) then it would then be considered "hybrid". I believe OSX and NT are both hybrid.

      --
      Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
    12. Re:Code talks by Net_Wakker · · Score: 1

      Go check http://www.qnx.com/ to see a true microkernelarchitecture. Very nice, very fast RTOS.

    13. Re:Code talks by Bacon+Bits · · Score: 1

      Drivers run in kernel mode. That why they're able to cause bluescreen errors. Only kernel mode errors (or hardware errors) cause blue screen errors. For the curious: Architecture of the Windows NT operating system line. It's a lengthy read, but there are numerous microkernel and monlithic aspects of WinNT.

      --
      The road to tyranny has always been paved with claims of necessity.
    14. Re:Code talks by Cyno · · Score: 1

      Oh oh...

      Linux has a userspace filesystem. Does that make it a Hybrid too?

      hehe

      What you may be experiencing right now is popularly known as Cognitive Dissonance, or the difference between marketing and reality. :)

    15. Re:Code talks by Anonymous Coward · · Score: 0

      Linux has a userspace filesystem. Does that make it a Hybrid too?

      That's just one example. How about the graphcis drivers (X)? The one thing that gets the blame for almost all BSOD's on Windows, because Windows has graphics drivers in kernel space. Then there is libusb (USB in userspace), the tun/tap userspace network interface, and probably even more that I forgot about.

    16. Re:Code talks by Anonymous Coward · · Score: 0

      hahaha. i must remember that one..!

    17. Re:Code talks by strider44 · · Score: 1

      The whole discussion of Windows vs anything else is totally pointless. All popular OSes are Windows.

      I like it how millions upon millions of installations isn't counted as "popular".

    18. Re:Code talks by Bacon+Bits · · Score: 5, Insightful
      "Hybrid" kernel? Sorry, I just don't buy this terminology (as Linus put it, it's purely marketing).
      It is pointless to argue semantics. You can say a hybrid kernel is a monolothic kernel trying to be a microkernel, or you can say it is a microkernel trying to be monolithic. As long as you understand what is meant by the term, your agreement about the precise semantics of it is largely irrelevant. Particularly with it's relevance to this debate.

      One of the biggest problems I continually have with technical people (whether that's computer techs or engineers) is that they tend to overemphasize the syntax and semantics of what people say. They tend to latch on to a specific phrase and then rip it apart rather than taking the meaning of the whole (which is the important part) and finding problems in the whole. Most particularly, they tend to find it incomprehensible that a single phrase might have multiple meanings.

      Part if this is doubtlessly due to exposure to highly precise technical jargon, but it is inappropriate to apply strictness of meaning inherent to, say, Python, to everyday language. Even in a technical debate.

      A hybrid kernel in simplest terms is a kernel is a combination of two discrete other types of kernels. Plain English tells you that. It makes no sense to try to wrestle with whether WinNT is a monolithic or microkernel. It's a semantic debate that serves only to label the object, and it doesn't describe it or aid in understanding it. If you say WinNT is a microkernel, you then have to ignore the non-essential code objviously running in kernel mode and that doesn't help understanding. If you say WinNT is a monolithic kernel, you have to ignore the userland processes that are really system services. Again, that's no aid to understanding.

      Stop complaining about the language and forcing labels on things. Labeling is not understanding.

      --
      The road to tyranny has always been paved with claims of necessity.
    19. Re:Code talks by solferino · · Score: 1
      ... but not quite enough to make them hybrids it would seem...
      ... This model seems to be the most popular right now, and seems to be a reasonable compromise...
      ... I don't know enough about computer science to properly make an argument one way or another, but it would seem...
      ... I don't know enough to comment.
      So why did you?
    20. Re:Code talks by quintesse · · Score: 1

      Let's hear you say that again when the bridge you were driving on gave away because the engineers that built it had difference of opinion on the significance of "high tensile steel". There is a _reason_ why engineers are like that and it most likely the reason why you are still alive today. This is a technical subject so us engineers are into "exact mode" and yes this sometimes bleeds over into the rest of our lives but mainly because we think its funny.

    21. Re:Code talks by JPriest · · Score: 1
      I never stated drivers were in user mode, it is just a made up example of what hybrid kernel would be since the GP posted made the claim they don't really exist.

      It's a lengthy read, but there are numerous microkernel and monlithic aspects of WinNT.

      Right, which would make NT a hybrid kernel.

      --
      Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
    22. Re:Code talks by JPriest · · Score: 1

      Uh, see the Hybrid kernel Wiki. The concept isn't really very difficult to grasp, but you seem to be suffering from arrogance.

      --
      Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
    23. Re:Code talks by ray-auch · · Score: 2, Insightful


      Windows even had GDI in user space before, and later moved into the kernel for performance reasons, and GDI in user space didn't provide more stability


      You have to be joking. It was a massive step backwards in stability. NT 3.51 was rock solid, NT 4 was far more flaky.

      Not only that, but with GDI in kernel all sorts of resource limits came in that just weren't there before. Writing heavy graphics was much more of a pain - no matter how careful you were with GDI, other programs could consume limited kernel resources and your graphics calls would start to randomly fail.

      Image sizes (bitmaps) that you could allocate were also constrained by kernel limits. Not in a way you could handle nicely in the app either - CreateCompatibleBitmap() simply fails once the kernel memory is maxed out, something you can't predict. On NT 3.51 you just added more memory to your system.

      We had people still on 3.51 even in (I think) 2000, because NT4 wouldn't let them edit images as large as they needed - eventually the whole application graphics engine had to be re-architected to work with the gdi kernel limits.

    24. Re:Code talks by Bacon+Bits · · Score: 1
      Right, which would make NT a hybrid kernel.
      I never said it wasn't. I simply said that drivers run in kernel mode. Drivers, then, are a poor example of why WinNT is a hybrid. WinNT isn't a hybrid kernel because of drivers, even though it is a hybrid kernel.
      --
      The road to tyranny has always been paved with claims of necessity.
    25. Re:Code talks by CaptnMArk · · Score: 1

      Certainly. It even has some parts of video and sound drivers in users which is an even more obvious example.

      Alternatively, Linux is just an user space module for Xen "microkernel".

    26. Re:Code talks by Bacon+Bits · · Score: 1
      My point: What's so hard about saying "I don't understand what you mean here" instead of "you fool, you're using this term incorrectly"?

      There's an assumtion that failure to understand is the fault of the messenger. It speaks towards a culture of arrogance and close-mindedness.

      --
      The road to tyranny has always been paved with claims of necessity.
    27. Re:Code talks by JohnFluxx · · Score: 0, Troll

      Haha. Yes you caught us red handed. _Your_ failure to be able to use words correctly is actually our close mindedness and arrogance.

    28. Re:Code talks by jeremyp · · Score: 1

      I can't comment on NT, but in OS X the drivers are definitely in kernel space. I would class it as a monolithic kernel albeit based on Mach.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    29. Re:Code talks by Anonymous Coward · · Score: 0

      The whole point of the microkernel is to have the kernel do nothing but schedule tasks and provide for communication between tasks, while all major system calls are performed by user-mode subsystems. A monolithic kernel performs all major system calls in the kernel.

      The way Windows NT works is that it has a large kernel providing many services, but many major system calls are performed by user-mode subsystems. By default an NT system will be running these user-mode processes: lsass (Local Security Authority Subsystem), smss (Session Manager Subsystem), and csrss (Client-Server Runtime Subsystem). The Win32 "personality" is handled by csrss and Win32k.sys (a loadable kernel driver). If you want to run POSIX programs, they are handled by psxss, OS/2 programs are handled by OS2ss, etc.

      NT is a hybrid because some things (like filesystems) run in the kernel so it's fast, but it can have arbitrary user-mode subsystems that allow new functionality to be added. Just like Mach, communication with other user processes is done by sending "messages" to "ports".

      OS X is questionably a hybrid. Since all system services are run in the BSD module which runs in kernel mode, it's not much of a microkernel. There's no real support for adding other subsystems, at least no more than on a regular BSD system.

      While NT provides many of the benefits of a microkernel (operating system neutrality -- run Win32 and POSIX processes side-by-side, system services can be written as user-mode processes) while still allowing the primary benefit of macrokernels (easier to make kernel modules communicate with eachother, much faster system services). OS X doesn't really provide any of the microkernel benefits, while still slowing down the system by complicating system calls.

      dom

    30. Re:Code talks by mangu · · Score: 1
      if all the programmers working on Linux suddenly decided to do a microkernel, it would succeed and it would replace Linux.


      If every person in the world gave me one dollar, I would be a billionaire. Why would they?


      The great thing about Linux isn't in the details of the kernel, the big wonder is how so many good programmers decided to join in, when there already existed other free operating systems, such as FreeBSD and the Hurd to work on. Where did the motivation come from?


      I believe the main force driving Linux is the practicality and non-fanatism in it. "Let's get together and make this thing work" is a great argument to motivate great programmers. Today you see too many arguments based more on zealotry than on practical results.


      I see too many people defending Java, Ruby, OSX, Hurd, etc, based on personal experience and opinion. Well, personal experience and opinion I have my own, thanks. It's no use telling me "Hey, *** is Great! Professor X has demonstrated it!" You have to tell me "Hey, look at all these great systems and applications that run on ***. See how well they run!". You can tell me all about how Java is superior to C when an application developed in Java loads a document quicker than Gnumeric or Abiword.

    31. Re:Code talks by Anonymous Coward · · Score: 1, Insightful

      `I don't know what you mean by "glory,"' Alice said.
      Humpty Dumpty smiled contemptuously. `Of course you don't -- till I tell you. I meant "there's a nice knock-down argument for you!"'
      `But "glory" doesn't mean "a nice knock-down argument,"' Alice objected.
      `When I use a word,' Humpty Dumpty said in rather a scornful tone, `it means just what I choose it to mean -- neither more nor less.'
      `The question is,' said Alice, `whether you CAN make words mean so many different things.'
      `The question is,' said Humpty Dumpty, `which is to be master -- that's all.'

    32. Re:Code talks by harlows_monkeys · · Score: 1
      The whole discussion of micro-kernel vs monolithic kernel is totally pointless. All popular OS kernels are monolithic. We can get back to the debate when we have a working fast microkernel in the market that is actually competitive

      What about QNX? Or pretty much every other real-time system?

      Or how about pretty much every system where provable security or reliability is needed?

    33. Re:Code talks by Welshalian · · Score: 1

      All popular OS kernels are monolithic.

      I beg to differ. All popular PC OS kernels might be, but I bet that the microcontroller running the ABS in your car runs on QNX, and the phone of someone around you runs Symbian.

    34. Re:Code talks by Bacon+Bits · · Score: 1
      Communication is a two-party affair. The listener is just as responsible for communicating an understandable message as the sender. In fact, it's almost exactly like TCP vs UDP. If you message is of any importance, you use TCP so that the recipient responds saying that it is recieved and understood (at least at the Transport layer).

      You can choose to be like MS, I suppose, and require that everyone speak your language without telling us what that is, but that's rather rude.

      --
      The road to tyranny has always been paved with claims of necessity.
    35. Re:Code talks by kamasutra · · Score: 1

      NT 3.51 was anything but rock solid. In fact it ate my work so many times I finally gave up and moved to Linux.

      I've never moved back.

      I do agree NT4 was more flaky.

    36. Re:Code talks by avxo · · Score: 1
      Linus is a pragmatist. He didn't write Linux for academic purpose. He wanted it to work.
      I guess the 'fools' who wrote QNX were not pragmatists. They were cloistered ivory tower intellectuals, who intended QNX as an academic project. That's why they didn't start a company, and their O/S isn't widely used in a wide variety of sectors -- especially telematics.
    37. Re:Code talks by lubricated · · Score: 1

      Wasn't Hurd around before linux, and failed to get the needed attention. I think even Linus thought of Linux as stop-gap because eventually everyone would run hurd.

      --
      It has been statistically shown that helmets increase the risk of head injury.
    38. Re:Code talks by Anonymous Coward · · Score: 0

      > Three letters: Q N X.

      Yeah, right. And where's the actual code?

    39. Re:Code talks by manifoldronin · · Score: 1
      While I tend to agree with your point in this "kernel categorization" mini-debate, I have big (big big) problem with your following comment -
      One of the biggest problems I continually have with technical people (whether that's computer techs or engineers) is that they tend to overemphasize the syntax and semantics of what people say. They tend to latch on to a specific phrase and then rip it apart rather than taking the meaning of the whole (which is the important part) and finding problems in the whole. Most particularly, they tend to find it incomprehensible that a single phrase might have multiple meanings.
      It's rather presumptuous (and in your own word, "arrogant") to assume that we (the tech people) "latch on to a specific phrase" simply because we don't understand that a single phrase might have multiple meanings. Most technical people, including myself, I have worked with understand perfectly that a phrase can have multiple meanings.

      HOWEVER, most of the time technical talks are NOT just casual chatting, guess what, most of them end up being documented and becoming requirements/designs/testing plans - in short, things that can be used against people later. Now, you can use a phrase in some talk, meaning A, and maybe all the people in the talk understand you perfectly (or they think they do) that you meant A but by the time it gets put on paper, it will no longer carry this "I meant A" badge, because people like you don't like to "apply strictness of meaning to everyday language". Well, guess what, days/weeks/years later, some clueless guy is gonna have to pick up that piece of technical document of yours, nonetheless written with the latitude of "everyday language", and try to figure out what the hell you meant by saying XXX. And he's not going to be able to, because, exactly, "a phrase can have multiple meanings."

      That's also why I find it ironic that you are actually criticizing tehcnical people on this aspect - if you understand "a phrase can have multiple meanings," how can you assume that all your audience, not only those at present, but also those in the future, must automatically take that phrase you said as you meant it, without any clarification?

      Part if this is doubtlessly due to exposure to highly precise technical jargon, but it is inappropriate to apply strictness of meaning inherent to, say, Python, to everyday language. Even in a technical debate.
      We don't try to apply this "strictness of meaning" to every phrase people said. We only do this to certain key phrases.
      Stop complaining about the language and forcing labels on things. Labeling is not understanding.
      No, it's not, but proper labeling helps communicating, which in turn helps understanding. So, please, stop complaining about people questioning you what the hell you meant by saying X, realize and actually understand "a phrase can have multiple meanings," communicate to those people what exactly you meant, and then start worrying about "the meaning of the whole."
      --
      Tyranny isn't the worst enemy of a democracy. Cynicism is.
    40. Re:Code talks by Anonymous Coward · · Score: 2, Funny

      You say it's pointless to argue semantics, yet you go on to argue semantics. Good show!

    41. Re:Code talks by 0xABADC0DA · · Score: 1

      The add-ons can be loaded as modules because they are compiled against the specific kernel you are running, not because the separation is so good. Try taking a driver from 2.4 linux and getting it to run on each kernel since then. You'll re-write significant parts of it at least a half-dozen times.

      If you have been using vmware on the bleeding edge kernel you'll know this from experience (and vmware is *really* good at maintaining their linux drivers). For a while I had to run a ridiculously old 2.6 kernel because the Intel video driver would not work on later kernels. End-users don't understand this because there is a lot of effort and patching going on so the latest Ubuntu or whatever distro "just works".

    42. Re:Code talks by dascandy · · Score: 0

      If it was designed as such before it was implemented I might have agreed with you. This was more a hack to make a generic kernel that can fit any computer.

    43. Re:Code talks by Cyno · · Score: 1

      That's cuz I read this before I posted..

      making fun of hybrid micro kernels..

      because they're not hybrids, they're monolithic..

      duh?..

    44. Re:Code talks by Anonymous Coward · · Score: 0

      Big, dog slow, stupidly designed API, very slow development cycle.
      What was your point again?

    45. Re:Code talks by Cyno · · Score: 1

      Actually, hybrid kernels are a myth. The exokernel is what I was referring to.

    46. Re:Code talks by magetoo · · Score: 1
      One of the biggest problems I continually have with technical people
      It's rather presumptuous (and in your own word, "arrogant") to assume that we (the tech people) "latch on to a specific phrase" simply because we don't understand that a single phrase might have multiple meanings. Most technical people, including myself, I have worked with understand perfectly that a phrase can have multiple meanings.
      He was simply using the phrase "technical people" in place of "you idiots on Slashdot". No one is going to admit to being an idiot, but call them technical, and they just might swallow the criticism along with the compliment.

      Of course, you are obviously one of the shining counterexamples.

      (It's serious, laugh.)

    47. Re:Code talks by Anonymous Coward · · Score: 0

      NT 3.51 was rock solid, NT 4 was far more flaky.

      I don't know what world you were living in, but in mine NT 3.51 was anything but solid. In fact, all of our NT 3.51 servers needed to be rebooted at least weekly, and even so blue screens were common. NT4 initially was no improvement, but it did eventually get better after three or four service packs.

    48. Re:Code talks by Arandir · · Score: 1

      QNX is great, but it is a highly specialized realtime OS. It's also the only true microkernel that has any sort of popularity. NT isn't a true microkernel, OSX used Mach but not as a microkernel, Hurd is still another two decades away from completion, etc.

      The grandparent makes an excellent point. There are no true microkernels out there for popular use.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    49. Re:Code talks by Arandir · · Score: 1

      I don't know enough about computer science to properly make an argument one way or another

      That's true, because you go on to say...

      perhaps a monolithic kernel is better suited to the open-source development process, which would seem counterintuitive at first because it discourages modularization, but who knows...

      Running something in a different address space is NOT modularization. Linux drivers (and those of every other monolithic kernel) are extremely modular. You can load and unload them at runtime, mix and match them, etc. Linux is also modular enough to swap out major components at build time, such as the VM. File systems are also modular components.

      Running stuff in a different address space forces you to be modular, but that doesn't the converse is true, that everything in the same address space must be a tangled mess of undifferentiated code.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    50. Re:Code talks by Anonymous Coward · · Score: 0

      The idea is not that preciseness does not matter, but rather at times creativity and granular detail do not lend themselves together. It is the difference between strategy and tactics. When discussion big picture ideas, getting caught up in the implementation details can effectively kill it before it even gets started. However, by staying at 30,000 feet, and discussing the possible merits, an idea can blossom, transform, and lead to other ideas - ideas that allow your butt to stay employed. Let the grownups talk for a while and you can go back to your Dilbert cartoons, ok?

    51. Re:Code talks by TWooster · · Score: 1

      Although you do have a point, I think you're mostly wrong. Any argument comes down to shared understanding between the participants. It has been my experience that arguments always stem from differing points of views on the terms that are in use. And just as easy as it is to disagree on misaligned terms, it is simply as easy to falsely agree based on this.

      I'm just writing this for my own catharsis, so I won't cite much, but I do seem to recall a scientist who was studying how people interpret different cliched phrases, such as "tow (toe?) the line", or "on the up and up". He discovered that his wife of many years, despite the latter phrase being used in their conversations, had a completely different understanding of what "on the up and up" means. He interpreted it to mean "on the level", as in, legitimate as opposed to shady. She interpreted it to mean "of increasing quality", nothing to do with the moral and legal implications the term held for him.

      This influences our feelings of a situation and thus where a conversation can go from our point of view. Try it next time you're in an argument; ask people to define their terms, and I gaurantee you that the deeper you push, the more divergent their interpretation of a word and yours will become.

      Semantics are of the utmost importance for having a concise conversation. That doesn't mean we can forego looking at the whole -- this is a fallacy, of course -- but the overall "feeling" and interpretation of a situation is greatly influenced by the individual words and the contexts in which they are used, not to mention one's mood or the phase of the moon. In any discussion that really seeks to divulge the nature of a problem and its solution, you can never be too precise.

    52. Re:Code talks by juan2074 · · Score: 1
      Hurd is still another two decades away from completion

      Which will come first: Hurd or practical nuclear fusion?

    53. Re:Code talks by DShard · · Score: 1

      Maybe you should try being less sensitive and more informed. If you think a doctor can explain to you how your body works, or fails to work, with no loss of nuance from that he would have when talking to another doctor, you are delusional.

      A conversation is way up the protocol stack. In fact, If you were to look at the OSI model diagram on a blackboard, conversation would be located on the moon. TCP is more like vocalization/hearing. Just because you can make noise and be heard does not mean that your are doing anything meaningful. TCP/IP is more like that. It doesn't even try to understand content. It just acknowledges having received the content.

      Now, this is a very abstract and high level subject. If you have people making deprecating statements questioning your terms and comprehension of the subject, it is because those people care about the quality of it's discussion. Remember, a doctor won't help you understand the holistic quality of the information he is providing. Neither will we.

    54. Re:Code talks by Anonymous Coward · · Score: 0

      Ummmm, no. I shall enlighten you because "people care about the quality of it's discussion".

      1. If you think a doctor can explain to you how your body works, or fails to work, with no loss of nuance from that he would have when talking to another doctor, you are delusional.

      The topic that was being debated was one of ideas vs details. Your example gives credibility to what I explained. These are two completely different contexts.

      a. Big picture idea to the non-doctor (aka, discussion ideas)
      b. Detailed conversation (aka, tactics)

      Understand? Typically, in most circumstances, people are able to communicate without needing preciseness, because the vast majority of conversations held in the world are not between engineers discussing the nuances of a technical subject (of which both will have varying degrees of understanding and will argue for hours on end). There are times and places for different levels of communication. Even you abstracted the idea of TCP/IP communication. There was a level of assumption on your part of my understanding of TCP/IP. You did not discuss any RFC's, you did not discuss different implementations, etc. You spoke at a level that you believed that we have a commonality. This is the same in any discussion.

      My opinion is that the burden (perhaps it is a burden, get over it) falls on those with a deeper understanding and more "intelligence" to lay the groundwork and fill in the gaps. Snarky comments about technical nuances that will not aid the conversation should be left for the BOFH.

      For example, I am pretty confident in discussion the technial merits of an idea with like-minded individuals, but then I can quickly switch gears and semantics explain pretty clearly my ideas to someone who does not understand or does not care about the details. It is a good thing that certain people are like that, for they have strengths in different areas. Putting people with different strengths is a good foundation for a profitable company. A profitable company sends me a reliable paycheck. A reliable paycheck allows me to eat. I have a feeling that you also benefit from a similar chain reaction. I think if I may have to explain something a couple of times, but I get to keep my job, that is a good thing.

    55. Re:Code talks by Anonymous Coward · · Score: 0

      One of the biggest problems I continually have with technical people (whether that's computer techs or engineers) is that they tend to overemphasize the syntax and semantics of what people say.

      My wife says much the same thing.

      When she says "I turned off the stove" I'm not supposed to get hung up on the stove still being on and the smoke alarm wailing like a banshee.

      I keep hearing things like "You know what I meant." and "You think words have specific meanings." and "You hate me and think I'm fat."

    56. Re:Code talks by SanityInAnarchy · · Score: 1

      That he did. I suspect that it has more to do with the fact that Linux became usable so quickly that drew more developers to it.

      That is, Hurd was around, we can even speculate it having as many developers as Linux did for awhile. The problem was more that it couldn't be made usable quickly enough to draw people away from other projects, including commercial ones.

      If Linux hadn't happened, it might have been BSD, but probably not HURD.

      So, looking back, something like Linux was necessary to bootstrap a large enough open source community to make a microkernel work. Of course, they're not working on a microkernel.

      So, the only way I can see a usable microkernel system on my desktop or my servers (not just my development toys) is if Linux manages to turn into one incrementally. Maybe they could even do something similar to what Apple did with OS X and Classic, in order to support some old drivers (Nvidia, anyone?) without having to completely rewrite them... but that level of backward-compatibility is just wishful thinking.

      This is simply because I really doubt that HURD will ever become usable -- and even if it did, I doubt that it would ever be as popular as Linux.

      --
      Don't thank God, thank a doctor!
    57. Re:Code talks by Foolhardy · · Score: 1
      When Microsoft moved GDI and much of the windowing system out of winsrv.dll in user mode and into win32k.sys in kernel mode, performance was a big reason, but simplification of the design is arguably an even bigger reason. NT has a lightweight (though undocumented) local procedure call facility for processes like csrss to communicate with their clients that uses double buffering for small messages (240 bytes or less) and shared memory for larger ones. NT 3.51 even implemented Quick LPC with scheduling control similar to Solaris doors (see EventPairs). Even so, communicating the state of one process to another requires quite a bit of marshalling. Every piece of data you need to send has to be known about ahead of time, and has to be either small, pre-packaged in or copied into a shared memory section.

      When NT 4.0 moved most of that into kernel mode, all of that marshalling became unnecessary because the code in win32k could now reach directly into the caller's memory, same addresses and everything. In its place only some basic security against invalid addresses and memory change races were neessary. In 3.51, winsrv.dll was the largest file in the OS at almost 1.4MB. Even with NT4's new featuers the size of win32k.sys was only 1.2MB with winsrv.dll now only 150KB. Microkernels tend to have more performance overhead, but they also tend to have more development and code overhead that CAN be much more expensive in the long term.

      From Windows Server 2003: The Road To Gold Part One: The Early Years: (emphasis added)
      Fittingly, the next NT release, Windows NT 4.0, became known as the Shell Update Release (SUR), another challenging task that would once again prove the benefits of NT's module architecture. "We wanted to build a desktop that had the 95 shell but used NT technology," Lucovsky told us. "We eventually moved the Win32 GUI components and hosted them as an in-process driver. Performance was one side effect. We had had problems taking that API and running it in a different process. So moving the code to the same context as the runtime solved a lot of issues. We didn't have to do dead lock detection for GDI and USER. It was significant work, but it solved a lot of headaches." NT 4.0, a watershed release for the product, shipped in July 1996.
    58. Re:Code talks by Bacon+Bits · · Score: 1

      It's rather telling that what you've just said is exactly what I've been trying to say.

      --
      The road to tyranny has always been paved with claims of necessity.
    59. Re:Code talks by Bacon+Bits · · Score: 1
      See, you're doing it right now.

      You're trying to use my metaphor as you wish to use it rather than trying to understand why I used it in the way I did. It's a metaphor. It's not a perfect metaphor. It's just intended to give you an idea of what I'm saying, not how the OSI model or the TCP/IP stack works.

      Context and overall meaning are more important than petty semantics. That's all I'm saying. A semantic argument is a disagreement on terms, and it doesn't really serve to further the discussion.

      It's rather like arguing the screw thrading on the Saturn V when the discussion is about the affects of the Apollo missions. It's relevant to the discussion, but only tangentally. And it's trivial to the core of the actual discussion.

      --
      The road to tyranny has always been paved with claims of necessity.
    60. Re:Code talks by Bacon+Bits · · Score: 1
      Ideas vs details, yes, that's it exactly. Many technical people either have trouble distinguishing one type of discussion from the other, or they tend to always argue against the details when they're irrelevant to the discussion. I consistently get exposed to people who just don't switch gears.

      It's like discussing programming a BitTorrent protocol library and having someone say "but what is BitTirrent going to do to society?". You'd give such a person a pretty strange look, yes? Now imagine it's the other way. You're discussing the impact of the WWW on society, and someone comes up to you saying you should use HTTP 1.1. It's not quite that blatant, of course. (And if that disclaimer actually dissuaded you from posting a reply, you're guilty of being caught up in the semantics and ignoring the meaning.)

      --
      The road to tyranny has always been paved with claims of necessity.
    61. Re:Code talks by Bacon+Bits · · Score: 1
      You know, I was with you until the insult.

      I'm not saying I can't switch gears. I do all the time. I'm a sysadmin, and I do all the technical documentation for software installation and maintenance for about 300 applications (and I do it very well, thank you). If the topic of discussion is confiiguring a Cisco router or using Active Directory or any of a thousand other technical topics, then I can discuss them with you at length.

      If, on the other hand, the discussion is about how, say, Active Directory changed network management and someone jumps in saying that AD isn't really LDAP, well, that might be true (it certainly is an arguable position) but it really doesn't matter if AD is LDAP or not if we want to discuss how it changed being sysadmin.

      My complaint is that I keep finding people who themselves can't switch gears to have the discussion on the level that I want. Or, more often, the one I'm already having.

      Here, the topic is whether the microkernel is a good design. Arguing about whether or not WinNT is a microkernel or a monolithic kernel is irrelevant. Does calling it a microkernel change the way it behaves? What about labelling it a monolithic design? Did you change the executable at all? And does labelling it change the fact that it has characteristics of both? And the fact that the phrase "hybrid kernel" has been used in ways you personally disagee with means that the phrase is dead to you? It's a massive foray off topic.

      --
      The road to tyranny has always been paved with claims of necessity.
    62. Re:Code talks by Bacon+Bits · · Score: 1
      Yes, but we're not discussing something that requires an opinion on whether X is a microkernel is or a monolithic kernel. We're discussing whether the idea of a microkernel continues to be feasible.

      Do you waste time arguing about MIT Kerberos vs MS Kerberos when discussing the need for a password policy? You might, but it doesn't really help the fact that your users have had the same password for 6 years and it's the one you assigned them when they were hired on: "changeMe".

      --
      The road to tyranny has always been paved with claims of necessity.
    63. Re:Code talks by Anonymous Coward · · Score: 0

      Your right. I should not have inserted the insult. I apologize. That added nothing of value and only weakened what I had to say.

    64. Re:Code talks by mvdw · · Score: 1

      I think you meant "...so we engineers...".

    65. Re:Code talks by ClamIAm · · Score: 1
      Linus is a pragmatist. He didn't write Linux for academic purpose. He wanted it to work.

      I guess it depends on what you mean by "academic". If you mean that he didn't write it for a class, then you're correct. However, he began writing Linux as a fun project, as a way to extend a terminal emulator he had built to read usenet news. He didn't intend it to get to the level it did/has. Based on these definitions (ex: "not expected to produce an immediate or practical result"), it's a pretty fair argument to say the beginnings of Linux were "academic".

    66. Re:Code talks by Anonymous Coward · · Score: 0

      At that time, FreeBSD didn't exist. The BSD source tree only existed in one form, and it was heavily encumbered by AT&T code. Lawsuits were flying around and no one wanted to touch it until that cleared up. That is what really allowed Linux to gain it's mind-share.

    67. Re:Code talks by linuxrocks123 · · Score: 1

      I'm going to try to take this one: you're wrong.

      Semantics is meaning. There is no meaning to your statement outside its value in its language, which is defined by the language's semantics. You used the term "hybrid kernel". Someone else challenged you that said term is meaningless, making your statement meaningless. You resort to hand-waving about "not complaining about the language" because you're wrong and have no better response.

      Stop being so arrogant. Admit when you're wrong and make sure to say what you mean in the future.

      --
      vi ~/.emacs # I'm probably going to Hell for this.
    68. Re:Code talks by ray-auch · · Score: 1

      I don't know what world you were living in [...] servers

      I was living in workstation world, not server. Moving the grapics layer wasn't much of an issue on server, since most servers aren't doing heavy graphics. That said, for the same reason it couldn't have been a beneficial step either.

      On the client, it was a big step backwards for stablility in the name of performance.

    69. Re:Code talks by Anonymous Coward · · Score: 0

      Have you ever actually used QNX? I have a set of tiny x86 tripple boot QNX/Linux/Windows boxes. And guess what? They perform much faster under Windows or Linux (in fact nearly the same). The same system performs way slower under QNX and e.g. under full network load the QNX boxes basically come to a halt while the windows/linux boxes serve the network requests nearly as fast as possible.

      QNX _has_ lots of process prority problems etc and if an application floods the QNX io-net manager with ip packets nearly nothing will be sent anymore. Do the same with windows or linux and they will still send packets at nearly network speed.

      And QNX knows about their problems: Read their network development docs. They ask you to disable interrupts on your driver. Why? Because they know that forwarding irqs to a bunch of applications being used as "device drivers" doesn't work. And what's the reason for QNX putting everything into monolythic applications lately? It's the same: Performance problems. In latest QNX versions most drivers are included as shared libraries into one main application. They are doing this with USB, with audio, with the network ...

    70. Re:Code talks by Debiant · · Score: 1

      Well, I sort of agree and the I don't.

      I think main problem with languages and their definitions is that they
      don't define always reasonably well what does exists.

      Many times the concept and definitions that are in words are
      simply unaccurate. They fall short or don't exist for something we need.

      How do you for example say precisely that something is not microkernel nor monolith
      but has lot of common with both? You don't, unless you figure out an accurate definition
      for it - which has to be shared by other people too .

      Technial people sometimes miss this diffrence and difficulty.

      In real life, there are lot of things that don't have real names or definitions
      for Joe Average. But also for not so Average Joes too.

      The gift of abstractions is that, unlike computers, we can deduct from incomplete
      information complete solutions and answers. Why not use it then?

      Why act like a computer?

      --
      Nobody knows the trouble I've seen, nobody knows has the trouble seen me, even I sometimes wonder why I write these line
    71. Re:Code talks by manifoldronin · · Score: 1
      I think main problem with languages and their definitions is that they don't define always reasonably well what does exists. Many times the concept and definitions that are in words are simply unaccurate. They fall short or don't exist for something we need.
      Well, would you agree that the solution (or at least a reasonable approach) to the problem is _to deal with it_, i.e., to communicate and sort out an accurate definition/concept, and _then_ move on? Instead of just pretending the problem is not there, and asking people not to be so "nit pick", only to cause more confusion later on?
      How do you for example say precisely that something is not microkernel nor monolith but has lot of common with both? You don't, unless you figure out an accurate definition for it - which has to be shared by other people too . Technial people sometimes miss this diffrence and difficulty.
      I don't know why it's so hard to understand that "suggesting to deal with a difficulty" does not equal to "miss the difficulty". We are _not_ missing the difficulty. Like I said before, it is EXACTLY because we realize this difficulty, that we always suggest to "figure out an accurate definition", _and_ properly communicate it to other people, and then use that as a solid ground for any further communication. Your example shows exactly that - without accurate definitions, any communication is meaningless. How would _you_ propose to solve it? "Let's figure out a term for it?" or "let's all talk in our own terms and keep flaming each other until we all realize we've been talking about different things?"
      The gift of abstractions is that, unlike computers, we can deduct from incomplete information complete solutions and answers. Why not use it then?
      Because, by the very definition of "incomplete information", _everybody_ can feel free to fill in the missing parts however they think reasonable during the deduction. And again, I don't know how hard it is to understand that it is very likely that "however they think reasonable" actually produces different results with different people. Yes, the ability to abstract, to reason, and to deduct is a gift to the human being, but that doesn't mean each of us just run off and do "our own little thinking", and come back and point finger at others for "not getting what I was talking about."
      Why act like a computer?
      We are not talking about writing a poem or so much as our daily life. We are talking about developing _computer_ systems. Whatever creative brainstorm you do, at _some point_, we have to convert our ideas to some form that computers can understand, and guess what, at that point, we have to act like a computer.
      --
      Tyranny isn't the worst enemy of a democracy. Cynicism is.
  9. Crap by Anonymous Coward · · Score: 0

    10 messages posted and TFA is already /.ed

  10. Mirror by Anonymous Coward · · Score: 4, Informative

    Quick slashdoteffect there, that forum is already down. Anyhow.. mirror: http://www.mirrordot.org/stories/3f6b22ec7a7cffcf2 847b92cd5dec7e7/index.html

  11. Now that would be nice by Bombula · · Score: 2, Funny
    can the callee look at and change the callers state as if it were its own

    Any chance we could do this with my long distance phone service?

    --
    A-Bomb
    1. Re:Now that would be nice by Bombula · · Score: 1

      What ogre modded this down? It's funny, people. Laugh.

      --
      A-Bomb
  12. slashdotted, pastebin copy of interview by gigel · · Score: 5, Informative
  13. In case you missed it the first time around by Anonymous Coward · · Score: 1, Informative
  14. comments i liked by bariswheel · · Score: 3, Insightful

    "The whole "microkernels are simpler" argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel,the traditional kernel wins. By a huge amount, too. He goes on to say, "It's ludicrous how microkernel proponents claim that their system is "simpler" than a traditional kernel. It's not. It's much much more complicated, exactly because of the barriers that it has raised between data structures." He states that the most fundamental issue is the sharing of address spaces. "Nothing else really matters. Everything else ends up flowing from that fundamental question: do you share the address space with the caller, or put in slightly different terms: can the callee look at and change the callers state as if it were its own?"

    --
    Insinct is stronger than Upbringing - Irish Proverb
  15. A lot of work by El_Muerte_TDS · · Score: 1

    I'm pretty sure it's a shit load of work to port the linux kernel to become a micro kernel. Anyway got the spare time to do that?
    PS, besides porting all parts of the kernel you first need to redesign the kernel so it can cope with the micro kernel idea (and structural limitations).

    As soon as GNU Hurd is mature we'll have a drop-in replacement (right?).

    1. Re:A lot of work by Arandir · · Score: 1

      As soon as GNU Hurd is mature we'll have a drop-in replacement (right?).

      As soon as Hurd is mature, we'll finally get an OS named "GNU". Until then, calling something "GNU/Linux" is merely pandering to RMS' ego.

      p.s. And even when we get it, it will NOT be a drop-in replacement. Kernels are the brains of operating systems, you don't just "drop" them in anymore than you can do out-patient head transplants. That's why glibc was (re)written *FOR* Linux. I don't know if Hurd is copying Linux's API, but if it isn't, you'll have to rebuild glibc and everything else that makes a kernel call to use the Hurd API instead.

      p.p.s. I greatly suspect Hurd will have a Linux compatibility layer, just to get it bootstrapped. If that compatibility layer becomes the standard Hurd flavor, then we might have to start calling it "Linux/Hurd" :-)

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    2. Re:A lot of work by lederhosen · · Score: 1
      p.s. And even when we get it, it will NOT be a drop-in replacement. Kernels are the brains of operating systems, you don't just "drop" them in anymore than you can do out-patient head transplants. That's why glibc was (re)written *FOR* Linux. I don't know if Hurd is copying Linux's API, but if it isn't, you'll have to rebuild glibc and everything else that makes a kernel call to use the Hurd API instead.
      Glibc currently runs on linux and the Hurd, you do not have to rebuild anything. Hurd aims to track POSIX, single unix and other standards, allmost everything already runs on the Hurd today (Apache, X, Gnome, Kde, gcc, etc).
      I greatly suspect Hurd will have a Linux compatibility layer, just to get it bootstrapped. If that compatibility layer becomes the standard Hurd flavor, then we might have to start calling it "Linux/Hurd" :-)
      Hurd and Mack is bootstrapped by GRUB, and the Hurd is working, you can download debian GNU/Hurd today, it lacks sound and is not that stable though.
    3. Re:A lot of work by Arandir · · Score: 1

      Glibc currently runs on linux and the Hurd, you do not have to rebuild anything.

      Then that means that Hurd copied the Linux API. That's because significant parts of kernel APIs are not standardized. If two kernels are literal drop-in replacements for each other (ei. no kernel related #ifdefs in glibc, for example), then one has deliberately copied the other.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    4. Re:A lot of work by lederhosen · · Score: 1
      >Glibc currently runs on linux and the Hurd, you do not have to rebuild anything.

      Then that means that Hurd copied the Linux API. That's because significant parts of kernel APIs are not standardized. If two kernels are literal drop-in replacements for each other (ei. no kernel related #ifdefs in glibc, for example), then one has deliberately copied the other.

      Hurd did not copy the "Linux API", Linux copied the UNIX API. It is common knowledge.

      from the glibc site:

      D.2.2 Porting the GNU C Library to Unix Systems

      Most Unix systems are fundamentally very similar. There are variations between different machines, and variations in what facilities are provided by the kernel. But the interface to the operating system facilities is, for the most part, pretty uniform and simple.

      The code for Unix systems is in the directory unix, at the top level of the sysdeps hierarchy. This directory contains subdirectories (and subdirectory trees) for various Unix variants.

      The functions which are system calls in most Unix systems are implemented in assembly code, which is generated automatically from specifications in files named syscalls.list. There are several such files, one in sysdeps/unix and others in its subdirectories. Some special system calls are implemented in files that are named with a suffix of `.S'; for example, _exit.S. Files ending in `.S' are run through the C preprocessor before being fed to the assembler.

      These files all use a set of macros that should be defined in sysdep.h. The sysdep.h file in sysdeps/unix partially defines them; a sysdep.h file in another directory must finish defining them for the particular machine and operating system variant. See sysdeps/unix/sysdep.h and the machine-specific sysdep.h implementations to see what these macros are and what they should do.

      The system-specific makefile for the unix directory (sysdeps/unix/Makefile) gives rules to generate several files from the Unix system you are building the library on (which is assumed to be the target system you are building the library for). All the generated files are put in the directory where the object files are kept; they should not affect the source tree itself. The files generated are ioctls.h, errnos.h, sys/param.h, and errlist.c (for the stdio section of the library).

  16. Say what?! by Inoshiro · · Score: 0, Redundant

    "All popular OS kernels are monolithic."

    I must've skipped into a parallel world where Windows XP, Windows 2000, and Windows 2003 were not somehow based on the microkernel NT Exective.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Say what?! by teknomage1 · · Score: 1

      More likely you think you're living in a paralel world where MS lived up to it's marketing hype that NT would be a microkernel.

      --
      Stop intellectual property from infringing on me
  17. Windows is monolithic by microbee · · Score: 2, Informative

    Buy a copy of Windows Internals and educate yourself. Specifically, page 36: Is Windows a Microkernel-Based System?

    Windows and Linux are not THAT different as far as kernel architecture is concerned.

    1. Re:Windows is monolithic by Mostly+a+lurker · · Score: 2, Funny

      So, are Microsoft's problems with Windows Vista because it is based on a micro, a monolithic, or a hybrid kernel?

    2. Re:Windows is monolithic by jcr · · Score: 1

      Microsoft's problems with Vista are management problems. They're completely orthogonal to the style of their kernel.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    3. Re:Windows is monolithic by AnalystX · · Score: 1

      http://www.microsoft.com/library/media/1033/techne t/images/archive/ntwrkstn/evaluate/featfunc/f0af_b ig.gif

      That's funny. Microsoft has one of it's layers labeled "Microkernel." I guess it's a hybrid OS after all.

    4. Re:Windows is monolithic by microbee · · Score: 1

      Not sure what that "microkernel" piece actually means, but it's absolutely a picture of monolithic kernel. All those I/O manager, process manager, virtual memory manager, etc, are all running in one piece in the kernel.

    5. Re:Windows is monolithic by Vo0k · · Score: 4, Funny

      Because it's based on a huge, monstrous monolithic microkernel.

      --
      Anagram("United States of America") == "Dine out, taste a Mac, fries"
    6. Re:Windows is monolithic by AnalystX · · Score: 2, Informative

      Perhaps you'll get more out of this instead: The Win32 Subsystem (what makes it Windows) is clearly running in user mode.

      http://www.microsoft.com/resources/documentation/w indowsnt/4/workstation/reskit/en-us/archi.mspx?mfr =true

      Also, Microsoft admits that microkernels are more dependable and show their research here:

      http://research.microsoft.com/research/pubs/view.a spx?type=technical+report&id=989

      If you decide to look at the PDF, you can go straight to page 7 for the kernel architecture.

    7. Re:Windows is monolithic by shaka · · Score: 1
      Perhaps you'll get more out of this instead: The Win32 Subsystem (what makes it Windows) is clearly running in user mode.


      Um... No? They were clearly running in user mode in NT 3.51. Under that is the specification of how they changed that in NT 4.0, and then a pretty straight-forward explanation of what they did: Move (most of) the Win32 Subsystem into kernel space.

      How about actually reading what you're referring to?
      --
      :wq!
    8. Re:Windows is monolithic by Cyno · · Score: 1

      Microsoft's problems with Vista:

      Hype
      Management style
      Design, or failure to properly redesign
      The entire project's sole focus on making money?

      I don't know, Vista's just Microsoft. Its gunna be the most fastest, cheapest, bestest secure OS eva, oh yeah, uh huh. Whatever they gotta tell you to get your money. I bet they just update the graphics and move some things around to make you think its a whole new OS. I haven't seen much technical improvement since NT 3.51, and a lot of cowboy capitalist nonsense changing what was originally designed to be a stable server class kernel into a cheap gaming platform. And then there's the Xbox 360, which will probably end up making them lots of money and putting lots of competitors out of business again. Yay.

      The whole point of the software that makes up a Linux OS is not to save you money, but to save you from the hassle of dealing with the Microsoft sort of marketplace, full of lies, half truthes, anythings-to-get-your-moneys. Its like a bunch of Smeagles running the top corporations in all the different markets, snatching up their almighty precious dollars. What I like about Linux is its focus on the art of programming.

      Pinko
      Communist
      Socialist
      Liberal
      Hippie
      Homosexual
      Druggie
      Artist comes to mind, but I could be mistaken.

    9. Re:Windows is monolithic by AnalystX · · Score: 1

      The poster said, "I must've skipped into a parallel world where Windows XP, Windows 2000, and Windows 2003 were not somehow based on the microkernel NT Exective." The diagram that illustrates the "NT Executive" is the top one. I already linked to a diagram of the NT 4.0 kernel.

      I have no problem with Windows being called a hybrid OS since Microsoft themselves claim, "Windows NT has always had a modified microkernel architecture." Calling a "modified microkernel" a monolithic kernel is a bit of a stretch.

    10. Re:Windows is monolithic by AnalystX · · Score: 1
    11. Re:Windows is monolithic by microbee · · Score: 4, Informative
      Please, let's end this "Windows NT is microkernel" myth once and for all. Since most people don't actually know what a microkernel is, I'd quote some "authoritative" sources on this issue.

      1. From AST (I'd assume you know who he is since you are interested in Linus/microkernel debate): http://www.cs.vu.nl/~ast/brown/followup/ Read the section "Microkernels Revisited":

      I can't resist saying a few words about microkernels. A microkernel is a very small kernel. If the file system runs inside the kernel, it is NOT a microkernel. The microkernel should handle low-level process management, scheduling, interprocess communication, interrupt handling, and the basics of memory management and little else. ... Microsoft claimed that Windows NT 3.51 was a microkernel. It wasn't. It wasn't even close. Even they dropped the claim with NT 4.0.

      2. From Windows Internals, the 4th edition, published by Microsoft Press. Page 36: Windows is similar to most Unix systems in that it's a monolithic operating system in the sense that the bulk of the operating system and device driver code shares the same kernel-mode protected memory space. Can we stop claiming Windows has a microkernel now?

    12. Re:Windows is monolithic by maxwell+demon · · Score: 2, Funny

      But do they have a monolithic management or micromanagement?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    13. Re:Windows is monolithic by DrPizza · · Score: 1

      They moved GDI into the kernel. Other bits of Win32 remain user-mode, as does POSIX. Moving GDI in this way improved performance with no effective loss of stability because GDI was always deemed a "critical" subsystem; if it crashed in NT 3.51 the OS was still brought down. CSRSS still maintains this property.

      In Vista, large tracts of the new graphics subsystem are moving back out into user-mode, as are various other odds and sods like sound drivers. Vista will also have a greater ability to restart crashed user-mode components, perhaps even the video subsytem.

    14. Re:Windows is monolithic by Anonymous Coward · · Score: 0

      You're a fucking idiot.

    15. Re:Windows is monolithic by Pollardito · · Score: 1

      i bet there's actually a parallel conversation inside Microsoft about whether they should switch to a nanokernel

    16. Re:Windows is monolithic by Richard+Steiner · · Score: 1

      Yes. :-)

      --
      Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
      The Theorem Theorem: If If, Then Then.
    17. Re:Windows is monolithic by AnalystX · · Score: 1
      Since you responded directly to my post, I must assume you think that "Window NT is hybrid kernel" is a myth, because I never stated that "Windows NT is microkernel." So here are my responses:

      1) Windows NT still uses microkernel concepts like message passing to tie all the components together. This does not make it a microkernel, but at the same time monolithic kernels do not do this. So what would one call it if it isn't exactly one or the other? A hybrid!

      2) From Windows Internals, the 4th edition, page 36: "Windows isn't a microkernel-based operating system in the classic definition of microkernels." Now that's interesting. The author felt like he had to qualify the type of microkernel it isn't, instead of just saying it isn't a microkernel-based OS. Perhaps that's why Microsoft still refers to Window NT architecture as being based on a modified microkernel, or what everyone else calls it, hybrid.

      "Can we stop claiming Windows has a microkernel now?"
      No problem. Windows has a hybrid kernel.
    18. Re:Windows is monolithic by gronofer · · Score: 1
      Windows NT still uses microkernel concepts like message passing to tie all the components together.

      Interesting. You make it sound like they take all the pain of the microkernel communication methods without the benefits that would come from actually having a microkernel.

    19. Re:Windows is monolithic by AnalystX · · Score: 1

      Sounds like a fair assessment. Although I spend a lot of time developing applications on Windows, I don't think Windows is well designed.

    20. Re:Windows is monolithic by DShard · · Score: 1
      Windows NT still uses microkernel concepts like message passing to tie all the components together.


      Message passing without a context switch is what is known as a function call. Linux handles message passing the same way.
    21. Re:Windows is monolithic by AnalystX · · Score: 1

      Windows message passing != Linux message passing

      More on the point of being a modified microkernel:
      "It is more or less true, for example, that both Windows NT 5.X and Unix variants like Mach and some BSD variants use a modified microkernel design"

      More on memory management starting with NT 5.0:
      'Windows NT 5.0 and its successors use clustered paging, a working set memory analogue and a free memory manager that fires up exactly once per second, while Unix uses an adaptive page specific algorithm -- often least-recently used -- to control paging. In Unix, there is no working set equivalent, and the free memory manager runs when needed.' ... 'the Windows kernel [...] runs nonthreaded internally. This choice avoids "object blockage" to trade off concurrency and context switching in favor of increased efficiency for, and better control of, a small number of key processes.' ... 'In contrast, the Unix approach generally has been to favor process creation and context switching at the cost of some efficiency for long-running processes.'

      http://www.linuxinsider.com/story/33089.html

    22. Re:Windows is monolithic by SteeldrivingJon · · Score: 1

      "But do they have a monolithic management or micromanagement?"

      "Nobody could ever need fewer than 640k managers." - Bill Gates

      --
      September 2011: Looking for Cocoa/iOS work in Boston area Cocoa Programmer Quincy, MA
  18. Microkernels and the future of hardware by SigNick · · Score: 4, Insightful

    I think Linus hit the spot by pointing out that the future of home computing is going to to focus on parallel processing - it's 2006 and all my computers, including my LAPTOP, are dual-processor systems.

    By 2010 I suspect at least desktops are 4-CPU systems and as the numbers of cores increase one of the large drawbacks of microkernels raises it's ugly head: microkernels turn simple locking algorithms into distributed computing-style algorithms.

    Every game developer tells us how difficult it is to write multi-threaded code for even our monolithic operating systems (Windows, Linux, OSX). In microkernels you constantly have to worry how to share data with other threads as you can't trust them to give even correct pointers! If you would explicitly trust them, then a single failure at any driver or module would bring down the whole system - just like in monolithic kernels but with a performance penalty that scales nicely with the number of cores. What's even worse is that at a multi-core environment you'll have to be very, very careful when designing and implementing the distribution algorithms or a simple user-space program could easily crash the system or gain superuser privileges.

    --
    Capitalization is the difference between "Helping your uncle jack off a horse" and "Helping your uncle Jack off a horse"
    1. Re:Microkernels and the future of hardware by ingenthr · · Score: 4, Interesting

      Don't take C's poor support for threading and tools to build/debug threaded code to mean that writing threaded code isn't possible. Other platforms and languages have taken threads to great extremes for many years, and I'm not necessarily referring to anything Unix (or from Sun).

      This reminds me of the story (but I don't know how true it is) that in the early days of Fortran, the quicksort algorithm was widely understood but considered to be too complicated to implement. Now 2nd year computer science students implement it as a homework project. Threads could be considered similar. Anyone who has written a servlet is implicitly writing multithreaded code and you can very easily/quickly write reliable and safe threaded code in a number of modern languages without having to get into the details C forces you into. It's the mix of pass-by-reference and pass-by-value with only a bit of syntactical sugar that creates the problems, not the concepts of parallelism.

      On the other hand, I agree with you that we'll see increased parallelism driving increases in computing capabilities in the coming years. It was mathematically proven some time ago, but Amdahl's law is now officially giving way to Gustafson's law (more on John Gustafson here). Since software codes are sufficiently complex these days (even the most simple of modern programs can make use of parallelism-- just think of anything that touches a network), it's those platforms that exploit this feature which stand to deliver the best benefits to it's users.

    2. Re:Microkernels and the future of hardware by archen · · Score: 3, Insightful

      This reminds me of the story..

      The early days of Fortran were before the 70's. Given the extremly tight ram constraints you'd probably have to implement a non-recursive iterative form which is FAR more complex. And this is Fortran we're talking about, not known for being the cutest language out there - and if we're referring to pre fortran66 then you're only branching construct is the 3way arithmatic IF statment. Now given that and considering your only method of debugging is taking a heap dump and looking through punch cards... I'd say yeah, it probably was too hard to implement.

      It's pretty easy to say that your typical "oops I forgot a semicolon so I'll recompile" CS student with pretty much no ram constraints for the problem can do it as a homework project. Have him do the iterative form with nothing but if and goto, plus each mistake making him looking through a core dump and waiting until not only the problem is solved, but (s)he could schedule a time when they could try to run their program again? I think that's beyond most CS students.

    3. Re:Microkernels and the future of hardware by jenesuispasgoth · · Score: 1

      By 2010 I suspect at least desktops are 4-CPU systems and as the numbers of cores increase one of the large drawbacks of microkernels raises it's ugly head: microkernels turn simple locking algorithms into distributed computing-style algorithms.

      Wake up, distributed algorithms exist at the hardware level since there's been a problem with cache coherent behaviour in multi-processor machines. I don't see what's the problem with them, really. Well, to be honest, I do see, but I'm not sure that the problem is that important with the actual (and future) hardware we can get.

    4. Re:Microkernels and the future of hardware by ozamosi · · Score: 2

      That's the point!

      If the tools that has been written since has made quicksort such a simple task, why wouldn't parallell computing become such a simple task in a few years?

    5. Re:Microkernels and the future of hardware by tgd · · Score: 1

      Don't take the apparent ease of threaded programming in Java or other modern languages as an indication that modern code is typically written to be thread safe.

      Virtually every open source Java project I've used, and every single commercial application I've seen source for in Java has not been written to be properly thread safe. Even your typical principal-level Java engineer typically does not know what synchronized really does, and how it relates to the volatile keyword (which I've rarely ever seen in Java code -- and if its not there, the code is NOT thread safe). Not a single one I've ever spoken to in a professional situation has ever been able to detail what the threading rules in the java memory model are.

      Java code tends to work because Intel systems guarantee cache coherency and most Java is run on Intel systems.

      There is no real difference between threading in C and more modern languages -- the primary difference is that modern languages like Java and the suite of .NET languages have strict memory models, and C varies among systems. Java is very specific -- there is no guarantee that the value of a variable will be seen consistently across threads if it isn't marked volatile, for example. It *may* work (as it frequently does on Intel systems), but Java says you must not count on that. Hotspot optimizations can impact that, and different cache architectures on other platforms can. C on the other hand has different rules per platform that the engineer has to know.

      But until 100% of Java developers know how to write thread safe Java, instead of 1/10th of 1% of them, I wouldn't go throwing stones at C.

    6. Re:Microkernels and the future of hardware by WilliamSChips · · Score: 2

      The tools *have* been written. Look up the Actors Model and CSP on Wikipedia and click links from there. The problem is that everybody insists on threading.

      --
      Please, for the good of Humanity, vote Obama.
    7. Re:Microkernels and the future of hardware by Halo1 · · Score: 1
      and how it relates to the volatile keyword (which I've rarely ever seen in Java code -- and if its not there, the code is NOT thread safe)
      That's not true. If all threads use synchronized accesses to access a field, you don't need volatile. See e.g. here:
      The volatile modifier requests the Java VM to always access the shared copy of the variable so the its most current value is always read. If two or more threads access a member variable, AND one or more threads might change that variable's value, AND ALL of the threads do not use synchronization (methods or blocks) to read and/or write the value, then that member variable must be declared volatile to ensure all threads see the changed value.
      I assume a synchronization operation in Java implicitly acts as a memory barrier.
      --
      Donate free food here
    8. Re:Microkernels and the future of hardware by ObsessiveMathsFreak · · Score: 1

      It's the mix of pass-by-reference and pass-by-value with only a bit of syntactical sugar that creates the problems, not the concepts of parallelism.

      In other words, it's the language. And I don't just mean C here. The bottom line is, as of 2006, there is no mainstream computer language that is designed from the ground up to support multi threaded code. They all start from the mindset of a single thread, and bolt on additional threads later, via libraries, classes, etc. Threading is not an integral part of the language.

      --
      May the Maths Be with you!
    9. Re:Microkernels and the future of hardware by Anonymous Coward · · Score: 1, Insightful

      Ada.

    10. Re:Microkernels and the future of hardware by Anonymous Coward · · Score: 0

      Sure that servlet is a really great example of parallelism! Game design requires *tight* syncrhony amongst the threads. As another example, say you are solving a vector PDE in 3d using a full multi-grid method --- the synchrony has to be tight because the method relies on multiple convolutions and the order of operations is not commutative --- the threads all have to waltz gracefully not thrash in a mosh pit. There is a whole level of parallelism that the parent knows nothing about.

    11. Re:Microkernels and the future of hardware by putaro · · Score: 1

      In microkernels you constantly have to worry how to share data with other threads as you can't trust them to give even correct pointers!
      This is not unique to micro-kernels. A multi-threaded monolithic kernel has the exact same issues, especially when it is running on true multi-processor hardware. This used to be why kernel guys got the big bucks - now there's a bunch of people who do it for free.

    12. Re:Microkernels and the future of hardware by archen · · Score: 1

      I was sort of elaborating, but yeah I tend to have a lot of sympathy for Fortran programmers having done some myself. However if you look at the limitation of what they were facing, they had the answer, just no practical way to do it. Parallel computing is a bit different however, because you have to change the way you program, there's just no way to get around that there's no definite answer.

      I did threaded programming in college and it seems to be about the same today, and was the same as many years before it. Threading isn't getting easier because of the nature of the problem. I think WilliamSChips (post above) has an interesting point though. Maybe we're over-complicating things by our approach of the problem. I wouldn't be surprised if this eventually leads to a new programming model.

    13. Re:Microkernels and the future of hardware by ingenthr · · Score: 1

      I agree with this, and I probably laid too much blame at the feet of C. With some modern languages though, there has been some effort at reducing the complexity of writing multithreaded code.

    14. Re:Microkernels and the future of hardware by faedle · · Score: 1

      Hey! OS X uses a microkernel, and seems to have no difficulty handling multiprocessor systems, dammit.

    15. Re:Microkernels and the future of hardware by ingenthr · · Score: 1

      I'd agree with many of your comments, but I have to disagree when it comes to saying there is nothing new about threading in Java and other modern languages. Just look at the concurrency utilities.

      Regarding cache coherency, pretty much every modern, mainstream computer system guarantees cache coherency through some approach or another (NUMA, COMA designs). It's not just the domain of Intel.

      And like I said in a previous post, I probably laid too much blame at the feet of C. My point was, with the post I replied to, that it's inaccurate to state threading is too complex to be of use in the kernel. Even C, with the appropriate tools, can be highly threaded and reliable. I believe I was clear about that.

      Regardless, even if you get the language and code right, the big issues with scalable system design start to get much more into how memory is handled between the hardware and software than how the code is threaded.

    16. Re:Microkernels and the future of hardware by rthille · · Score: 1

      I think Linus hit the spot by pointing out that the future of home computing is going to to focus on parallel processing - it's 2006 and all my computers, including my LAPTOP, are dual-processor systems.

      <pedantic> Almost none of your computers are dual-processor. The ones in your microwave, your watch, your car aren't dual processor.

      --
      Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
    17. Re:Microkernels and the future of hardware by magetoo · · Score: 1
      You're going to have problems keeping data synchronized between CPUs whether you choose a monolithic or a microkernel model. How exactly is "monolithic" going to magically solve that?

      With a MK design, you can at least choose to split the operating system over multiple CPUs, with user programs running "near" the part of the OS they are interacting with (e.g. movie player on the same CPU as the graphics subsystem, database on the same CPU as the file system, etc.). Move only the data that needs to be moved.

      I should admit that I didn't understand everything you said ("can't trust them to give even correct pointers"). Feel free to elaborate.

    18. Re:Microkernels and the future of hardware by sholden · · Score: 1

      Up until Fortran 90 you couldn't write recursive functions in FORTRAN (well not without doing evil things to trick the compiler). The language did not allow a function to call itself - iterative quicksort isn't so much fun :)

    19. Re:Microkernels and the future of hardware by lederhosen · · Score: 1

      OS X is not a microkernel OS-

    20. Re:Microkernels and the future of hardware by lederhosen · · Score: 1
      I should admit that I didn't understand everything you said ("can't trust them to give even correct pointers"). Feel free to elaborate.


      Do not worry, your parent poster did not understand what he was talking about so why should you understand what he was talking about?
    21. Re:Microkernels and the future of hardware by tgd · · Score: 1

      It inserts a memory barrier around that single object, not the entire code block. If you're not running agressive optimizations, you usually won't see any difference, but when the JVM starts reordering operations as part of optimizing the code, weird things can start happening because a simple read of a variable which may be able to be modified in other code may happen at times you don't expect and could never be seen by other threads.

      Its *hard* to write Java threading code correctly. Its damn near impossible prior in Java 5 (there's a reason they completely replaced the memory model in Java 5 -- there were patterns that could not be coded correctly prior to that). And in my experience the more certain someone is that they're doing it right, the more likely it is its wrong.

      I couldn't tell you how many Swing applications I've seen using anonymous inner classes declared in the constructor (which is a good example of something that is never thread safe, no matter what you do, prior to Java 5)

    22. Re:Microkernels and the future of hardware by tgd · · Score: 1

      Sparc doesn't. And the Java memory model explicitly doesn't. Java code on any platform has to assume there is no cache coherancy, and that no change to any variable not marked volatile will ever be seen by any other thread. Volatile inserts memory barriers, whereas synchronized is more about guaranteeing that a block of code will execute in-order and completely with respect to other code also locking on the same lock.

      A very common misconception is that synchronized acts as a full memory barrier and causes a flush of all data associated with the block before entry and after exit, which isn't the case. (Note the comment the other reply to my post made, which was incorrect)

    23. Re:Microkernels and the future of hardware by faedle · · Score: 1

      Funny. Linux Journal and a whole host of other publications think that it is.

    24. Re:Microkernels and the future of hardware by faedle · · Score: 1

      Oh, and Apple claims it is, too.

  19. already been done by sentientbrendan · · Score: 2, Informative
    1. Re:already been done by PhilHibbs · · Score: 1

      "MkLinux is an Open Source operating system which consists of an implementation of the Linux operating system hosted on the Mach microkernel."

      How much of the Linux kernel is there in MkLinux? AIUI, Linux isn't an operating system, it's a kernel. What does "the Linux operating system hosted on the Mach microkernel" actually mean? Should they have said "the GNU operating system hosted on the Mach microkernel"? Or, does it contain parts of the Linux kernel?

    2. Re:already been done by Espen+Skoglund · · Score: 1
      MkLinux, or L4Linux, or any pre-virtualization techniques to run Linux on a microkernel, are not considered microkernel versions of Linux. They are simply projects that turn Linux into a monolithic server running on top of the microkernel.

      Trying to turn a monolithic kernel into a microkernel has been attempted before. The result was the abomination which is Mach.

    3. Re:already been done by Arandir · · Score: 1

      It's all Linux. It's the full monolithic kernel squatting atop Mach. OSX did the same with FreeBSD. All the drivers, filesystems, etc., are a part of the monolithic kernel.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
  20. Hybrid kernels??? by r00t · · Score: 3, Informative

    That would be monolithic+marketing.

    MacOS X is no microkernel system. It does have Mach, sure. Mach is arguably not a microkernel by today's standards, and in any case MacOS X has a full BSD kernel bolted onto the Mach kernel. Mach and BSD are sharing address space. In other words, it's not a microkernel.

    NT is the same way.

    I don't know all that much about NetWare, but I'd never before heard anyone claim it to be a microkernel. It's not terribly popular anyway. (it was, but back then I'm sure it wasn't a microkernel system) ReactOS isn't much yet. BeOS died for unrelated reasons, so we really can't judge.

    Monolithic kernels can be very modular. Microkernels can get really convoluted as the developers struggle with the stupid restrictions.

    1. Re:Hybrid kernels??? by jackjeff · · Score: 5, Interesting

      Depends on what you mean by Micro Kernel and Monolithic.

      True, the kernel of MacOS/X - Darwin, aka XNU, for performance reasons run the Mach and BSD layer both in superuser space to minimize the lattency.

      Maybe this is what you call a hybrid kernel: http://en.wikipedia.org/wiki/Hybrid_kernel

      You may call XNU whatever you wish but the fact remains:
      - it's not a monolithic kernel by design
      - it has Mach in it and Mach is some sort of microkernel. Maybe it does not reach "today's" standards of being called a microkernel but it was a very popular microkernel before.

      So maybe the things running on top of Mach ( http://developer.apple.com/documentation/Darwin/Co nceptual/KernelProgramming/index.html ) are conceptually "different" from what the services of microkernel should be, and they do share indeed the address space, but this is very very very different from the architecture of a traditional monolithic kernel such as Linux

      This guy ( http://sekhon.berkeley.edu/macosx/intel.html ) recently tested some stats software on his Mac running OS X and Linux, and found out that indeed MacOS X had performance issues, very likely due to the architecture of the kernel.

      There's even a rumor that says that since Avie Tevanian left Apple ( http://www.neoseeker.com/news/story/5553/ ), some guys are now working for removing the Mach microkernel and migrate to a full BSD kernel in the next release of the operating system.

      And now my personal touch. I agree with Linus when he says that having small components doing simple parts on their sides and putting them together with pipes and so on, is somehow the UNIX way and is attracting (too lazy to find the quote). However as he demonstrates later, distributed computing is not easy, and there's also the boundray crossing issue. I guess he has a point when he says this is a problem for performance and the difficulty on designing the system... So if performance is what you indeed expect from a kernel, then you must stop dreaming of a clean-centralized good software architecture like those we have for our high oo-oriented software.

      But the truth is that, although developing a monolithic kernel is an easier task to do from scratch than a microkernel, I guess the entry ticket (learning curve) for a monolithic kernel developes is more expensive. The main reason being, "things ARE NOT separated". Anyone, anywhere in the kernel could be modifying the state of that thing, for non obvious reason, even if there's a comment that says "please don't do that" or it shoulld not be the case etc.... Microkernel can obviouisly provide some kind of protection and introspections to these things, but have always hurt performances to do so.

      Now it has everything to do on what you expect. Linux has many many many developpers and obviously can afford having a monolithic design that changes every now and then and you may prefer a kernel that goes fast than one whose code is clearn, well organized and easy to read. But the corrolary of that observation is that for the same reasons, grep, cat, cut, find, sort, or whatever unix tools you use with pipes and redirection are similarly a cleaner but YET INEFFICIANT design. However, it's been proven (with time) to be a good idea..

      I think things that are "low level" will be bound to have a poor spagehtti software architecture because performance matters and the code is smaller.. but the higher level you go, the less performance matters, and the more code maintenance and evolutivity matters... Everything is a tradeof: good design practice depends on the type of problems your software tackles.

      That said, it does not mean no progress can be made in kernel developments. Linux already uses a somewhat different C lang

    2. Re:Hybrid kernels??? by aurum42 · · Score: 1

      The "R" statistical software guy is full of shit. A cursory look at his matrix multiply code will reveal that he's a completely inadequate programmer. Porting some piece of shit package from one OS to another and making no effort to optimize for the second OS does not make for an accurate comparison of performance.

      --
      "The slave who knows his master's will and does not get ready...will be be beaten with many blows."Luke 12:47-48
    3. Re:Hybrid kernels??? by jackjeff · · Score: 1

      I must say I did not have a look at the code... Anyway, I remember the guys from MySQL complaining about speed issues. Seeing numerous benchmarks etc etc... And also a bit of my personal experience. Generally I/O and memory management on MacOS X are less efficient than on Linux or Windows and it's the fault of the kernel Now this is important and critical for some persons, and it's not for others, or there would not be many Macs around these days :)

    4. Re:Hybrid kernels??? by diegocgteleline.es · · Score: 3, Informative

      Let's ask Apple what thinks about all this: "Advanced Synchronization in Mac OS X: Extending Unix to SMP and Real-Time":

      "xnu is not a traditional microkernel as its Mach heritage might imply. Over the years various people have tried methods of speeding up microkernels, including collocation (MkLinux), and optimized messaging mechanisms (L4)[microperf]. Since Mac OS X was not intended to work as a multi-server, and a crash of a BSD server was equivalent to a system crash from a user perspective the advantages of protecting Mach from BSD were negligible. Rather than simple collocation, message passing was short circuited by having BSD directly call Mach functions. While the abstractions are maintained within the kernel at source level, the kernel is in fact monolithic. xnu exports both Mach 3.0 and BSD interfaces for userland applications to use. Use of the Mach interface is discouraged except for IPC, and if it is necessary to use a Mach API it should most likely be used indirectly through a system provided wrapper API."

    5. Re:Hybrid kernels??? by k12linux · · Score: 1
      I don't know all that much about NetWare, but I'd never before heard anyone claim it to be a microkernel. It's not terribly popular anyway.

      FWIW, Netware isn't terribly popular, even with NetWare fans, these days. The services that ran on NetWare now allmost universally can run on a Linux core. In fact OES (Open Enterprise Server) can be installed as NetWare or as Linux + services. People I have talked to with ties to the company say that while Novell will still support installations based on Netware for some time to come, they are really moving to Linux as their OS.

      I personally applaud this decision since it can allow Novell to stop spending time dealing with basic OS and hardware issues and instead concentrate on really useful products like eDirectory. I was about ready to give up on Novell entirely prior to this change.

      So, bottom line... if Netware ever was microkernel based (I don't think it was) it basically isn't anymore.

    6. Re:Hybrid kernels??? by Anonymous Coward · · Score: 0

      "There's even a rumor that says that since Avie Tevanian left Apple, some guys are now working for removing the Mach microkernel and migrate to a full BSD kernel in the next release of the operating system."

      I keep wondering if the DragonFly kernel might not be a great replacement for Mach. Rather than bolting Mach onto the FreeBSD kernel, it's an evolution of the FreeBSD 4.8 kernel with lots of message passing, micro-kernel like goodness added in order to simply the design. So it really is a sort of hybrid kernel. And everything I keep reading suggests that DragonFly ought to be nice and fast once al the necessary pieces are in place.

    7. Re:Hybrid kernels??? by DShard · · Score: 1

      It isn't even monolithic. It is a network DOS. Everything runs in kernel space (though they do have a way to run _some_ apps in a user space). I have seen the port of gnu true take down a server.

  21. Re:Linus Quote - "not arguing against it at all" by ultranova · · Score: 4, Interesting

    The whole argument that microkernels are somehow "more secure" or "more stable" is also total crap. The fact that each individual piece is simple and secure does not make the aggregate either simple or secure."

    Individual pieces aren't really any simpler either. In fact, if you want your kernel to scale, to work well with lots of processes, you are going to run into a simple problem: multitasking.

    Consider a filesystem driver in a monolithic kernel. If a dozen or so processes are all doing filesystem calls, then, assuming proper locking and in-kernel pre-emption, there's no problem - each process that executes the call enters kernel mode and starts executing the relevant kernel code immediately. If you have a multiprocessor machine, they could even be executing the calls simultaneously. If the processes have different priorities, those priorities will affect the CPU time they get when processing the call too, just as they should.

    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up. This is an especially fun situation if the calling process has a higher priority than some CPU-consuming process, which in turn has a higher priority than the filesystem server. But, even if there are no other queued requests, and the server is ready and waiting, there's no guarantee that it will be scheduled for execution next, so latencies will be higher on average than on a monolithic kernel even in the best case.

    Sure, there are ways around this. The server could be multi-threaded, for example. But how many threads should it spawn ? And how much system resources are they going to waste ? A monolithic kernel has none of these problems.

    I don't know if a microkernel is better than monolithic kernel, but it sure isn't simpler - not if you want performance or scalability from it, but if you don't, then a monolithic kernel can be made pretty simple too...

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  22. It's not really a microkernel. by r00t · · Score: 3, Insightful

    By today's standards, Mach is not much of a microkernel. Mach has been disowned by microkernel proponents because it was so big and nasty.

    MacOS has that sharing address space with the monolithic BSD kernel. So a semi-microkernel and a monolithic kernel are firmly bolted together. That's only a microkernel if your degree is in marketing.

  23. Distributed not that hard. by Inoshiro · · Score: 3, Interesting

    "You can do simple things easily - and in particular, you can do things where the information only passes in one direction quite easily, but anythign else is much much harder, because there is no "shared state" (by design). And in the absense of shared state, you have a hell of a lot of problems trying to make any decision that spans more than one entity in the system."

    I think you're looking at this the wrong way around.

    There has been a lot of research into this over the past 40 years, ever since Dijkstra first talked about coordination on a really big scale in the THE operating system. Any decent CS program has a class on distributed programming. Any decent SW architect can break down these different parts of the OS into weakly-connected pieces that communicate via a message passing interface (check out this comment by a guy talking about how Dragonfly BSD does this).

    It's obvious that breaking something like your process dispatcher into a set of processes or threads is silly, but that can be easily separated from the core context switcher. Most device driver bottom halves live fine as a userland process (each with a message-passing interface to their top-halves).

    If you're compiling for an embedded system, I'm sure you could even entirely remove the interface via some #define magic; only debug designs could actually have things in separate address spaces.

    The point I'm trying to make is: yes, you can access these fancy data structures inside the same address space, but you still have to serialize the access, otherwise your kernel could get into a strange state. If you mapped out the state diagram of your kernel, you'd want the transistions to be explicit and synchronized.

    Once you introduce the abstraction that does this, how much harder is it to make that work between processes as well as between threads in the kernel? How much of a benefit do you gain by not having random poorly-written chunks pissing over memory?

    How about security benefits from state-machine breakdowns being controlled and sectioned off from the rest of the machine? A buffer overflow is just a clever way of breaking a state diagram and adding your own state where you have control over the IP; by being in a separate address space, that poorly written module can't interact with the rest of the system to give elevated privileges for the attacker (unless, of course, they find flaws in more of the state machines and can chain them all together, which is highly unlikely!).

    Clearly there is a security benefit as much as there is a consistency benefit. Provably correct systems will always be better.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Ahah! You must be that 'full of sh!t' individual Linus alluded to. Thanks for stopping in and proving him correct!

    2. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      It's pathetic the number of cock suckers in here backing up Linus in supporting an obsolete kernel design,

    3. Re:Distributed not that hard. by Gorshkov · · Score: 4, Interesting

      Provably correct systems will always be better.

      Well, I could certainly argue THAT one.

      Years ago, I was a lead analyst on an IV&V for the shutdown system for a nuclear reactor - specifically, Darlington II in Ontario, Canada.

      This was the first time Ontario Hydro wanted to use a computer system for shutdown, instead of the old sensor-relay thingie. This made AECB (Atomic Energy Control Board) rather nervous, as you can understand, so they mandated the IV&V.

      I forget his first name - but Parnas from Queen's University in Kingston had developed a calculus to prove the correctness of a programme. It was susinct, it was precice, it was elegant, and it worked wonderfully.

      ummmmm ..... well, kind of. About 3/4 of the way through the process, I asked a question that nobody else had thought of.

      OK, so we prove that the programme is correct, and it'll do what it's supposed to do .... but how long will it take?

      You see, everybody had kinda/sorta forgot that this particular programme not only had to be correct, but it had to tell you that the reactor was gonna melt down BEFORE it did, not a week afterwards.

      The point is, that there is often much more involved in whether or not a programme (or operating system) is usefull than it's "correctness"

    4. Re:Distributed not that hard. by Schraegstrichpunkt · · Score: 2, Insightful
      The point is, that there is often much more involved in whether or not a programme (or operating system) is usefull than it's "correctness"

      Sort of. In the scanerio you describe, the program was, in fact, not proved to be correct because the people who did the proof failed to take into account the real requirements for the system.

      If you don't even know your requirements, no methodology to implement those requirements is going to work reliably.

    5. Re:Distributed not that hard. by drgonzo59 · · Score: 2, Interesting
      Tovarisch Gorshkov, to prove that the program is correct ("covert channel analysis" and such.) might take up to a year and that is only if there are less than 10k lines of code and no more, but that doesn't mean that the program will _run_ slow. The time and methods used to prove correctness don't necessarily say anything about the speed of the program during runtime.

      So correct systems will always be better, because you know it is correct and you know the limits (want it to run faster -- just buy faster hardware ). On the other hand, if the program hasn't been been proved to work correctly, even though it might be blazingly fast, one day it might just stop working and your control rods will end up being stuck half way through, all because there is a "off-by-one" error in some stupid serial driver or something like that...

    6. Re:Distributed not that hard. by Gorshkov · · Score: 3, Informative

      Sort of. In the scanerio you describe, the program was, in fact, not proved to be correct because the people who did the proof failed to take into account the real requirements for the system.

      If you don't even know your requirements, no methodology to implement those requirements is going to work reliably.


      I agree absolutly.

      The point I was trying to make - and this is where I see the parallel - is that T seems to be trying to say that microkernel good, monolithic bad based only on elegant design, and theoretical simplicity. No doubt, it appeals to the academic in him (Go figure)

      But he is ignoring the "time domain" of an operating system, if you will - it's practicality, it's ability to do usefull work in a reasonable period, and it's usability in the real world - just as Parnas' notation did.

      I make no claim as to whether or not Parnas *intended* for his notation to be used for a hard real-time system - I know he was retained as a consultant on the project, but I personally neither saw nor heard of/from him during the entire time. And let me be perfectly clear - his notation was absolutly *gorgeous* and extremly usefull. I, on the other hand, having been the idiot who raised the point in the first place, wound up having to do the timing analysis based on best/worst case sensor timings, and instruction-by-instruction counting of the clock cycles required for each ISR, etc. I plugged the numbers into a programme I wrote for the purpose, and basically did nothing more than an exhaustive analysis of all possible combinations of timings. Not as elegant by far, but what the hell. Who cares if it takes two days to run, if it means you don't have to worry about glowing in the dark?

    7. Re:Distributed not that hard. by Gorshkov · · Score: 3, Insightful

      Tovarisch Gorshkov, to prove that the program is correct ("covert channel analysis" and such.) might take up to a year and that is only if there are less than 10k lines of code and no more, but that doesn't mean that the program will _run_ slow. The time and methods used to prove correctness don't necessarily say anything about the speed of the program during runtime.

      You're right, it *doesn't* say anything about the code efficiency, or the runtime per se ..... but then again, neither did I. Just as some algorythms are faster than others O(n) vs O(log n), etc, some designs are inherently slower than others. And what is a kernel, if not the expression of an (albiet complex) algorythm to accomplish a task (provide system services)?

      The microkernel may be more elegant, more pristine in the lab ..... but it's slow by design. There is only so much you can do to speed it up - the limitations are inherent in the message passing mechanisms.

      I'm sorry, I'm with Linux on this one.

      Provably correct doesn't mean "good" .... and "I haven't bothered proving the sucker" doesn't mean crash and burn.

      Also, there is nothing about a microkernel that makes it more inherently provably correct than a monolithic kernel. Even going back to Parnas' notation that we used years ago, and thinking about the structure of the Linux kernel, it would be pretty easy to go through the exercise and prove it correct/incorrect .... and no easier to do so with with Minix, or BeOS, or any other microkernel.

    8. Re:Distributed not that hard. by localman · · Score: 1

      In the scanerio you describe, the program was, in fact, not proved to be correct because the people who did the proof failed to take into account the real requirements for the system.

      Sure, but isn't that the whole problem with moving the argument up a level? We haven't actually solvedf the real issue. We've just changed it from "the program was wrong" to "the spec was wrong". Sounds like hand waving to me.

      The simple fact is that this stuff is hard. And there's no "right" way... just a series of tradeoffs.

      Cheers.

    9. Re:Distributed not that hard. by localman · · Score: 1

      Are you really replying to Linus here? That was his quote you quoted :)

      Cheers.

    10. Re:Distributed not that hard. by Schraegstrichpunkt · · Score: 1
      The point I'm trying to make is that if the spec is wrong (or if you don't even have a spec) then your likelihood of producing a reliable and secure -- but complex -- system is practically nil. At least with a "provably correct" system, you know that if your spec is right, then your results will be right. If your system isn't provably correct, then your system will probably be still broken if your spec is wrong, but even if it's right, your implementation still might be broken.

      It's basically a question of "Do you want problem A or problems A *and* B?"

    11. Re:Distributed not that hard. by drgonzo59 · · Score: 4, Interesting
      The microkernel may be more elegant, more pristine in the lab ..... but it's slow by design

      Today most of the software that is used to fly planes (both fighter jets and passenger) is based on a microkernel architecture. So microkernels are not just lab toys, real and mission critical systems are run by microkernel architectures.

      The speed problem can often be solved just buy getting a faster hardware. The main reason Linus rejected microkernels back in the day was because the cost of context switches was prohibitive. Today hardware is lot faster (roughtly Moore's law), so context switches will be alright on a 3GHz Pentium IV machines while it would not be doable on a 33Mhz machines.

      Also, there is nothing about a microkernel that makes it more inherently provably correct than a monolithic kernel.

      Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k. It can already take up to a year to check the correctness of a 8k lines of code microkernel and there will be an exponential demand for resources as the code size increases. So in reality it will not be possible to check the linux kernel for correctness.

    12. Re:Distributed not that hard. by TobascoKid · · Score: 5, Insightful

      But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k.

      Umm, doesn't that mean while you've prooved that the 10k microkernel lines correct, you'd still have ~6 million lines of code sitting outside the microkernal waiting to be prooved? I can't see how a microkernel can magically do with 10k everything Linux is doing with 6 million lines (especially as by the definition of microkernel, than there's no way it could).

      --
      At some point, somewhere, the entire internet will be found to be illegal.
    13. Re:Distributed not that hard. by drgonzo59 · · Score: 4, Insightful

      You don't have to prove it, as long as the microkernel will be able to put the system into a predetermined state, it could for example unload the driver and try another one or just try to relaod it, it could contact you via a pager and so on. As opposed to the whole system freezing because some idiot wrote if(a=1) instead of if(a==1) in the mouse driver. You can only hope that the system that froze was running Doom and Firefox and wasn't flying planes, or administering drugs.

    14. Re:Distributed not that hard. by localman · · Score: 1

      Perhaps. I won't argue it further than this... but I don't see that having a spec which may or may not be right is any improvement over having a program that may or may not be right. Either the code works or it doesn't and it doesn't much matter if it matches the spec, since the spec is just as likely to have bugs as the code, in my less than conclusive experience. That's not to say specs are bad.

      In other words I'm not convinced that A is seperate from B. I think you've got a problem space called AB and that's that.

      Cheers.

    15. Re:Distributed not that hard. by Nutria · · Score: 1

      The speed problem can often be solved just buy getting a faster hardware.

      A bubble sort can be proved "correct" and thus "secure", but faster hardware won't help much if you're using such an algorith/implementation to sort 4,000,000 items.

      --
      "I don't know, therefore Aliens" Wafflebox1
    16. Re:Distributed not that hard. by Entrope · · Score: 2, Interesting
      Today most of the software that is used to fly planes (both fighter jets and passenger) is based on a microkernel architecture.
      Sort of -- in the same way that OS X and similar systems are "based on a microkernel architecture". ARINC-653, which drives that software architecture, specifies a partitioning kernel that separates safety-critical tasks from non-safety-critical tasks (or other safety-critical tasks). Most DO-178B compliant software vendors then run a monolithic kernel in each partition. The partitioning kernel is usually more like an extremely rigorously verified virtualization service than a traditional microkernel.
    17. Re:Distributed not that hard. by kestasjk · · Score: 1

      Also as more cores and processors get added fewer context switches are needed, and the gap beetween micro and monolithic gets smaller.

      --
      // MD_Update(&m,buf,j);
    18. Re:Distributed not that hard. by Gorshkov · · Score: 2, Informative

      Today most of the software that is used to fly planes (both fighter jets and passenger) is based on a microkernel architecture. So microkernels are not just lab toys, real and mission critical systems are run by microkernel architectures.

      And where did I say that microkernels were unusable? I've personally used QNX and VRTX myself. For small, simple (for the O/s) systems, they're beautifull. As a general purpose coputing platform, they tend not to be.

      The speed problem can often be solved just buy getting a faster hardware. The main reason Linus rejected microkernels back in the day was because the cost of context switches was prohibitive. Today hardware is lot faster (roughtly Moore's law), so context switches will be alright on a 3GHz Pentium IV machines while it would not be doable on a 33Mhz machines.

      Disingenuous, but wrong. Modern computers do a lot more now, typically, then they did then - and so need faster CPUs for the WORKLOAD. I don't care what the application is .... for MOST things, telling somebody that theyr'e going to take a 10-20% hit off the top before they do ANYTHING, compared to the alternatives, is going to get you nothing but doors slammed in your face

      Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k. It can already take up to a year to check the correctness of a 8k lines of code microkernel and there will be an exponential demand for resources as the code size increases. So in reality it will not be possible to check the linux kernel for correctness.

      Again .... disingenuous, and again, wrong.

      Linus has this nice little kernel with 2.6 million lines of code in it
      Linus refactors his code so that device drivers, filesystems, etc are outside the kernel, and he has a nice mini-me Linux

      What do we have? We STILL have 2.6 million lines of code, but some of them are in the kernel, and the rest of them are OUTSIDE the kernel. SO what magically happens to those bits that were moved out to userland? Did they suddenly become flawless? Of course not - the errors and flaws are still there. Because you do't really CARE about any arbitrary distinction betweeen kernel/userland, do you, as long as you can read from the disk, write to the network, etc. it's the SYSTEM that counts ..... and the SYSTEM still has 2.6 million lines of code.

      Secondly, a lot of the things that you're claiming for microkernels - lack of complexity, etc - can be acheived just as simply by how you organise the sorce code FOR the kernel. It used to be called compartmentalisation. Ever hear of it?

    19. Re:Distributed not that hard. by raduf · · Score: 1


      Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k. It can already take up to a year to check the correctness of a 8k lines of code microkernel and there will be an exponential demand for resources as the code size increases. So in reality it will not be possible to check the linux kernel for correctness.

      The tipical microkernel is _not_ just 10k. If you compare it to linux 2.6, then together with all the small programs needed to have the same functionality it'll be anything from 6 milion to 60 milion lines. It's just that most of it runs in user space, so it's not as critical. Doesn't mean the code doesn't have to be written, or that it won't have bugs, or that it'll be easier to deal with in real life. All it means is that a much lower portion of the 6-60 milion lines kernel will actually run as a kernel. A real benefit, obviously, but hardly 600 times reduction in size.

    20. Re:Distributed not that hard. by dbIII · · Score: 1
      The speed problem can often be solved just buy getting a faster hardware
      If you have faster hardware you want it to run fast. Some of us are in the situation where a processor upgrade or more memory can cut days off the calculation time on a problem that doesn't easily split onto a few more machines. Computers are not fast enough - and when they are we'll just give them more to do.
    21. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      However, you forget that these embedded systems are completely different from the Linux kernel. Their task is well defined and it must have 100% veracity. Your PC has no well defined task (unless its a TIVO) and getting it wrong has limited consequence.

    22. Re:Distributed not that hard. by diegocgteleline.es · · Score: 1

      Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k.

      Theorically you're right, but in practice a microkernel, because it's a microkernel will need separated processes to implement the thousand of drivers and the docens of architectures that Linux supports.

      In practice, a microkernel implementing what Linux implements today would take.....6 millions of lines of code, give or take a couple of lines. Quoting Linus, The fact that each individual piece is simple and secure does not make the aggregate either simple or secure

    23. Re:Distributed not that hard. by Mr+Z · · Score: 1

      Basically, what you're saying is that Parnas' calculus was only strong enough to determine if program X correctly produces the output expected by algorithm Y, without respect to the actual complexity. Is that correct? I'm curious: Does it prove that it actually implements algorithm Y, or just the same outputs as algorithm Y? For example, bubble sort and stabilized quicksort both produce the same sorted lists, but with very different different time complexity. OTOH, two different quicksort implementations might vary in execution cost due to quality of implementation, even if they go through all the same intermediate states.

      If it proves program X implements algorithm Y (and not just a result-quivalent fascimile), then you can make broad statements about run time, but to only slightly better granularity than O() notation. It doesn't sound strong enough to predict anything about the actual execution time of the program.

      Now, if you can analyze the algorithms involved in terms of "# of instances of each of these primitives" (where the primitives might be things like "read sensor", "compare string", "dereference structure pointer") such that you could write complexity equations for each algorithm that were more detailed than O(), you could then limit much of your analysis to measuring the costs of the primitives and then plugging-and-chugging on the complexity equations. Still not much fun.

      But, then, who said real-time programming when millions of lives are on the line was meant to be fun?

      --Joe
    24. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Go and design a better one.... M$ certainly hasn't

    25. Re:Distributed not that hard. by sydb · · Score: 1

      You're right, it is all about pushing blame further up the chain. In the real world, specs serve a dual purpose - an engineer will use one to try and build a better system. Then, when it turns out the system doesn't do what the customer wants, because the customer never really knows what they want otherwise they would design it themselves, it gives the engineer a stick to beat the customer with.

      The best thing would be if the customer and the engineer were the same person, but then they would have to be skilled and intelligent, so that won't happen...

      But this is off topic. oops!

      --
      Yours Sincerely, Michael.
    26. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      In real-time systems there is the fundamental principle that the correctness of a program does not only depend on its output but also on the instant in time when this output occurs, i.e. a program that delivers the right results too late is still not correct according to this definition.

    27. Re:Distributed not that hard. by checkup21 · · Score: 0

      OMFG!!!! You discovered the need of a realtime operating system!! That's worth a nobel price! That would be the least!

    28. Re:Distributed not that hard. by Jedi+Alec · · Score: 1

      while(a=1) { GiveMorphine(1); }

      sounds just fine to me, really :)

      --

      People replying to my sig annoy me. That's why I change it all the time.
    29. Re:Distributed not that hard. by Anonymous Coward · · Score: 0
      "The speed problem can often be solved just buy getting a faster hardware. "

      If only I could get my boss to sign off on this, for our thousands and thousands of units shipped.



      This is the thing that bothers me about CS. CS people tend to be complete idealogues with little concern for reality. You guys tend to believe in the ABSOLUTE CORRECT design, which is of course a complete and utter unicorn. There are few design decisions that aren't studies in tradeoffs, and if the tradeoff is a "less elegant" kernel for higher profit margins THAT STILL DOES THE JOB (faster kernel requiring less processing power, equals cheaper manufacturing cost), guess what? The supposed inferior monolithic kernel is going to win out every single time.

      I don't think this should be any big revelation for honest people. You should all know well that a search algorithm for example can be built for speed or size. The same is true for many other problems in programming. Which is the correct approach? The one that closely fits the bill for the job.

    30. Re:Distributed not that hard. by dastrike · · Score: 1

      The difference is that with a microkernel you have fault isolation. A bug in some driver (which is outside the kernel space with microkernels), can't bring down the kernel itself (as long as the microkernel is properly written), whereas any driver in a monolithic kernel can bring it down (as most drivers are in kernel space in monolithic kernels).

      So, given the line estimates brought up here now, with a microkernel you have about 10k lines of code that can possibly bring down the kernel, and ~6M lines of code that can't. But with a monolithic kernel you have 6M lines that potentially any of them could bring down the kernel.

      --
      while true; do eject; eject -t; done
    31. Re:Distributed not that hard. by ovit · · Score: 1

      You see, because he's talking about a mythical system that doesn't need any drivers...

      These guys are just shifting the problem out to user space...

          td

    32. Re:Distributed not that hard. by Citizen+of+Earth · · Score: 1

      Provably correct doesn't mean "good" .... and "I haven't bothered proving the sucker" doesn't mean crash and burn.

      So how do you prove that the proof is correct? Is the proof itself longer than the program?

    33. Re:Distributed not that hard. by artson · · Score: 1
      "Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k. It can already take up to a year to check the correctness of a 8k lines of code microkernel and there will be an exponential demand for resources as the code size increases. So in reality it will not be possible to check the linux kernel for correctness."

      Is there a way to get this done with a distributed processing system such as is used by SETI and other projects?

      This sort of project seems to be tailor made for the FOSS community - giving up some CPU time to prove our flagship is correct.

      I realize that Linux is a moving target, but we would need to start somewhere, then once proven, prove additions/amendments.

      --
      In times of trouble, the smell of frying onions usually gives confidence and comfort.
    34. Re:Distributed not that hard. by DragonWriter · · Score: 1

      The thing is, as I understand it, that with a microkernel, you can prove the correctness of each piece entirely independently. This isn't really a big boon the first time through, but it could be, in theory, a big difference in keeping it provably correct as you further develope the code.

    35. Re:Distributed not that hard. by Gorshkov · · Score: 1

      Basically, what you're saying is that Parnas' calculus was only strong enough to determine if program X correctly produces the output expected by algorithm Y, without respect to the actual complexity. Is that correct?

      No, actually, you're not. I don't think I made it quite clear, because Parnas' notation was not the main point in my original post.

      Parnas' notation dealt with proving that the *implimentation* was mathamatically correct, not the algorythm.

      Without re-creating his papers, this is basically how it worked:

      Each statement could be reduced to a mathamatical construct that was either true or false for each possible input. Each branching construct had it's own notation. To probe that an IF statement was correct, you would first prove the contents of each branch, and then apply the those results to the branch itself. If the true branch was proved correct, and the false branch was proved correct, then by proving that the IF statment would send control to the proper block for all possible inputs, you could prove that the IF statment was correct.

      You would do this for each routine, proving the invididual blocks of code.
      Then, given a description of all possible inputs for a given subroutine or function, you could prove that IT was correct, using the previous proofs as "black boxes", if you will.

      So you started at the bottom of the programme, rolling the statements up as you went along. Block is proven, branch is proven, routine is proven, and so on, reducing the expressions along the way. The final result of this particular project was a series of mathamatical statements that were a few pages total, that were deomonstrably mathamatically correct .... therefore, the programme was correct.

      That's a practical description of what he had, anyway - it was a long time, and I'm a programmer, not an computer scientist, so please, people, forget the lack of rigor. I'm just an old fart with a shitty memory :-)

      But, then, who said real-time programming when millions of lives are on the line was meant to be fun?

      Certainly not the #@(&$@$*#@ sadist that invented the IV&V, that's for sure :-)

    36. Re:Distributed not that hard. by Gorshkov · · Score: 1

      And I'm pretty sure that I'm aware of that. If you re-read my original post, you'll see that the point I was making is that T, like Parnas's notation, ignored on rather important requirement of an operating system - that it work reasonably efficiently. The overhead of the microkernel, according to to Linus (and with which I agree), means that the microkernel isn't generally suitable for a general purpose operating system. Yes, what I just said was a gross generalisation, and oversimplification, and I'm aware of that. But Linus point is well taken, I think, and absolutly correct.

      Where my example falls down is that T pooh-poohs performance considerations ("just give it faster hardware"), whereas Parnas never claimed that his notation was for anything other than a notation to prove PROGRAMME correctness, and made NO claims about establishing the SUITABILITY of a programme for any given task whatsoever, as far as I know.

      It's also interesting to note that T is still saying that all you have to do is throw faster hardware at it and the problem will go away ..... but you know what? He said the problem would go away back in 1992 when this first came up, when he was expecting 200 MIPS processors the next year ..... and the problem is still with us.

    37. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Just because the microkernel is much smaller what makes you think the other 5.5M lines don't have to be implimented still?

    38. Re:Distributed not that hard. by squisher · · Score: 1

      But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k.
      Umm, doesn't that mean while you've prooved that the 10k microkernel lines correct, you'd still have ~6 million lines of code sitting outside the microkernal waiting to be prooved? I can't see how a microkernel can magically do with 10k everything Linux is doing with 6 million lines (especially as by the definition of microkernel, than there's no way it could).
      Nope, it does not say that. There is a difference between userspace code and kernel code - userspace code runs with a seperate address space and if correct implemented cannot kill any other process or the kernel. So it does not have to be proven for correctness, probably a regular code analysis would suffice, IMHO.

    39. Re:Distributed not that hard. by Gorshkov · · Score: 3, Interesting

      The point I'm trying to make is that if the spec is wrong (or if you don't even have a spec) then your likelihood of producing a reliable and secure -- but complex -- system is practically nil. At least with a "provably correct" system, you know that if your spec is right, then your results will be right. If your system isn't provably correct, then your system will probably be still broken if your spec is wrong, but even if it's right, your implementation still might be broken.

      Case in point - again, from the same IV&V.

      The boys at Hydro had no idea wtf they were doing. They wern't incompotent by a long shot - they were very good, very bright, and very conscientious. But their background was basically analog design (all electrical engineers), and they wern't overly familiar with software - and it showed.

      When I was going over the spec and their timing measurements (the requirements were stated in the form of "maximum time from A to B shall be XXX milliseconds max" etc) on my initial perusal, I came across the statement that one particular sensor was required to react "in a reasonable period of time".

      I nearly shit my pants. We're talking about a reactor shutdown system here .... there was a lot of debate within the company I was working for as to how I would document my reaction to that statement and it's appearance in the spec. We finally settled on "I am unaware of any quantitative definition of 'reasonable'"

    40. Re:Distributed not that hard. by Gorshkov · · Score: 1

      So, given the line estimates brought up here now, with a microkernel you have about 10k lines of code that can possibly bring down the kernel, and ~6M lines of code that can't. But with a monolithic kernel you have 6M lines that potentially any of them could bring down the kernel.

      And why, pray tell, would you give a shit how pristine your kernel state was if the driver for your XXX Inc network card set the wrong register and seized the PCI bus?

      Kernel state is one thing, but it's not the ONLY thing. But a kernel isn't a normal application programme like a word processor, or a web browser. Even if Linus did factor linux down to a microkernel, it still wouldn't be any more (or less) reliable that the most unreliable device driver in the system.

    41. Re:Distributed not that hard. by Gorshkov · · Score: 1

      The same way you prove 1+1=2

      Yes, I know it could be 10 depending on the number base .... so don't go there :-)

    42. Re:Distributed not that hard. by chaim79 · · Score: 1
      The speed problem can often be solved just buy getting a faster hardware. The main reason Linus rejected microkernels back in the day was because the cost of context switches was prohibitive. Today hardware is lot faster (roughtly Moore's law), so context switches will be alright on a 3GHz Pentium IV machines while it would not be doable on a 33Mhz machines.

      It's interesting that most microkernel advocates admit that it was to slow for older hardware but that doesn't matter now that machines have gotten so fast, yet when any review is done on an OS one of the main criteria is speed doing a task. It's by no means the defining criteria but it is an important one, especially in the Server realm. Even with the proposed stability of a microkernel many server roles are better served by something that is simpler and faster.

      Where volume is concerned simplicity is better then anything else, many times I've had to sit down and work hard to optimize a recursive algorithm or an algorithm that is run thousands of times, even the smallest change that saves one or two compute cycles per run often saves 10 to 100 milliseconds when run N times on a full system. Several times I've seen "better" methods get tossed when they realize that it will not run quickly on production systems because the complexity can't handle the volume.

      --
      DEMETRIUS: Villain, what hast thou done?
      AARON: Villain, I have done thy mother.
      Shakespeare invents 'your mom'
    43. Re:Distributed not that hard. by GileadGreene · · Score: 1

      There are various notations and formal methods for reasoning about real-time systems. Off the top of my head, these include: Duration Calculus, Timed CSP, TCOZ, and TLA+. However, reasoning about execution time directly remains a difficult problem, and an area of active research.

    44. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Today most of the software that is used to fly planes (both fighter jets and passenger) is based on a microkernel architecture.

      No they aren't - they use multiple cpus with external message passing...

      or they use a single shared memory environment- ie. no MMU.

      But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k.

      Also inaccurate - The 10k code of the microkernel doesn't include filesystems, network, video drivers, audio drivers...

      The core Linux is nowhere near 6 million lines. It is only about 15k lines, and that includes all the POSIX user interface.

    45. Re:Distributed not that hard. by Gorshkov · · Score: 1

      An addendum of sorts - here is a link that will give you some more information regarding Dr Parnas. I just did a quick search for him on google - I haven't really thought about that project in *years*. And it was interested to see that the project I've been refering to is very near the top of his bio :-) http://www.cas.mcmaster.ca/sqrl/parnas.homepg.html

    46. Re:Distributed not that hard. by briansmith · · Score: 1

      I plugged the numbers into a programme I wrote for the purpose, and basically did nothing more than an exhaustive analysis of all possible combinations of timings.

      Did you use the program-prover on this program too?

    47. Re:Distributed not that hard. by Gorshkov · · Score: 1

      As a matter of fact, no - because the time domain wasn't an issue. But I did use Parnas' notation on it, just to prove it's correctness ..... it didn't matter how long it took to run.

    48. Re:Distributed not that hard. by Bluesman · · Score: 1

      The point is, proving correctness is possible in a microkernel, but next to impossible in a large monolithic kernel. It's a problem that increases exponentially, not linearly, with the amount of code you have to analyze.

      Every function added to a monolithic kernel could possibly alter the behavior of every other function, because they all share the same address space. This is not true of a microkernel.

      Once you've proved a microkernel is correct, you're done. You can then go on to prove that other small pieces of the system are correct. Because they all exist in separate address spaces, as long as a piece doesn't change, you can rest assured they will remain correct. But proving the correctness of a constantly changing 6 million lines of code is not feasible.

      --
      If moderation could change anything, it would be illegal.
    49. Re:Distributed not that hard. by g2devi · · Score: 1

      Also, how much of that 6 million lines are drivers (which is not included in the microkernel calculation)?

      I'm willing to bet that if you remove the drivers and modules from the Linux kernel that it's size will be on the order of 10k too.

    50. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Provably correct to what? I entreat you to define correct behavior for 6 million lines, or for that matter of 10K lines. Provably correct seems to imply not just code coverage, but all possible branches and permutations of data. This is a tall order for anything. This can't be done through static checking and requires dynamic checking.

    51. Re:Distributed not that hard. by tepples · · Score: 1

      These guys are just shifting the problem out to user space

      Where it should be, according to HURD developers and other microkernel advocates. Do you completely trust your hardware vendor to provide bullet-proof drivers? Don't you remember the VxDs and BSODs from Microsoft Windows 9x?

    52. Re:Distributed not that hard. by Alomex · · Score: 1

      But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k.

      You are parroting a meaningless comparison. This is like saying that a car has four wheels while typically the trunk has only one (the spare tire) hence the trunk is a more efficient car.

      A real life operating system when put together has over 30M lines of code, some of those are the true kernel-OS functions, some of them are the file system, some are the graphics system, some are the networking facilities.

      Microkernels are not smaller OSs, the are smaller code bases running in privileged mode and a larger code base running in unpriviliged mode.

    53. Re:Distributed not that hard. by einhverfr · · Score: 1

      The speed problem can often be solved just buy getting a faster hardware.

      The way most of these speed problems are solved in the real world is by having the computer do one thing only and do it well (flying a plane is one example). I suspect this is why Cray maintains a microkernel-based OS, as Crays are designed to do one thing at a time and do it fast.

      In essence, if you are only running one or two processes on top of the platform, microkernels make a lot of sense. I am not convinced that they scale to mainframe or server environments however, which may have to run hundreds or thousands of concurrent processes each with different kernel demands. In these cases, I am not sure you have a global complexity payoff.

      In a control program for a nuclear reactor, a microkernel is the obvious choice. None of the arguments for microkernels in Realtime OS's however have convinced me that it is the right choice for a large application server.

      --

      LedgerSMB: Open source Accounting/ERP
    54. Re:Distributed not that hard. by einhverfr · · Score: 1

      No they aren't - they use multiple cpus with external message passing...

      This is the ideal environment for a microkernel, BTW... This is the basic architecture of both the Cray and the Amiga, both of which either used to run or currently run microkernel OS's.

      --

      LedgerSMB: Open source Accounting/ERP
    55. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Both are wrong. You should use "if (1==a)" instead.

    56. Re:Distributed not that hard. by drgonzo59 · · Score: 1
      The assumption here is that the microkernel would mostly protect against a software logic error (aka bug) not faulty hardware. (note though some graphics drivers will protect and try to recover from some of the hardware flaws). So say, the computer in your car would not make your car driveable if all your oil has leaked out. Meaning that the hardware has to work correctly.

      Otherwise the main job of the microkernel is to enforce security policies, which means protect exactly against some driver "messing up things". So if there is a way for a driver to lock up the PCI bus by setting the wrong register then the microkernel should be the setting the registers. The way the drivers are written is totally diferent in the microkernel archicture. All the interrupts are processed by the microkernel, not immediatly by the drivers. Some slides about this: here

    57. Re:Distributed not that hard. by Gorshkov · · Score: 1

      So if there is a way for a driver to lock up the PCI bus by setting the wrong register then the microkernel should be the setting the registers. The way the drivers are written is totally diferent in the microkernel archicture. All the interrupts are processed by the microkernel, not immediatly by the drivers.

      I'm sorry, but that's just unworkable in practice - and a good example of one of the things Linus was trying to say.

      If it's a microkernel, by definition it should't concern itself with - nor does it have any way of knowing of - what the driver is or is not capable of doing.And as soon as you start worrying about *some* state, you have to worry about *all* state - just so you can maintain consistancy.

      And as soon as you have the kernel doing things like setting registers (and knowing what those settings mean, which it has to if it wants to protect from harm) ..... guess what? You've got a monolithic kernel - because now you just took 90% of the code from the device driver and moved it back INTO the kernel.

      What does a the driver for a network card do? It's sets the registers to initialise the card - it sets the registers to tell it to transfer data in - it sets the registers to tell it to transfer data out - it reads other registers to see what current state is .... etc, etc, etc

    58. Re:Distributed not that hard. by drgonzo59 · · Score: 1

      Yes, most of those 6M lines are drivers but they share the same address space as the whole kernel. So one cannot prove that the 10K lines of the kernel are correct and be done with it (as you would in a microkernel) because any one of those 6M lines could write or read anything in the kernel space during run-time. So a little known and tested mouse driver could freeze the system. You can only hope the system that just froze wasn't doing any mission critical tasks that would be responsible for human lives and such.

    59. Re:Distributed not that hard. by drgonzo59 · · Score: 1

      In case of the microkernel it would probably be a linear relationship. So, for example a mouse driver would have to do 30 context switches a second in a microkernel architecture and it won't have to do that in a regular Linux kernel. A context switch would linearly (not exponentially) increase the demand for resources. The bottom line is that microkernel s are already used in real-time OSes and other mission critical appliations, it is a work-able architecture and not just a lab toy. Obviously there is not horrible exponential increase in time or space requirements.

    60. Re:Distributed not that hard. by Arker · · Score: 1

      It can't. But the proven part can act as an overseer of the unproven part. That's what it means to be the kernel.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    61. Re:Distributed not that hard. by drgonzo59 · · Score: 1

      The important thing is that in the microkernel architecture the 10k microkernel lines of code will be in a separate address space. That is all that is needed. If those lines are mathematically provable correct, they they could take the system to a predetermined state in case of any of the drivers failing, it could reload the driver and try again or contact the admin and so on -- not freeze. When talking about the lines of code, we talk about the smaller chunk of code that can be verified that it works correctly. Yes, the most widely used microkernels today are around 10K lines. Even so it could take years to prove their correctness.

    62. Re:Distributed not that hard. by jelle · · Score: 1

      "Today hardware is lot faster (roughtly Moore's law), so context switches will be alright on a 3GHz Pentium IV machines while it would not be doable on a 33Mhz machines."

      You're assuming a certain load. Yes, if you use the 3GHz P4 to control the rudder sticks, then the context switch doesn't matter, but there are many loads that you can use that 3GHz P4 for where context switches do matter.

      "Theoretically you are right. But in practice Linux 2.6 is 6 million lines of code and a typical microkernel is less than 10k."

      Those 6M lines include all drivers. Add drivers to your microkernel and you'll end up around the same number of lines if not more. And if you need the drivers to work for the system to work, you'll have to prove their correctness too, all 6M lines of them. The microkernel is not going to fix that broken 'serial port' driver unless you've proven that stopping and reloading the 'serial port' driver at any possible time is correct (and likely, if the 'serial port' is connected to the rudder servo/motor, even 'just' reloading the driver may get you in serious trouble if it happens at the wrong time. And if you don't want the filesystem to corrupt the data because of a bug, a 'proven correct' kernel without also proving the filesystem driver is not going to guarantee you anything on that front besides misplaced, false hope.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    63. Re:Distributed not that hard. by kelnos · · Score: 1

      That's preposterous. You're assuming that the only type of error that will ever occur in a kernel driver is a catastrophic one. What if the driver just doesn't behave as it should?

      So say we have this nuclear reactor, and its control system uses a microkernel architecture. Let's say the hardware has these sensors for detecting if the reactor is overheating. Let's say the driver for these sensors is running in userspace (i.e., not inside the microkernel). Let's also say that the microkernel itself was proved to be correct, but the user-space portions (including this sensor driver) were not.

      So what happens when a certain input causes the sensor driver to report incorrect temperature values? Oh, right, you didn't prove the sensor driver's correctness, because for some reason it doesn't matter anymore. I'm sure the people living by the nuclear reactor won't mind the radiation. They'll think it's great that the failure wasn't because the control system crashed, and it's OK that the programmers didn't bother to verify that the system actually worked properly.

      --
      Xfce: Lighter than some, heavier than others. Just right.
    64. Re:Distributed not that hard. by jelle · · Score: 1

      "You don't have to prove it, as long as the microkernel will be able to put the system into a predetermined state,"

      Ok, so: A filesystem driver bug corrupts all data on disk. Try putting the system in a predetermined state other than 'useless'.

      Or: In the middle of talking with the UPS, the OS decides it needs to reload the serial port driver. Due to that reload, the signals output on the serial port, to the UPS are like morse code for 'turn yourself off'... How did that 'proven microkernel' prove stability of your system there?

      There are a billion fault cases like that that are simply ignored by the 'microkernel people'. Microkernels don't solve those, they just make it easier to ignore them and pretend they don't exist.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    65. Re:Distributed not that hard. by jelle · · Score: 1

      "because some idiot wrote if(a=1) instead of if(a==1)"

      btw, gcc outputs a compiler warning on that first if(), ergo the driver is actually 'proven incorrect' and even though 'proven correct' is so important to you, you still choose to use it?

      The 'proven correct' argument about microkernels is only of theoretical use.

      Building the habit of typing the constants to the left prevents a lot of those problems too.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    66. Re:Distributed not that hard. by jelle · · Score: 1

      "The point is, proving correctness is possible in a microkernel, but next to impossible in a large monolithic kernel. It's a problem that increases exponentially, not linearly, with the amount of code you have to analyze."

      So yes, you can prove correctness of the kernel after you take lots of functionality out of it to make it a 'microkernel'.

      But if you wish to prove correctness of your OS including the functionality that you took out of the kernel, you still have to prove correctness of the complete system including the lines of code now 'outside' of the kernel. And since you still have a lot complex interactions between those in and out-kernel parts, your effort for proving of correctness still grows exponentially including the lines of code now outside of the kernel. Inside or outside of the kernel does not make its interactions simpler. Actually, crossing the kernel boundary more often makes its interactions more complex, ergo more difficult to prove. Did you read Linus' post? He is pretty clear about that.

      "Every function added to a monolithic kernel could possibly alter the behavior of every other function, because they all share the same address space. This is not true of a microkernel."

      You really didn't read what Linus wrote, did you? Hint: 'access space'.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    67. Re:Distributed not that hard. by raduf · · Score: 1



          This would be most useful in a nuclear facility. In real-world aplications reloading the driver and trying again is not as easy as it seems. Considering all the interdepedencies between processes (one of which is considered corrupted) it would likely be equivalent to a warm reboot. So the 6+ milion lines of code would still be reloaded. But Linus is right (if i'm not too presumptious to say that :) because the issue isn't how it would run, but how it would be designed. It's simply too hard to write. For one thing, it would be an effort equivalent to creating the windows/linux kernel from scratch - think 10 years and 100 programmers. And it would be close to a nightmare to make, because now all the modules are completely separated and the comunication between them has to be taken care of in painstaking detail. Like Linus said (i think) it's very close to pretending you're paralelizing the whole kernel. And as we know, paralelism is 1. hard and 2. not aplicable to most algorithms/situations.

    68. Re:Distributed not that hard. by lederhosen · · Score: 1
      Umm, doesn't that mean while you've prooved that the 10k microkernel lines correct, you'd still have ~6 million lines of code sitting outside the microkernal waiting to be prooved? I can't see how a microkernel can magically do with 10k everything Linux is doing with 6 million lines (especially as by the definition of microkernel, than there's no way it could).
      No, let me explain. You prove that 10k of code is correct. The rest of the 6 million lines of code can be bad, if the network stack crashes, restart it, if the filesystem crashes restart it, it is that easy. If you look at it the other way around, why do you not add your office suite to the kernel? The reason is that you want isolation. That is the reason why we do not run DOS.
    69. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      if only idiots have written if (a=1) instead of if (a==1), could you please point out someone who hasn't been an idiot? If so, then I can show you someone who has never written a program in C.

    70. Re:Distributed not that hard. by starfishsystems · · Score: 1
      I forget his first name - but Parnas from Queen's University in Kingston

      David Lorge Parnas

      He was at Chapel Hill for quite some time also.

      --
      Parity: What to do when the weekend comes.
    71. Re:Distributed not that hard. by drgonzo59 · · Score: 1
      Yes I did prove the sensor driver's correctness at the same time I proved the microkernel's correctness. It took about 4 months to do it, but now it is done. The reason I could do it is because the sensor's driver is in a separate address space than the kernel driver. There an exponential relationship between the increase in the number of lines of code in a module and the ability to prove its correctness [see the SAT problem].

      Even if the sensor failed and its driver is un-usable, the microkernel _will_ keep the system in a pre-determined 'fail' state from which it start the alarm or activate the shutdown.

      Now let's see what happens if your reactor is controlled by Linux 2.6.15.11 and there is an off-by-one error in some serial driver used to communicate with the sensor. Over time the driver will overwrite some data structure and your _whole_ system is frozen. You are in Soviet Russia and you reactor design is an RBMK with a positive void coeficient. The system has actually frozen during your attempted shutdown, your boron/graphite control rods are stuck 1/3 way through while your actuators and everything is frozen because of the stupid off-by-one error in the serial driver. Of course you wanted to prove that the Linux 2.6.15.11 would behave correctly with all of its drivers but would take a longer time than the age of the universe, so now I am sure the people living by _your_ reactor won't mind the radiation.

      //sorry I could have said all this in just one sentence but was tempted by your example so I expanded on it ;)

    72. Re:Distributed not that hard. by Nutria · · Score: 1
      In case of the microkernel it would probably be a linear relationship.

      You blythely ignore my proof that solved just buy getting a faster hardware is invalid. Congratulations.

      The bottom line is that microkernel s are already used in real-time OSes and other mission critical appliations,

      These are rigidly-defined, almost always UP, systems where most of the grunt-work is controlled by the Ada run-time.

      it is a work-able architecture and not just a lab toy

      I remember QNX's first advertisements in the dearly departed /Compuler Language/ magazine, so I know full-well that ukernels are not lab toys. If you can find where I've written such, please point it out to me.

      Then show me that QNX can scale well from the low-end, where it does great, to ultra-high-end NUMA systems like SGI Altrix systems.

      Even comparable-to-Linux performance on a 4x Opteron would be extremely interesting to read.

      --
      "I don't know, therefore Aliens" Wafflebox1
    73. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Well, that does it! I am switching to a microkernel today, and tomorrow I will try to find some place that still sells pagers and service. That way, when my kernel has no working device drivers, it can just page me.

    74. Re:Distributed not that hard. by drgonzo59 · · Score: 1
      Add drivers to your microkernel and you'll end up around the same number of lines if not more.

      The argument wasn't that somehow a microkernel architecture will magically provide the same basic functionality with just 10K lines of code where Linux would need 6M. The point of the microkernel is that it compartmentalizes each driver and the kernel into their own address spaces with strictly enforced boundaries. In other words, if you have 6M lines of code and any of those lines could mess up the whole runtime address space of the other 6M lines -- it would be impossible to prove correctness (I am not arguing whether proving correctness is a good thing or not, it is done with mission critical systems so we'll assume it is necessary for now). The reason is because the possible state space that needs to be explored would increase exponentially with a number of lines of code. Just checking the correctness of a 8K lines of code microkernel could take months and months _BUT_ at the same time on a different computer you can check the correctness of the drivers in parallel it would still take about the same time if you have as many computers as you have drivers. This cannot be done when all the drivers share the same address space.

      The point here is that I don't really buy Linus' arguments against microkernels. I do understand that he will never change his mind, that would mean pretty much re-writing the kernel from scratch. It is like Microsoft tomorrow deciding that open sourcing Windows and giving it away for free would be a good idea -- just not going to happen.

    75. Re:Distributed not that hard. by Anonymous Coward · · Score: 0

      Probabily 90% of the ~6 million lines of code aren't necessary for your job.

    76. Re:Distributed not that hard. by jelle · · Score: 1

      "The point of the microkernel is that it compartmentalizes each driver and the kernel into their own address spaces with strictly enforced boundaries."

      I don't think you read what Linus posted.

      "_BUT_ at the same time on a different computer you can check the correctness of the drivers in parallel it would still take about the same time if you have as many computers as you have drivers."

      Nope, because in order to know the system is correct you have to look at the system, not just the parts. Not each perfectly fine (correct) tire will work on each perfectly fine (correct) car, even when they both use a perfectly fine (correct) mounting mechanism to communicate with each other.

      You're just theoretically thinking that it's better because you've found a paradigm that lets you ignore the important things. That's what a microkernel does, it makes you think you're doing it right.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
  24. Linus not that far for true... by Anonymous Coward · · Score: 3, Interesting

    Hi folks,

            I worked two years for a society that was developing its own micro-kernel system, for embedded targets. I was involved in system programing and adaptation of the whole compiler tools, based on GCC chain.
            Linus is right: basic problem is address space sharing, and if you want to implement memory protection, you rapidly falls into address space fragmentation problem.
            The main advantage of the system I worked on wasn't really its micro-kernel architecture, but the fact that its design allowed to suppress most of glue code that is needed between a C++ program and a more classic system.
            In my opinion, micro-kernel architecture has the same advantage and drawbacks that so-called "object-oriented" programing scheme : it is somewhat intellectually seducive for presentations but it is just a tool.
            It would certainly be intersting for Linux to provide the dynamic link management specificities of a micro-kernel system, for instance to allow someone to quickly modify IP stack for its own purpose, but should the whole system being design that way ? I am not sure.
            If you want to have an idea of the problem encountered with programing for these systems, one can look at the history of the AmigaOS, which have a design very close to a micro-kernel one.

    1. Re:Linus not that far for true... by Pflipp · · Score: 1

      If you want to have an idea of the problem encountered with programing for these systems, one can look at the history of the AmigaOS, which have a design very close to a micro-kernel one.

      The old 68000 had no memory manager and so you jumped right from your user program into fixed kernel address space (or you jumped wrongly and messed up the whole system). I would call this "macrokernel" if anything (there is no clear separation between user and kernel memory). The idea of a microkernel is that you use the memory manager even to secure parts of the kernel.

      --
      "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
    2. Re:Linus not that far for true... by Anonymous Coward · · Score: 0

      The idea of a microkernel is that you use the memory manager even to secure parts of the kernel. ... then you fall in address space fragmentation problem.

    3. Re:Linus not that far for true... by magetoo · · Score: 1
      AmigaOS is actually pretty microkernel-ish, so the comparison is not entirely useless.

      Moreover, just because the 68000 doesn't have an MMU doesn't mean you can't write a MK-based operating system for it. You just don't have the hardware support for strict separation. (and so you lose some advantages)

  25. This really wouldn't be an argument by Anonymous Coward · · Score: 2, Funny


    If the Linux kernel had have been coded using Forth.

    Just saying.

    1. Re:This really wouldn't be an argument by Vo0k · · Score: 1

      yup. no kernel - no argument.

      --
      Anagram("United States of America") == "Dine out, taste a Mac, fries"
    2. Re:This really wouldn't be an argument by PietjeJantje · · Score: 1

      OMG as a Windows freak I'd settle for the "monolithic" kernel, why settle for anything sounding smaller?
      This all sounds very interesting, when is Linux for Windows coming out and will I be able to patch it using Visual Basic? I'd like to add some cool skins and then submit it to the project.

    3. Re:This really wouldn't be an argument by Anonymous Coward · · Score: 0

      when is Linux for Windows coming out
      Ages ago.

  26. in other news by convolvatron · · Score: 3, Insightful

    abstraction and state isolation considered harmful

    1. Re:in other news by I+Like+Pudding · · Score: 1

      Nice troll. Kernel programming is not program programming. It is programming a program to run programs. The cost of additional complexity in a kernel is a couple orders of magnitude higher than your run of the mill php app. What is good for the goose is not necessarily good for the kernel.

    2. Re:in other news by julesh · · Score: 1

      The cost of additional complexity in a kernel is a couple orders of magnitude higher than your run of the mill php app.

      That's just not true in most realistic situations. When my PC is working flat out on a hard problem, it typically runs with ~2% CPU time in the kernel and about 98% in userspace. Even IO bound operations tend to only use about 4% kernel CPU time. Even if the kernel took twice as long to perform each operation I'd only lose another 4/96 = less than 5% performance overall. Whereas if I double the amount of processor time it takes php to run that PHP script (lets say I'm talking about MediaWiki, which can easily reach 100% CPU usage without needing very many users to hit it on my feeble server), then I see a noticeable degradation in performance, probably more like 30-40%.

      So you see putting the same efficiency loss in the kernel results in substantially less overall system performance loss, because the average computer spends much less time executing kernel code than user code. Obviously this isn't true for every system, and systems that are doing very kernel-usage-intensive operations (particularly memory thrashing during a process that forks many subprocesses, e.g. a memory intensive shell script, or passing large volumes of data through a non-shared-memory IPC mechanism) will be affected much more than user-mode-intensive operations (e.g. number crunching or data processing written in an interpreted programming language).

    3. Re:in other news by adamy · · Score: 2, Interesting

      Ah, but what you are missing is that your program only spends 4% in kernel space because of how well tuned the kernel is.

      We are curently doing some work on the sys_open function in hte linux kernel. When we screw it up, it takes so long for a machine to boot, it looks like it has frozen. This is because the loader often tries to find the correct location for a library via brute force: "OK, I'll try /lib/libmything.so. Nope, ok how about /ib/tls/libmything.so? Nope, ok..." If sys_open does not fail fast, the system does not find libraries in a timely manner, human sacrifice, dogs and cats living together, mass hysteria.

      It should only spend 4% in user kernel space, because the real work is to be done in user space, and kernel space is administrative overhead as far as your program is concerned. But the same is true of everyone's program. If there are 500 process on the system, and each spend 4% in Kernel space, a much greater speed up comes from optimizing the kernel space code than any one particular program. A 1% slowdown perprogram time 500 programs becomes a 500% slowdown in...wait, somewhere my math go weird. Anyway...

      The same goes for profiling and optimizing your own apps. Profile to find out where you are spending the most time, optimize those functions first. We know that the kernel code is going to get exercized heavily. So this is where we need to optimize.

      --
      Open Source Identity Management: FreeIPA.org
    4. Re:in other news by ClamIAm · · Score: 1

      Abstraction is harmful? Yeah, let's go back to coding in object code.

  27. Re:Linus Quote - "not arguing against it at all" by Hast · · Score: 4, Interesting
    assuming proper locking and in-kernel pre-emption, there's no problem - each process that executes the call enters kernel mode and starts executing the relevant kernel code immediately. If you have a multiprocessor machine, they could even be executing the calls simultaneously.

    That's a pretty big assumption. Or rather, you have basically taken all the hard parts of doing shared code and said "Let's hope someone else already solved this for us".

    The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up.

    Sooooo, it's easy to have someone else handle the multi-process bits in a monolithic design. But when it comes to writing services for microkernels suddenly everyone is an idiot?

    Besides, as Linus pointed out, when data is going one way microkernels are easy. And in the case of file systems that is really the case. Sure multiple processes can access it at once, but the time scale on handling the incoming signals is extremely fast compared to waiting for data from disk. Only a really, *really* incompetent idiot would write such a server which blocked until the read was finished.
  28. Re:Linus Quote - "not arguing against it at all" by Sique · · Score: 2, Interesting

    In the end it boils down to the old question centralisation vs. local autonomy. Centralisation is fine for keeping state, it is fine for enforcing a thoroughly similar approach to everything, it helps with 'single points of contact'. Local autonomy helps with less administrational effort, with clearly defined information paths and with clear responsibilities, thus with keeping problems locally.

    Both approaches have their merits, and in the real world you will never see a purely central organisation or a purely localized organisation. Every organisation is somehow swinging between both extrema, going more central at one point "to leverage synergies and increase efficiency", or is starting outsourcing and reorganizing itself into profit centers, to "overcome bureaucracy, to clearly define responsibilities and to cut down on administrational spending".

    The limits are given by the speed information is created, sent and decoded within the different organisational paths. An increase in Inter Process Communication speed will help with a more modularized microkernel approach, an increase in number and complexity of concurrent requests demands a more centralized kernel.

    In the end it boils down to the fact, that transactions have to be atomar operations, either being executed completely or rolled back completely if not finished. Centralized systems are inherently transactional, especially if they are executing tasks sequentially. The limit is given with the numbers of transactions that can be executed per time unit. Parallel execution demands operations to be as independent of each other as possible, thus increasing design efforts, but once the task is (nearly) interlock free, a modularized approach helps with faster, better maintenable code.

    --
    .sig: Sique *sigh*
  29. Entire comment by Futurepower(R) · · Score: 5, Insightful



    Name: Linus Torvalds (torvalds AT osdl.org) 5/9/06

    ___________________

    _Arthur (Arthur_ AT sympatico.ca) on 5/9/06 wrote:

    I found that distinction between microkernels and "monolithic" kernels useful: With microkernels, when you call a system service, a "message" is generated to be handled by the kernel *task*, to be dispatched to the proper handler (task). There is likely to be at least 2 levels of task-switching (and ring-level switching) in a microkernel call.

    ___________________


    I don't think you should focus on implementation details.

    For example, the task-switching could be basically hidden by hardware, and a "ukernel task switch" is not necessarily the same as a traditional task switch, because you may have things - hardware or software conventions - that basically might turn it into something that acts more like a normal subroutine call.

    To make a stupid analogy: a function call is certainly "more expensive" than a straight jump (because the function call implies the setup for returning, and the return itself). But you can optimize certain function calls into plain jumps - and it's such a common optimization that it has a name of its own ("tailcall conversion").

    In a similar manner, those task switches for the system call have very specific semantics, so it's possible to do them as less than "real" task-switches.

    So I wouldn't focus on them, since they aren't necessarily even the biggest performance problem of an ukernel.

    The real issue, and it's really fundamental, is the issue of sharing address spaces. Nothing else really matters. Everything else ends up flowing from that fundamental question: do you share the address space with the caller, or put in slightly different terms: can the callee look at and change the callers state as if it were its own (and the other way around)?

    Even for a monolithic kernel, the answer is a very emphatic no when you cross from user space into kernel space. Obviously the user space program cannot change kernel state, but it is equally true that the kernel cannot just consider user space to be equivalent to its own data structures (it might use the exact same physical instructions, but it cannot trust the user pointers, which means that in practice, they are totally different things from kernel pointers).

    That's another example of where "implementation" doesn't much matter, this time in the reverse sense. When a kernel accesses user space, the actual implementation of that - depending on hw concepts and implementation - may be exactly the same as when it accesses its own data structures: a normal "load" or "store". But despite that identical low-level implementation, there are high-level issues that radically differ.

    And that separation of "access space" is a really big deal. I say "access space", because it really is something conceptually different from "address space". The two parts may even "share" the address space (in a monolithic kernel they normally do), and that has huge advantages (no TLB issues etc), but there are issues that means that you end up having protection differences or simply semantic differences between the accesses.

    (Where one common example of "semantic" difference might be that one "access space" might take a page fault, while another one is guaranteed to be pinned down - this has some really huge issues for locking around the access, and for dead-lock avoidance etc etc).

    So in a traditional kernel, you usually would share the address space, but you'd have protection issues and some semantic differences that mean that the kernel and user space can't access each other freely. And that makes for some really big issues, but a traditional kernel very much tries to minimize them. And most importantly, a traditional kernel shares the access space across all the basic system calls, so that user/kernel difference is the only access space boundary.

    Now, the real problem with split acce

    1. Re:Entire comment by putaro · · Score: 1

      The real issue, and it's really fundamental, is the issue of sharing address spaces. Nothing else really matters. Everything else ends up flowing from that fundamental question: do you share the address space with the caller, or put in slightly different terms: can the callee look at and change the callers state as if it were its own (and the other way around)?
      This is a good insight.

      The fundamental result of access space separation is that you can't share data structures. That means that you can't share locking, it means that you must copy any shared data, and that in turn means that you have a much harder time handling coherency. All your algorithms basically end up being distributed algorithms.

      This is not a good insight.

      If you look at object-oriented programming, access control on data structures is a basic requirement. This does not turn every algorithm into distributed algorithms and it makes locking termendously easier, not harder (since each object does its own locking).

      The problem that one runs into in the hardware is that hardware level access control is not very fine grained and it can be pretty expensive to use it extensively. The hardware is optimized for the software that runs on it and vice versa, leaving us stuck in the ghetto of expensive memory management.

      If you look at something like the Java Virtual Machine, access control there is very fine-grained, objects can protect their data structures from each other and locking is very easy.

      Anybody who has ever done distributed programming should know by now that when one node goes down, often the rest comes down too. It's not always true (but neither is it always true that a crash in a kernel driver would bring the whole system down for a monolithic kernel), but it's true enough if there is any kind of mutual dependencies, and coherency issues.

      Failures happen in a lot of way. Sure, "I'm the disk driver and I can't talk to the disk anymore" is a failure that is hard to recover from. However, "I'm the audio driver and I just decided to randomly all over the buffer cache" is could be contained and the driver restarted and the worst you would get is glitchy audio, not corrupted data everywhere.

      I think Linus has been working inside the kernel too long. Time to look outside and learn about other things and bring those ideas back.

    2. Re:Entire comment by microbee · · Score: 1
      If you look at object-oriented programming, access control on data structures is a basic requirement. This does not turn every algorithm into distributed algorithms and it makes locking termendously easier, not harder (since each object does its own locking).

      Nice example, which shows you really don't understand the real meaning of monolithic vs microkernel.

      Take OOP as an example. You write a program which includes a lot of classes, and you compile and link. What do you get in the end? Surprise: one monolithic executable. Everything in the end runs inside one address space.

      Don't confuse run-time separation with interface separation. The latter is a language feature, not a system feature - you could still have a wild pointer and modify private members of any classes directly.

      Linux, despite being monolithic, has nice layers inside the kernel and clean interfaces too.

    3. Re:Entire comment by putaro · · Score: 4, Interesting

      Well, as someone who has been involved in the development of both monolithic and micro kernels, I suspect that I do know something about the subject.

      Linux, despite being monolithic, has nice layers inside the kernel and clean interfaces too.

      I think you missed Linus' point which I agreed with as well. The real thing you want out of a micro-kernel is memory protection between components of the kernel. The rest is just window dressing.

      Linux does *not* have that.

      Don't confuse run-time separation with interface separation. The latter is a language feature, not a system feature - you could still have a wild pointer and modify private members of any classes directly.

      Let's take a look at OOP and *what* your address spaces are doing for you. Now, in a language like C++, the internal structures of an object are only partially protected. As you say, you can go ahead and cast a pointer to an object to a char * and do anything you feel like to it. The memory protection between objects is not enforced fully.

      Now, if you look at Java or C#, the runtime is a virtual processor and it keeps you from violating the rules that an object defines on its data structure. The memory protection is *very* fine grained as it is on the field level rather than on the page level. You cannot (repeat cannot) go modifying the internal structures of objects if they are not marked as being accessible to you.

      Having spent 10 years as a kernel developer on a day-in, day-out basis, my frame of mind when I stopped doing OS development for a living was very C based. Since then I've spent a lot of time doing OO development and I think that I've broadened my horizons a bit.

      When you look at the way micro-kernels are usually conceptually designed, it's from a C/Unix mind set. Separation is done on a "server" basis and the servers export API's. As you try to add more functionality to the server its API starts getting bigger and bigger and uglier and uglier. For example, you might have a file system server. Locking a file would mean adding a call to the API to lock a file. If you try to make something like a "buffer cache server" which all of the file systems could share it's going to have a nasty API and be slow to boot or it won't be able to enforce memory protection well because the conceptual memory protection is being done on a process level.

      When you look at this from an OO perspective, what you see is that the objects being dealt with are "servers" and they are too large. They need to be decomposed into their functional pieces and additional objects exposed. A "buffer cache server" would hand out "buffer objects" which had a memory protection level, locks, etc. built in.

      Building a kernel that run inside of some protected runtime environment similar to the JVM would enable you to do this. If it were popular enough the features needed to make it really fast would get moved down into the hardware. As it is, I think that the speed of the kernel is kind of a red herring. In general the kernel needs to do fast I/O and fast switching between user tasks and for any other functions the speed probably doesn't matter much. When I was doing kernel development on supercomputers, most supercomputer kernels were single-threaded, even though the machines were multi-processor and things still ran pretty quickly. That's because most supercomputer apps spent very little time in the kernel. I believe this is true for most desktop apps as well. Business and "server" apps tend to spend more time in the kernel, but mostly because they are doing lots of small I/O's.

      Unfortunately there's not a lot of room for innovation in the OS arena so we may never see what could be done. That's one of the reasons why I got out of OS development.

    4. Re:Entire comment by Anonymous Coward · · Score: 0

      This is the most insightful post I've seen (of course, I say that because I agree with you). Check out Singularity OS for a VM-based OS. By adding some mild restrictions (e.g. no dynamic loading of code into a "process" once it's started) it can optimize more aggressively than a conventional JIT compiler. And, as you say, you get the benefits of memory protection for free. Their papers are worth a read.

    5. Re:Entire comment by IamTheRealMike · · Score: 1
      Chris Lattner (now working on LLVM for Apple) has written some interesting papers on proving memory safety of C/C++ code which satisfies some very minimal requirements. If I understand his work correctly, "Memory safety" in this instance means you can prove that the software doesn't manufacture pointers into the middle of an object and start messing around inside it. It allows you to give the same guarantees that the JVM would give with respect to pointer usage, but for C.

      If a kernel was scrubbed of unsafe constructs and then proven to be safe using these methods, would it be monolithic or microkernel? Arguably it would be neither. It would have some of the safety properties of the latter with the hardware properties of the former.

      Framing kernel design in terms of the monolithic/microkernel debate is silly. It closes peoples minds. The only reason we even have kernels is because of the design of CPU hardware security. If you look at Lisp machines for instance they had a very different design.

    6. Re:Entire comment by magetoo · · Score: 1
      Parent post is a straight cut-and-paste. +5 Insightful?

      Come on.

    7. Re:Entire comment by Alomex · · Score: 1

      Microkernels are much harder to write and maintain exactly because of this issue. You can do simple things easily - and in particular, you can do things where the information only passes in one direction quite easily, but anythign else is much much harder, because there is no "shared state" (by design).

      Andy Tanenbaum gave a talk on this and it was very clear that Minix3 is a typical toy operating system being developed and tested in academia, with no real insight of what is needed out there in the real world. Tanenbaum had his own version of "no one will ever need more than 640K" in claiming that no one will ever need more than 1GB of memory. I've seen that movie, starting with 640K, them 1MB when the EMM came out, then 16MB with the 386 then 2GB with the Pentium and on and on. Every time we rose up to the challenge and used all the memory, yet Andy is still at it, repeating the same platitudes.

    8. Re:Entire comment by Arandir · · Score: 1

      You raise some interesting points, but you fail to notice a really big one. In C++ and Java, messages are merely function calls. All your objects are running in the same address space.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    9. Re:Entire comment by putaro · · Score: 1

      That's the whole point! Actually, in Java, from the OS's point of view they're all running in the same address space. From the inside the language point of view, each field has its own little address space with access control on it. It's much finer grained than what the processor gives you and it runs a lot faster.

      One might recall that in Smalltalk, the granddaddy of object oriented programming languages, there are no function calls - they're called "messages".

    10. Re:Entire comment by ralatalo · · Score: 1

      > Now, if you look at Java or C#, the runtime is a virtual processor and it keeps you from violating the
      > rules that an object defines on its data structure. The memory protection is *very* fine grained as it
      > is on the field level rather than on the page level. You cannot (repeat cannot) go modifying the internal
      > structures of objects if they are not marked as being accessible to you.

            Oh, how blind you are.... most Java objects are serializable... so you could serialize the object and write it to a 'file' then manually manipulate the file and then bring it back...

            Where there is a will, there will be a way.

      ps. You could also write your own boot loader so that it 'removed' the class protection, and I would have to check if you could just pass any object to a native method which would allow you to muck with it that way as well.

    11. Re:Entire comment by KidSock · · Score: 1
      Now, if you look at Java or C#, ... You cannot (repeat cannot) go modifying the internal structures of objects if they are not marked as being accessible to you.

      That's two many cannots :-> All you have to do is write a little JNI call, do a libraryLoad and now you can touch anything you want.

    12. Re:Entire comment by putaro · · Score: 1

      The JVM doesn't have to support JNI or it could sandbox it away from you.

    13. Re:Entire comment by putaro · · Score: 1

      Depending on how your code is sandboxed it may not be able to do I/O.

      And if you're able to subsitute your own boot loader, why are you messing about with removing class protection? You've already subverted any security the system might have.

    14. Re:Entire comment by ralatalo · · Score: 1

      exactly.... The point is that Java gives you just as much as a loaded gun as C++... It might just have a stiffer trigger.

  30. Tanenbaum on microkernels by Anonymous+MadCoe · · Score: 4, Informative
  31. Your definition?? by Khyber · · Score: 1

    And what is your definition of a "Traditional Kernel?" If you wanna get really technical, start looking back at ENIAC and UNIVAC, from the '50s/60s.

    --
    Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    1. Re:Your definition?? by Schraegstrichpunkt · · Score: 1

      Quiet, heretic! We refuse to get all caught up in your technical mumbo-jumbo; We're here to defend the traditional definition of kernel... facts be damned!

    2. Re:Your definition?? by Anonymous Coward · · Score: 0

      Did we hear that traditional kernel values are under attack? Yes, now we finally have an issue for the elections this year! - The Republican party

  32. Re:Code talks -- but some code flies! by drgonzo59 · · Score: 1
    So then let me ask you this: Would you get on a plane that is flown by Linus' latest 2.6 monolithic kernel? Could it be because a bug in one of the hundreds of drivers might lock up the system and you'll crash and die?

    Most of the critical RT operating systems will have some kind of a ukernel architecture. velOSity is one such ukernel, it is used by the INTEGRITY OS made by Green Hills. The next time you fly on the plane it will probably be a ukernel that will make sure you land safely, not a monolithic blob that makes it impossible to mathematically prove security policies, which you would want in real important situations.

    Linus will obviously defend his architecture choice. I don't see him all of the sudden deciding that ukernels are in any way "better", it is like having Microsoft opening the source code for Windows.

    Back in the day the main argument was performance -- the cost of context switches. Today with machines that are probably 10x or 20x faster, context switches won't be such a big hit. So Linus had to come up with some other explanation -- "hard to code". The argument that there are no "real" OSes with microkernels today doesn't hold either.

    Linus is a pragmatist. He didn't write Linux for academic purpose. He wanted it to work. I don't know but an OS that flies thousands of people over the Atlantic every day without a crash is called a "working" OS in my book. And that OS is probably a ukernel.

  33. I would love to hear about an example by Paul+Crowley · · Score: 1

    IANAKH (I am not a kernel hacker)

    I'd love to hear some examples. It would be nice to see an example where something that's easy in a monolithic kernel is difficult in a microkernel. See, I imagine this bunch of distinct services all happily calling each other for what they need; I'd like to know more about how the need for complex distributed algorithms arises.

    1. Re:I would love to hear about an example by TobascoKid · · Score: 1

      See, I imagine this bunch of distinct services all happily calling each other for what they need; I'd like to know more about how the need for complex distributed algorithms arises.

      distinct services -> distributed

      happily calling each other -> complex algorithms

      --
      At some point, somewhere, the entire internet will be found to be illegal.
    2. Re:I would love to hear about an example by Paul+Crowley · · Score: 1

      Glad to know I'm not the only one in the dark :-) hopefully someone will be able to give an example that enlightens us both!

    3. Re:I would love to hear about an example by TobascoKid · · Score: 1

      hopefully someone will be able to give an example that enlightens us both!

      I doubt any are going to be forthcoming. From what I can work out, the argument going on now mostly boils down to how much you isolate drivers from the rest of the kernel. Expect to see lots of hot air and little code.

      My vague recollections from my OS course at uni (which was back when microkernels were the "in" thing and exciting) was that kernels don't do all that much, but what they do do is both critical and complex, with the main difference being that with monolithic kernels all the complex bits are lumped together into one giant process while with microkernels the complex bits get seperated into what can almost be described as seperate processes. The main benefit of microkernels was that they're supposed to be more portable as the hardware dependent bits could be isolated away and it's also supposed to make it easier to write most of the kernel in a (very) high level language (and that was supposed to make it both easier to write and add to the portability). The downside of microkernels was/is that since the complex parts are seperated out, all the communication between the parts takes longer and gets more complictated, in much the same was that it takes a programme longer to call an object through CORBA than if it was a compiled into the programme (and calling through CORBA is a more complicated call, but most programmer's are shielded from the call complexity).

      I think the security aspect of microkernels is a new angle.

      --
      At some point, somewhere, the entire internet will be found to be illegal.
    4. Re:I would love to hear about an example by mevets · · Score: 1

      Well, I remember a number of problems in trying to "be" posix using a microkernel architecture came from 'happens to' concepts in UNIX. 'Happens to' is the easiest way to explain controlling terminals, job control, etc. The way these mechanisms work, requires the Device, Process and FileDescriptor Services to be in intimate contact with each other. Not the end of the world, but a very complicated interaction. Since job control wasn't originally considered in the design, we could never really retrofit it in. Too much hidden or lost information.

      If we had one large "UNIX" process (ala MACH?), it would be simple, you just peek into the data structures of the necessary service; but running UNIX in user mode under a kernel isn't really much of an architectural shift, besides MERT did it in the 70s.

      Although not flashy, as a developer, the best part of a micro kernel was using the same machine for compiling and testing - device drivers, file systems and such. Occasionally you would muck up the machine and need a reboot, but rarely. Having your console driver unable to rewrite your page tables does have some advantages.

  34. Re:Just do it! by WindBourne · · Score: 1

    and yet, BEOS showed that C++ was blazing fast for a kernel.

    --
    I prefer the "u" in honour as it seems to be missing these days.
  35. Shared memory? by hackwrench · · Score: 1

    So how does giving each program its own memory space, but having chunks of memory mapped into multiple memory spaces fit into the scheme of things? I'm confused!

  36. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    "The fundamental result of access space separation is that you can't share data structures."

    That's not true. You can share parts of your address space if you want to. Of course the trouble is that if you share bits of your internal state in a writeable way, anyone who can modify it can also screw it up.

    "The whole 'microkernels are simpler' argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel, the traditional kernel wins. By a huge amount, too."

    This could also be due to a general difference of philosophy and not just the kernel style issue. Worse is better.

  37. I want a microkernel implementation by BumpyCarrot · · Score: 1

    But I also want the Loch Ness Monster to exist and assist me in my conquest of Mars.

    Quite simply, just look at HURD. Didn't they finish the initial work involved in porting to the L4 kernel before starting to pursue the Coyotos kernel?

    --
    Do you see what I did there?
    1. Re:I want a microkernel implementation by 10Ghz · · Score: 1

      They switched kernels AGAIN? First they worked on the Mach. then they decided that Mach is crap, and moved to L4 instead. And now they dropped L4 and moved to Coyotos.

      No wonder that they never get it finished, since every two years they seem to drop their current work, and move on to something "better".

      --
      Lesbian Nazi Hookers Abducted by UFOs and Forced Into Weight Loss Programs - -all next week on Town Talk.
    2. Re:I want a microkernel implementation by HidingMyName · · Score: 1

      I'm not sure if this is a contributing factor, but Liedtke (L4's chief architect) passed away a few years ago (I think in 2001). As far as I know Shapiro (Coyotos' chief architect) is very much alive and kicking.

  38. Re:Linus Quote - "not arguing against it at all" by exa · · Score: 3, Insightful

    Distributed algorithms are of course difficult to implement with a f***ed up language like C.

    Here, it seems, the means justify the ends. Linus basically says "I won't take any challenges".

    Linus tells me that we can never write a proper scalable OS for a NUMA machine, or a modular system that can serve well to parallel I/O systems and the like. I highly disagree.

    Because these things are not pipe dreams, they have been done. IBM guys have made amazingly abstract and modular OS stuff and they've been using them for years, so I think it's rather pathetic to say that there is only one true path to OS implementation. Why not admit that it is the only path that you have any experience in?

    --
    --exa--
  39. New definition of "microkernel" by Schraegstrichpunkt · · Score: 1

    I propose a new definition of "microkernel": If it's too big to fit in your CPU cache, or it has any sort of "network transparency" crap built into it, then it's monolithic kernel.

  40. Re:Linus Quote - "not arguing against it at all" by drgonzo59 · · Score: 2, Interesting
    The whole argument that microkernels are somehow "more secure" or "more stable" is also total crap. The fact that each individual piece is simple and secure does not make the aggregate either simple or secure."

    I know as a good and faithful /.-ers we should worship Linus and take all of his words as gospel, but in this case I think he is talking out of his arse. Microkernels are "more secure" and "more stable" because only one component needs to work well -- the microkernel, it's main job is to enforce security policies and that is it. If it works correctly it will be able to bring the system to a certain state during the failure of any of the other components.

    Microkernels are used and have been used for a long time in "real" and "serious" operating systems, not just toy examples. Everytime /.-ers fly over the Atlantic it is a microkernel OS in all probability that makes sure they don't crash and burn. The size of those microkernel is kept at no more than 10k lines -- and even so it can take years to prove its correctness. It would be impossible to do it with Linus's kernel. So if Linus and others are so against the microkernel acrhitectures I would want to see them trust their lives to a Linux 2.6 -- put their lives were their mouth (or code) is, so to speak.

  41. Re:Plane OS by hackwrench · · Score: 1

    I really don't know about the plane OS situation to say if I'd get on a plane flown by Linux, and the question is worded vaguely enough that I'd venture that I'd prefer a plane flown by human pilots over any OS, on account of the fact that I'm not sure that the A.I. is mature enough.

    And I figure that most people are in the same boat.

  42. OS shouldn't have distributed architecture by Anonymous Coward · · Score: 0

    I think the "microkernel vs monolithic" debate is a bit too close to implementation level. The real design question for me is whether an OS must have a deterministic behaviour or it can be allowed to have some uncertainty and side-effects (for example what happens if a service goes down). As Linus points out, in microkernel the desired effect is attained by combining the "simple parts". If you have dealt with distributed systems, you probably know that finding the suitable combination to create the desired results is a complex task and to make things even worse, the solution usually has some "unwanted emergent behaviour". In monolithic systems you can create control hierarchies to avoid such things, but in distributed system you have no good way of doing it.

    To sum it up, I feel that OS must have a complete deterministic behaviour and this is not achievable with distributed algorithms. It's fine to build distributed systems from these deterministic building blocks on application layer, but OS really is one level lower.

  43. Linus vs. Tanenbaum - "Linux is obsolete", Jan1992 by jsse · · Score: 2, Informative

    I don't want to repost this old debate that I believe every geeks should have read it; but since nobody post it yet. I repost it for anybody who haven't read about this famous debate between Linus and Prof. Tanenbaum on microkernel.

    Linus vs. Tanenbaum - "Linux is obsolete" Jan,1992

    (Save your mod point for someone who really need them thanks!)

  44. Re:Just do it! by Anonymous Coward · · Score: 0

    By writing it in C.

    The high-level libraries and system servers (Not the same as a micro-kernel server!) are written in C++ The kernel is not.

  45. Why the **** by Anonymous Coward · · Score: 0

    would I want a kernel thread to run each core? So they pass messages to each other instead of doing something useful?

    1. Re:Why the **** by Espen+Skoglund · · Score: 1

      Because -- depending on how you construct your system -- you don't want to do IPI based messaging to the CPU where the single kernel thread runs whenever you, e.g., get an exception or perform a system call on another CPU. Neither do you want to transfer your cache working set to that CPU.

  46. Re:Linus Quote - "not arguing against it at all" by drgonzo59 · · Score: 4, Insightful
    You seem to completely ignore the main reason for using a microkernel -- the ability to prove (even mathematically) that the kernel is correct. In other words the main advantage is not to make a it "easy" or "fun" for the programmers to program, or make Quake run with 25fps faster,but but to enforce a strict and precise security policy. That is why critical real-time OSes are often based on a microkernel which is only about 4000-8000 lines of code. Even at that size is might take years to prove it does what it is supposed to do.

    The analogy of centralisation vs. local autonomy is not totally accurate either. Both the monolithic and the microkernel are centralized, except that in the first case there a large beaurocratic structure and in the second case it just a dictator and a couple of "advisors". If the dictator or the king is chosen well, the system will be more predictable and will work much better. If case of the large beaurocratic system, if some of its members get corrupted [and they will because there are so many of them] the whole system will fail. It is like saying that a small bug in the mouse driver will freeze and crash the system with a monolithic kernel. Good thing if the system was only running Doom at the time and not controlling a reactor, or administering a drug. If the same happens in the microkernel system, the kernel will reload the driver, raise an alarm, or in general -- be able to take the system to a predictable predetermined state. Going back to the analogy is it is like having the dictator execute a corrupted staff member and replace him immediately.

  47. The real point: keep OS designers honest by jackjansen · · Score: 5, Insightful
    I think the real point here, which both Andy and Linus hint on but don't state explicitly (as far as I'm aware) is about keeping the OS designers and implementers honest. If you need an interface between two parts of the system you should design that interface, define it rigidly, then implement it.

    Andy likes microkernels because they force you to do that. Time spent on design leads to insight, which may well point to better and cleaner ways to do the task you originally set out to acomplish.

    Linus hates microkernels because they force you to do that. Time spent on design is time lost getting working code out the door, and working code will give you experience that will point to better and cleaner ways to do the task you originally set out to acomplish.

    1. Re:The real point: keep OS designers honest by diamondsw · · Score: 2, Insightful

      working code will give you experience that will point to better and cleaner ways to do the task you originally set out to acomplish.

      And working code will prevent you in most cases from ever revsiting the design.

      --
      I don't know what kind of crack I was on, but I suspect it was decaf.
    2. Re:The real point: keep OS designers honest by Chris_Mir · · Score: 1

      And working code will prevent you in most cases from ever revsiting the design.

      And why should you? If it ain't broken, don't fix it!

    3. Re:The real point: keep OS designers honest by UnknownSoldier · · Score: 1

      That's an interesting comment, of the Top-Down and Bottom-Up approach.

      Basicaly, Andy 'proved' this theory correct, by building an OS. (Top-Down)
      Linux learnt the theory, by doing the implementation. (Bottom-Up.)

      Theory ALWAYS comes after Experience/Expirementation. That is, if you couldn't observe it, how did you come up with the theory for it?!

    4. Re:The real point: keep OS designers honest by Anonymous Coward · · Score: 0

      Lots of theories led to later experimental confirmation. For example, consider the high energy physics experiments being run to prove/disprove the existence of certain hard-to-find particles.

      Not to mention that you're talking about computer science, which is not, strictly speaking, a science.

    5. Re:The real point: keep OS designers honest by UnknownSoldier · · Score: 1

      That's true, that the observe-theorize-experiment is a cycle and forms a feed-back look, but without first observing, what would you be theorizing?

      Any time we see that pattern, we have a "Science", because we can then formulate rules, on how to do things "better" -- where better may be faster, cheaper, more efficent, etc.

    6. Re:The real point: keep OS designers honest by tepples · · Score: 1

      And working code will prevent you in most cases from ever revsiting the design.

      So don't revsit; refactor.

  48. Re:Plane OS by Anonymous Coward · · Score: 0

    "I'd venture that I'd prefer a plane flown by human pilots over any OS, on account of the fact that I'm not sure that the A.I. is mature enough."

    And which do you think is flying the plane when you are coming in for a landing and the fog is so thick you can't see the ground?

  49. Re:Linus Quote - "not arguing against it at all" by putaro · · Score: 3, Insightful

    Individual pieces aren't really any simpler either. In fact, if you want your kernel to scale, to work well with lots of processes, you are going to run into a simple problem: multitasking.
    This is very true.

    Consider a filesystem driver in a monolithic kernel. If a dozen or so processes are all doing filesystem calls, then, assuming proper locking and in-kernel pre-emption, there's no problem - each process that executes the call enters kernel mode and starts executing the relevant kernel code immediately.

    OK, here's where things start getting a little tricky. The whole locking setup in a monolithic kernel is pretty tricky. Early multi-processor kernels often took the course of "one big lock" at the top of the call stack - essentially only one process could be executing in the kernel. Why? Because all that "proper locking" is tricky. Took years to get this working right. Of course it's done now in Linux so you can take advantage of it, but it wasn't easy.

    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer.

    OK, now here, you're kind of running off the rails. What is a "message"? There is no magical processor construct called a "message" - it's something that the OS provides. How messages are implemented can vary quite a bit. What you're thinking of is a messaging system ala sockets - that is the message would be placed onto a queue and then a process switch would happen sometime and the server on the other end would read messages out of the queue and do something. That's how microkernels are usually presented conceptually so it tends to get stuck in peoples' heads.

    However, messages can be implemented in other ways. For example, you could make a message be more like a procedure call - you create a new stack, swap your address table around, and then jump into the function in the "server". No need to instantiate threads in the "server" anymore than there is a need to instantiate threads within a monolithic kernel. The server would essentially share the thread of the caller. I've worked on microkernel architectures that were implemented just this way.

    If the number of data structures that you can directly access is smaller, the amount of locking that you have to take into account is smaller. Modularity and protection makes most people's tasks easier.

    Many of the arguments made for monolithic kernels are similar to the arguments you used to hear from Mac programmers who didn't want to admit that protected memory and multi-tasking were good things. Mac programmers liked to (as I used to say) "look in each other's underware". Programs rummaged about through system data structures and other apps data structures sometimes, changing things where they felt like it. This can be pretty fun sometimes and you can do some really spiffy things. However, set one byte the wrong way and the whole system comes crashing down.

  50. OT: Sig by nagora · · Score: 1
    Insinct is stronger than Upbringing - Irish Proverb

    Speaking as someone in Northern Ireland, I would suggest that the entire history of Ireland has demonstrated that proverb to be wrong.

    TWW

    --
    "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
    1. Re:OT: Sig by bariswheel · · Score: 1

      Very interesting. Perhaps I should remove the 'Irish' portion of that quote. I really like the quote, so this is why it's part of the my profile. Sorry if it offended you.

      --
      Insinct is stronger than Upbringing - Irish Proverb
    2. Re:OT: Sig by nagora · · Score: 1
      Sorry if it offended you.

      I wasn't offended; I just thought that if any country in the world shows that people learn fear and hatred from their upbringing, then it's Ireland.

      TWW

      --
      "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
    3. Re:OT: Sig by Anonymous Coward · · Score: 0

      You are assuming people are naturally good. I would suggest that the entire history of the world has demonstrated that assumption to be wrong.

    4. Re:OT: Sig by nagora · · Score: 1
      You are assuming people are naturally good.

      No, I am merely saying that they learn what to fear and hate from their culture.

      TWW

      --
      "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
    5. Re:OT: Sig by bariswheel · · Score: 1

      "No, I am merely saying that they learn what to fear and hate from their culture." righto.

      --
      Insinct is stronger than Upbringing - Irish Proverb
  51. The problem of sharing must be solved at CPU level by master_p · · Score: 4, Interesting

    The only way the monolithic vs microkernel debate will go away is if CPUs provide a better way of sharing resources between modules.

    One solution to the problem is to use memory maps. Right now each process has its own address space, and that creates lots of problems. It would have been much better if each module had its own memory map, ala virtual memory, so as that the degree of sharing was defined by the O/S. Two modules could then see each other as if they belong to the same address space, but other modules would be inaccessible. In other words, each module should have its own unique view of the memory.

    Of course the above is hard to implement, so there is another solution: the ring protection scheme of 80x86 should move down to paging level. Each page shall have its own ring number for read, write, and execute access. Code in page A could access code/data in page B only if the ring number of A is less than or equal to the ring number of B. That's a very easy to implement solution that would greatly enhance modularity of operating systems.

    A third solution is to provide implicit segmentation. Right now 80x86 has an explicit segmentation model that forces inter-segment addresses to be 48 bits wide on 32-bit machines (32 bits for the target address and 16 bits for the segment id). The implicit segmentation model is to use a 32-bit flat addressing mode but load the segment from a table indexed by the destination address, as it is done with virtual memory. Each segment shall have a base address and a limit, as it is right now. If a 32-bit address falls within the current segment, then the instruction is executed, otherwise a new segment is loaded from the address and a security check is performed. This is also a very easy to implement solution that would provide better modularization of code without the problems associated with monolithic kernels.

    There are various technical solutions that can be supported at CPU level that are not very complex and do not impose a big performance hit. These solutions must be adopted by CPU manufacturers if software is to be improved.

  52. Overhead is no longer the issue, security is! by Paul68 · · Score: 2, Interesting

    My carreer started in Operating System Research, this was circa 1993. Even in those days there were many people addressing the shared memory issue and coming up with good ways to share memory and address the context switch issue. However this took some overhead and did not make it to the mainstream because of that.

    Today the CPUs are much faster and even sacrificing 10%-20% of CPU power is not considered too much if it results in a system that is (more) stable and easier to maintain. e.g. a device driver can no longer bring down the entire system and a spyware program can no longer sniff all keys pressed...

    I must admit to have lost contact with that field of research but even the old results are promising, with today's CPU speeds.

    1. Re:Overhead is no longer the issue, security is! by Anonymous Coward · · Score: 0

      10-20% more transistor switching and fossile-fuel consumption to feed some bullshit academic?

      Why don't you write good code in the first place you lazy bum! At the end of the day *I* will decide what uses my CPU, not you.

    2. Re:Overhead is no longer the issue, security is! by magetoo · · Score: 1
      10-20% more transistor switching and fossile-fuel consumption to feed some bullshit academic?
      It's likely he means 10-20% overhead when the OS is running. As long as your program is running, and not calling the OS, there is 0% overhead.

      If your program needs to call the operating system, say, 5% of the time (for disk I/O or whatever), you will have 10-20% of 5%, or 0.5-1% of additional overhead. That can certainly be an acceptable tradeoff.

  53. Re:Plane OS by drgonzo59 · · Score: 1
    Today's pilots actually do very little and are there mostly to handle exceptional situations and for the peace of mind of passengers. Modern passenger planes can take off, fly and land without assistance. There isn't as much AI as you'd think. In other words there are no Neural Nets being trained to make the plane land. There are exact algorithms that do the jobs. The main help is from the radio signals that help determine where the landing strips are and help find the exact position of the plane. Surprisingly it is probably a lot easier to do the automated flying that would be to have automated driving in an arbitrary urban environment.

    So the question would still remain if you would get on a plane if someone tells you that it will be flown by Linux 2.6? I would personally trust my life to INTEGRITY-178B from Green Hills -- which does have a microkernel architecture, before I would trust my life to a huge monolithic blob of code such as the Linux kernel.

  54. Linux no longer is purely monolithic by Anonymous Coward · · Score: 0

    I am shocked that none of the crowed has even said one word about Linux not being a traditional monolithic kernel alltogether!
    Traditional monolithic kernels used to be quite synchronous whereas the application in the end carries each activity and kernel activity is only carried out via syscalls or interrupts.

    Now look at Linux which has become highly asynchronous, having kernel threads as means of activity on and for itself. There is a kthread for the journalled filesystem, for the kswapd, for the flushing of buffers, for soft-IRQs and so on. Which also means that SMP systems could execute application and kernel code on 2 seperate CPUs, completely decoupled and asynchronous - so the scaling argument FOR microkernels has effectively been killed by this design.

    Linux is only monolithic by sharing the access space for all kernel components.

    1. Re:Linux no longer is purely monolithic by Espen+Skoglund · · Score: 1
      Linux is only monolithic by sharing the access space for all kernel components.

      Which is basically the definition of a monolithic kernel. Whether the kernel is multi-threaded, etc., does not matter.

  55. Re:Linus Quote - "not arguing against it at all" by biffta · · Score: 1

    and even so it can take years to prove its correctness. It would be impossible to do it with Linus's kernel. I presume time or no formal spec but just out of interest why would it be impossible?

  56. Linus? by Anonymous Coward · · Score: 1, Funny

    Who the hell is Linus Torvalds and why should I care what he has to say about kernal programming? Does he even have a degree in computer science?

    1. Re:Linus? by MS-06FZ · · Score: 1

      I don't know, all I really know about the guy is how he pronounces "Leenoox".

      --
      ---GEC
      I'm but the humble pupil, seeking to snatch the scratchbuilt pebble from the master's fully articulated hand
  57. Re:Just do it! by putaro · · Score: 1

    And where do you spend most of your time executing in the BeOS kernel? The high-level libraries and the servers I would bet. The micro-kernel is probably implemented in C because C lets you get close to the hardware easier.

  58. Monoliths are eminently marketable by Frodo420024 · · Score: 2, Funny

    What's the problem with monoliths, that they are supposed to be less marketable? Ever since 1968, Monoliths have been doing great!

    --
    I'm in a Unix state of mind.
  59. Microkernel may just be a plainly bad concept by Anonymous Coward · · Score: 0

    I write distributed apps that perform message passing.

    Distribution is a horrendous model for an application that must share data often.

    Cache coherency is a good example of why -- as you add more independent machines the load they incurr keeping each other up to date can quickly overtake any performance benefit you gain by having several machines.

    This is why those high end scientific machines that require oft shared information across hundreds of machines use high speed (and expensive) machine interlinks.

    Even then, they are carefully crafted to keep the sharing to a minimum.

    Microkernels seem like a great idea in concept -- and I'm sure someone could pull it off. But they will almost certainly need to come up with some new paradigms and algorithms in the process.

    All that aside, the entire argument really has reached the point of "show me the code". It has been tried (and failed) a few times now -- time to stop talking about it and do it if it is so easily possible.

  60. Re:Linus Quote - "not arguing against it at all" by igb · · Score: 1
    However, messages can be implemented in other ways. For example, you could make a message be more like a procedure call - you create a new stack, swap your address table around, and then jump into the function in the "server".
    I _think_ this is how Andy Tucker's `doors' work in Solaris. They're used by, inter alia, syslogd and nscd to provide a fast, MT-safe message passing mechanism.

    But I'm willing to be corrected.

    ian

  61. A question by bufalo_1973 · · Score: 1

    First of all: I'm not a programmer.

    How bad/good would be if a process could "give" some space to other process? Let's say process A wants to share some data with process B. Process A sends a message to process B ("do you accept my data?"), process B answers ("yes"/"no"/["wait"]). If the answer is yes process A tells the kernel to give the data "ownage" to process B. The kernel changes the owner. Process A stores who gave its data. When process A wants its data back sents another message to process B ("can you give me back my data?").

    Can this work?

    1. Re:A question by SatanicPuppy · · Score: 1

      The cardinal rule is to avoid extra writes. Even in CPU cache memory, writes take up a decent amount of time.

      The reason monolithic kernels are faster is because they don't have any kind of overhead on that kind of memory manipulation. In a monolithic kernel, there is no process A or B...There is only process A1, A2, A3, and they're all dealing with the kernel. The kernel says, "Run, there's your data" and the process works on data that is already available.

      A good analogy would be an assembly line. In the monolithic assembly line, a worker is given the go-ahead, walks out, and does his job on a product that's sitting in the middle of a bunch of products that other workers are working on. There is no overhead, but there is a security risk...The worker may be malicious, and screw with everyone else's products.

      In the micro assembly line, the worker is given the go-ahead, he walks to his own room, and tells the guy there the number of the product that he's supposed to be working on. The guy goes and gets the product, and then the worker works on it. When the worker is done working on it, the product is put away. See, there is a whole extra level of management there, and extra read/write operations dealing with the memory (product) that the process (worker) is dealing with.

      It's more secure, sure, but the overhead is going to be deemed unacceptable by many applications. To be honest, I don't think microkernel is suitable for every application. It definitely has its place, but I don't think most users will care. I mean, half the linux servers I use are single function boxes with EXTREMELY tight access controls. If they get hacked, I rebuild 'em from the ground up. I'm not worried about kernel security half as much as I'm worried about performance.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:A question by asuffield · · Score: 1

      How bad/good would be if a process could "give" some space to other process?

      Firstly, I'll just point out that shared memory systems are about as old as unix (sysv shm is *still* used in linux apps today, despite being the crustyest thing since sliced bread), and all the unix platforms implement at least one such system, often several of them.

      It's 'good' in that it has uses. When you are dealing with huge amounts of data, it can be much faster than other IPC methods. One common use is the Xshm extension: your video player (xine) uses an shm mechanism to transfer the video frames to the X server, instead of the normal network socket, because it's much faster (but obviously, only works when the client and server applications are running on the same host).

      It's 'bad' in that in most cases, it's not useful. Anything other than one-way data transfer is extremely complicated because you have synchronisation issues between the processes involved - the same stuff that Torvalds was talking about. And for small amounts of data (probably in the vicinity of anything less than a few kb) it's slower than the more straightforward IPC systems, because the overheads of the system outweigh the time taken to copy the data. So most applications are better off using traditional pipes and sockets.

      So yes, it can work. Just like Torvalds was saying for the kernel, it has issues. So it is only useful in special circumstances.

    3. Re:A question by jadavis · · Score: 1

      Good idea, and that's close to what actually happens. Microkernels use extensive sharing among the pieces which are partof a traditional kernel (i.e. drivers, fs, etc.). As I understand it, the problem that Linus is referring to is that there are so many interactions that it requires so much sharing that it actually becomes more complex.

      I think a good analogy is if you are running a business. You can contract out to accomplish any business task you need to. Sometimes it's efficient: you can contract with a machine shop to machine a piece that's important for your product. But sometimes it's inefficient, also. For example, it could be a bad idea to outsource your secretary. You interact with your secretary so much that if she's at another office, she's not effective at all.

      So, there's a balance between sharing too much and not sharing enough. Linus thinks that balance is close to what we have right now in the most successful general-purpose operating systems (Linux, Windows, FreeBSD, ...). Microkernel developers are more academic, which is no surprise. Academics generally take things to their logical conclusion, and since there is no fundamental reason why a device driver needs to be in the kernel, the logical thing is to remove it. In practice, there are so many complex interactions that it becomes more complicated when the processes are more independent.

      Keep in mind that monolithic kernels also use sharing. Generally, when you fork() a process (turn one process into 2 processes), those processes logically each have their own address space. But the kernel does not copy all of the memory for that process, because that's wasteful. Instead, it usually copies only a small amount, and shares the rest. When one process writes, the data is no longer the same and can no longer be shared, so a copy is made at that point. That's called copy-on-write. There's also more direct sharing through explicitly shared memory, where you have to be careful to synchronize the access.

      There is a lot of sharing going on in either a micro or monolithic kernel.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
  62. Re:Plane OS by hackwrench · · Score: 1

    I would have guessed the pilots relying on sensors that tell them where important points of reference are.

  63. Re:Linus Quote - "not arguing against it at all" by drgonzo59 · · Score: 1
    For a 10k lines microkernel it takes up to a year to prove its correctness. (specifically covert channel analysis -- see this paper for more on CCA).

    Linux 2.6 has 6 million lines of code. Even assuming a linear increase (in reality it is exponential) it would take at least 600 years on the current hardware. If the time demands are exponential, you can forget it altogether

  64. Re:Trust (was Re:Plane OS) by hackwrench · · Score: 1

    I don't place my trust in such things. If God wants me to do it, I do it...Physical 'reality' merely the stage for his will against the corruption he placed this world into.

  65. Is it a tradeoff issue? by VincenzoRomano · · Score: 1

    Whether monolithic or microkernel, what it is expected from an OS is to manage resources, implement basic services et cetera in an effective and efficient way.
    I think that the number of lines of code in either design direction tend to be almost the same, unless some code refactoring.
    Also the number of "services" done by the OS tend to be the same.
    Ease of maintenance, robustness, efficiency and so on are problems that should be faced in both cases with an overall need for resources that should be the same in both cases.
    So, instead of debating, I'd do some real world tests, instrumentation and profiling in order to find out a reasonable solution. Being it shared memory or copy buffer, it really doesnt' matter.
    Real effectivenes and afficiency do.
    Prof. Tanenbaum and Dr. Torvalds (as well as a number of other people at their same level) have shown their deep knowledge in this area. A real advance in OS technology would be a constructive debate after the real world data analysis.

    So the final question is: why not?

    P.S. The referenced web site is still hot and smoking!

    --
    Maybe Computers will never be as intelligent as Humans.
    For sure they won't ever become so stupid. [VR-1988]
    1. Re:Is it a tradeoff issue? by Anonymous Coward · · Score: 0

      Sorry, no Ph.D for Linus. Can't call him Dr.

    2. Re:Is it a tradeoff issue? by VincenzoRomano · · Score: 1

      Doctor means "those who can teach". And he can.
      In any case, I'm not American. And here you're doctor in computer science once you get a degree in a computer science university.
      Nonetheless, thanks for the precision.

      --
      Maybe Computers will never be as intelligent as Humans.
      For sure they won't ever become so stupid. [VR-1988]
    3. Re:Is it a tradeoff issue? by magetoo · · Score: 1
      Sorry, no Ph.D for Linus. Can't call him Dr.
      Well, he holds at least a honorific title from Stockholm University, if that counts.

      (And the Royal Institute of Technology did the same to Gates...)

  66. Re:Linus Quote - "not arguing against it at all" by mrogers · · Score: 1
    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer.

    Perhaps the best way to implement a microkernel is not to move as much as possible into userspace processes, but to move as much as possible into userspace libraries? A library call is synchronous, just like a system call, so writing a reentrant function for a library shouldn't be any harder than writing a reentrant function for a kernel.

    The server could be multi-threaded, for example. But how many threads should it spawn ? And how much system resources are they going to waste ? A monolithic kernel has none of these problems.

    A library has none of these problems either.

    Of course you'd have to protect the library's state from the caller, which would involve a partial context switch when calling one of the library's functions - the 'call gate' would be one of the services provided by the microkernel. The protected library would have access to the caller's state, however, so it would be possible to pass a pointer to a data structure and have it filled in, for example, just like a normal library or monolithic kernel. A protected library call needn't be as expensive as an interprocess context switch, even for architectures without segment registers, because you'd only need to flush the TLB on the way out of the library call, not on the way in.

    Anyway, that's enough armchair OS design for one morning... ;-)

  67. Has been. by Anonymous Coward · · Score: 0

    Motorola's 68020 contained a "CALLM" command, call module, which was used for isolation of modules at a sub-MMU level.

    Nobody ever used it, so it was discontinued in later processors.

  68. Re:Code talks -- but some code flies! by shimavak · · Score: 1
    I don't know but an OS that flies thousands of people over the Atlantic every day without a crash is called a "working" OS in my book.


    But can I check my email and access the Internet Explorer?
    --
    "[Physics] has nothing to do directly with defending our country, except to make it worth defending." -- Robert Wilson
  69. Re:Linus Quote - "not arguing against it at all" by shmlco · · Score: 1

    "..,but but to enforce a strict and precise security policy."

    Precisely. All the arguments to date focus on performance issues, whereas with today's high-performance multi-core machines I'd be more than happy to lose a bit of performance if it means processes and systems have better isolation and protection from one another.

    Gaining a couple of extra FPS's in Quake doesn't do much good if the entire system is down with a virus...

    --
    Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
  70. Why not use huge address spaces 64bit maybe 128bit by anandsr · · Score: 1

    I think a way to share data structures between multiple processes would be to allocate identical virtual addresses which could be determined by the processes themselves. Basically you would want to be able to allocate memory on user provided memory addresses, and then share it within the tasks that needs these addresses.
    It could be implemented using a permission based scheme. Say you have 64 bit addresses. So you split it into 4 parts. One part of which must only be used for sharing addresses. You have a 30bit process ID, for each process a 32 bit address is provided. This address space can be used by other processes if they don't need to share the same address space transparently. In this case you can use pointers etc transparently. I know it still not as easy as working from the same address space. But you can work around the problem somewhat.

  71. It can work, just slowly by Anonymous Coward · · Score: 0

    You can play MMU tricks, but for small amounts of data, it's faster to just copy. MMU operations don't have the same deeply-pipelined, out-of-order, multiple-instructions-per-cycle infrastructure that ALU operations and load/stores get. So on modern processors, the "small" data threshold below which it's cheaper to copy is more than 4096 bytes!

    This, and similar other tricks, can certainly be done, but they're slower than copying.

    1. Re:It can work, just slowly by bufalo_1973 · · Score: 1

      Then something like process A telling the kernel to pass some memory block to process B and the kernel deciding what is better/faster, copying the block or changing the owner, should be better, isn't it?

  72. Re:Code talks -- but some code flies! by fishfinger · · Score: 1
    Wow, talk about sensationalising something!

    Firstly, you are talking about two different scenarios, a plane, which is essentially an embedded system, and general purpose computing.

    If (big if) Linux was used on a plane it would be a very different beast from what it is on your desktop.

    For starters, a plane would not need 99% of the drivers that are included with the current 2.6 kernel.

    Any drivers required for the plane would probably be custom written, as the hardware would not be your usual consumer level stuff, and therefore written to the appropriate coding standards for airbourne software.

    Also the core of the Linux kernel would also have to be certified to airboure software standards (DO-178B), so to answer the question of 'Would you get on a plane that is flown by Linus' latest 2.6 monolithic kernel?' my answer would be only if it is certified to DO-178B.

    The likelyhood of this being done is extremely remote in my opinion, so this is all speculation.

  73. Java and microkernels by mangu · · Score: 3, Insightful
    That's what the Java folks have foisting on us all along.


    That's interesting because those are exactly my thoughts every time I hear the arguments people use to defend microkernels: Java is to microkernels as C/C++ is to monolithic kernels.


    Linus Torvalds summed it well when he mentioned that microkernels are simpler only when data flow goes in one direction only. It's very hard to get a function to fill a complicated data structure for you if you cannot work with pointers. Passing a reference will do only for simple structures, it will not work if there are structures within structures, it is very hard to do if the called function must itself pass some subset of that structure to another function. And for operating systems where one must contend with multiple access and locking, it's almost impossible to do without a performance penalty.


    Let's face it: pointer manipulation is necessary because there are real life problems that are more complex than textbook examples. If there weren't, inventing the C language wouldn't have been necessary, we could have stuck with Fortran all along.

    1. Re:Java and microkernels by LarsWestergren · · Score: 1

      Let's face it: pointer manipulation is necessary because there are real life problems that are more complex than textbook examples. If there weren't, inventing the C language wouldn't have been necessary, we could have stuck with Fortran all along.

      What? Not having pointer manipulation makes complex and fast systems impossible, when you have multiple access and locking? Interesting, I have to tell the programmer I recently talked to at OMX Group who told me they use Java for all their new systems (some older ones are written in RPG). Their software runs, among others, the Singapore Exchange and the Stockholm exchange.

      Or the people I work with who did the Swedish online tax systems. Or the people at this years Java one who talks about doing the French online tax system. Or the guy from eBay... etc etc.

      --

      Being bitter is drinking poison and hoping someone else will die

    2. Re:Java and microkernels by mangu · · Score: 1
      Their software runs, among others, the Singapore Exchange and the Stockholm exchange.


      Java runs fine when the typical access time of your system is orders of magnitude above the CPU speed. Your stockbrokers need to get quotations on a timescale of a few seconds to a few minutes, the machines where the system runs have clock speeds in the Gigaherz range.


      In this case, as in the online tax systems you mention, it's OK for the system to lock a transaction while a few billion machine instructions run on another thread doing the Java overhead. That definitely is *not* the case in an operating system kernel.

  74. Re:Code talks -- but some code flies! by drgonzo59 · · Score: 1

    Ok, so then I'll ask, "what are the chances that linux will be DO-178B certified?" And I'll make it easy and answer it for you too -- "Very close to 0."

  75. Re:Linus Quote - "not arguing against it at all" by PhotoGuy · · Score: 3, Insightful
    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up.

    Well maybe that's how *you* would design *your* Microkernel. And yes, it would suck.

    The way I would design the filesystem driver, would be to accept a request, add it to a queue of pending requests to serve. If there are no initiated requests, find the request that can most efficiently be served based upon your preferred policy (closest seek time, for example, or first come first serve, your choice), and initiate that request. Add some smarts for multiple devices, so multiple requests can be initiated at the same time to different devices. When data comes back, answer the requesting process with their data. Rather than sitting around blocking on a request, go grab more requests from other processes and queue them up. No need to block. When an initiated request comes back, send back the data to the requesting process, and everyone's happy. Just because things are separated out into different processes, doesn't mean that they can't do some asynchronous juggling to be efficient. Add multi-threading, and the coding becomes a bit easier; but multi-threading isn't necessary to rely upon to have this work well.

    I'm pretty sure the monolithic kernels do things somewhat similarly; build a request queue, service that queue. They could also block until they're done other requests, but that would be bad design. Don't assume a Microkernel Filesystem server has to suffer from similarly bad design.

    --
    Love many, trust a few, do harm to none.
  76. Re:Code talks -- but some code flies! by fishfinger · · Score: 1
    I already said that, see my original post "The likelyhood of this being done is extremely remote in my opinion, so this is all speculation".

    Try reading the whole post first!

  77. Re:Linus Quote - "not arguing against it at all" by MOBE2001 · · Score: 1

    Individual pieces aren't really any simpler either. In fact, if you want your kernel to scale, to work well with lots of processes, you are going to run into a simple problem: multitasking.

    This is true but only because threads are asynchronous. Linus and other OS writers may know Linux and Unix but they don't understand the hidden nature of software. If they did, they would know that basing software construction on the algorithm is the real reason for the current crisis. Switch to a signal-based, synchronous software model and the problem would disappear. Of course, in such an environment, every application becomes a simple extension of the system and there is no operating system per se.

    We need to start seeing a program for what it really is, a communication system. During execution, every statement or instruction in an algorithmic procedure essentially sends a signal to the next statement, saying: 'I'm done, now it's your turn.' A statement should be seen as an elementary object having a single input and a single output. It waits for an input signal, does something, and then sends an output signal to the next object. Multiple objects are linked together to form a one-dimensional (single path) sequential chain. The problem is that, in an algorithm, communication is limited to only two objects at a time, a sender and a receiver. Consequently, even though there may be forks (conditional branches) along the way, a signal may only take one path at a time.

    This is one of the main reasons that we need to move to a signal-based, synchronous software model. Monolithic or not, we have all missed the software boat. And we've been missing the boat for a long time, for more than 150 years in fact, ever since Lady Ada wrote the first table of instructions (i.e., algorithm) for Babbage's analytical engine. It's time to do it right and it's never too late to change.

  78. it's just not that complicated by penguin-collective · · Score: 2, Interesting

    Microkernels like Mach have been unsuccessful because putting everything into separate address spaces makes a lot of things quite difficult.

    C-based monolithic kernels like Linux and UNIX run into software engineering problems--it gets harder and harder to ensure stability and robustness as the code mushrooms because there is no fault isolation.

    The solution? Simple: get the best of both worlds through language-supported fault isolation (this can even be a pure compile-time mechanism, with no runtime overhead). It's not rocket science, it's been done many times before. You get all the fault isolation of microkernels and still everything can access anything else when it needs to, as long as the programmer just states what he is doing clearly.

    C-based monolithic kernels were a detour caused by the UNIX operating system, an accident of history. UNIX has contributed enormously to information technology, but its choice of C as the programming language has been more a curse than a blessing.

    1. Re:it's just not that complicated by Anonymous Coward · · Score: 0
      UNIX has contributed enormously to information technology, but its choice of C as the programming language has been more a curse than a blessing.

      FORTRAN would have been so much better...

    2. Re:it's just not that complicated by jilles · · Score: 1

      This is the first comment in this thread to contribute something sensible. It is my personal opinion (based on observations in practice) that C based systems hit a hard ceiling in terms of managability around 3-5 million lines of code. Above that nobody can be found with a good enough mental map of the system to engineer it properly. This is not a hard limit, there's several ways to stretch it a bit. None of these ways involve technology: they are about process, discipline and engineering practice. With that in place (expensive) you can grow a few million lines of code more. Currently the largests systems around are around 100 million lines of code. These are complex beasts requiring the constant attention of thousands of software engineers. They take years to release and are only allowed to continue to exist because replacing them effectively is killing the company.

      The C language provides so many vectors of severe stability and security issues that just isn't funny. Most of these technical issues have well working, tested and proven solutions in other programming languages. Shared memory space is only a problem if the compiler/run-time environment allows you to abuse it. Many programming environments exist that allow you to safely share data. Doing that from multiple threads is quite safe as well provided you understand what you are doing. Most problems in that area are related not to memory corruption but deadlock, race conditions, etc.

      It's of course a non issue entirely in most scripting languages or virtual machine based languages. But statically compiled languages with similar performance characteristics to C exist as well. So I agree, C was an expensive mistake. Each crash/bsod/security leak/kernel panic/whatever, we pay the price.

      --

      Jilles
    3. Re:it's just not that complicated by Anonymous Coward · · Score: 0

      Strange as that may seem for a youngster like you, in the 1970's and 1980's, the choices weren't limited to FORTRAN and C. There were plenty of languages that were far better than C, and people were fully aware of that. On the systems side, Cedar, Mesa, Pascal derivatives, ObjectPascal and Modula did not only exist, but were used for high quality kernel implementations. In 1967, you could already get Simula-67, an object oriented, statically compiled language. Languages like Lisp and Smalltalk, developed in the 60's and 70's, still beat Java hands down today.

      No, there is no simple excuse for C: people ought to have known better at the time, and many did. It won because it came with UNIX and as shipped to lots of universities, while most everything else was proprietary and expensive.

    4. Re:it's just not that complicated by Arandir · · Score: 1

      When you're programming at the lowest level, that of the kernel, you need a low level language. Kernels fiddle, juggle, and mangle, and memory as part of their job, so you're going to need a language that has pointers. Strike one. You're going to need a language that can interface cleanly with even lower level assembly. Strike two. And because kernels are obessively detailed oriented, you're going to need a language that doesn't abstract away those details. Strike three. C wins. You can use C++ if you wish, or even Objective C, but you will need C or something very like C.

      I'll eat my words, without catsup, when you can manage to show me a running usable kernel (for a reasonably traditional CPU) in a high level language like Python (that isn't itself running atop a C-based subkernel).

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    5. Re:it's just not that complicated by Anonymous Coward · · Score: 0

      At one point no-one thought you could write an operating system in C (and the kernel was the OS, and they saw that it was all in assembly, and it was good).

      If a language is a language (if it is Turing-complete) then you can write an OS with it. It's silly, but you can.

    6. Re:it's just not that complicated by penguin-collective · · Score: 1

      I'll eat my words, without catsup, when you can manage to show me a running usable kernel (for a reasonably traditional CPU) in a high level language

      Apple Lisa (ObjectPascal), Alto (Cedar/Mesa), Lisp Machine (Lisp), Ceres workstation (Oberon), SPIN (Modula-3), embedded systems (Ada, Modula-2), to name just a few. There are dozens more if you only care to look around.

      C is no more low-level than those other languages (you can do in all of them what you can do in C).

      C isn't a low level language, it's just an unnecessarily badly designed high level language.

    7. Re:it's just not that complicated by Arandir · · Score: 1

      The languages you cite, except for Lisp, are also low level languages (as compared to Python, for example). Lisp is a special case, and requires a special machine. You can't write a Lisp kernel on an x86, for example.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    8. Re:it's just not that complicated by Arandir · · Score: 1

      If a language is a language (if it is Turing-complete) then you can write an OS with it. It's silly, but you can.

      Only if it gives you the ability to directly access the hardware. In other words, you need those evil pointer things.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    9. Re:it's just not that complicated by penguin-collective · · Score: 1

      The languages you cite, except for Lisp, are also low level languages

      Well, good, so you recognize the existence of other "low level languages" suitable for writing kernels.

      Now, what's your point? I'm not arguing that kernels should be written in some particular language "level", I'm arguing that specifically the C programming language is a bad language to write kernels in. Writing a kernel in Modula-2, ObjectPascal, or Oberon avoids many of the problems that writing a kernel in C has.

      (You're wrong on both Lisp and Python. One can write a kernel for x86 in Lisp--I have done it, and Python's problem isn't that it's "high level", whatever that may mean, but that it's designed as a scripting language and can't be compiled well.)

  79. Re:Plane OS by petermgreen · · Score: 1

    I'd imagine one big reason for having pilots is in case you are forced to divert to somewhere that doesn't have the infrastructure for an automated landing.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  80. Linus is an expert only on monolithic kernels by Anonymous Coward · · Score: 0

    On microkernels, he's merely hand-waving like the rest of us.

  81. Provably Correct by Anonymous Coward · · Score: 0

    The three US-based embedded real-time operating system vendors are all pursuing Common Citeria Certification at an EAL6+ level. To find more information on this, google the term MILS (Multiple Independent Levels of Security). The NSA, who is the only entity authorized to review the Development artifacts for US certifications at this level, has offered guidance: in order for a kernel to be evaluatable it should be in the nieghborbhood of 6000 lines of source code.

  82. Performance issues by mangu · · Score: 1
    If you look at something like the Java Virtual Machine, access control there is very fine-grained, objects can protect their data structures from each other and locking is very easy.


    The problem is that inside a computer there aren't any "objects", only data. That's why, when you want the ultimate performance needed by an OS, plain old C will beat a purely object oriented approach.


    The main issue raised by Torvalds is, how do you pass information among the different entities in a system? You either pass an address or you copy the data. It doesn't matter what that information is, it can be a simple string of characters or it can be a very complex object, in the end all becomes an array of bytes. Do you copy those bytes or do you send a pointer?


  83. Re:Linus Quote - "not arguing against it at all" by elgaard · · Score: 1

    >Precisely. All the arguments to date focus on performance issues, whereas with today's
    >high-performance multi-core machines I'd be more than happy to lose a bit of performance if it
    >means processes and systems have better isolation and protection from one another.

    When people go and by a new computer, many are willing to spend hundreds of dollars more to get a little extra performance. They will not like to have that taking away from them just so that they can run a microkernel.

    >Gaining a couple of extra FPS's in Quake doesn't do much good if the entire system is down with a virus...

    It is just a false premise, just because some monolithic (or hybrid) kernels are unreliable does not mean that it is necessary or better to use microkernels to get reliability.

    I have used many Linux computers the last 10 years. They never went down with a virus, and I have not had problems with lack of protection between kernel drivers.

    So I do not feel very motivated to give up performance.

  84. Re:Linus Quote - "not arguing against it at all" by mennucc1 · · Score: 1

    "You can do simple things easily - and in particular, you can do things where the information only passes in one direction quite easily, but anythign else is much much harder, because there is no "shared state" (by design)."
    Why is Linus ruling out the fact that shared state may be put in shared memory?

  85. Re:Linus Quote - "not arguing against it at all" by Bert64 · · Score: 1

    Considering that the most privileged user of a system will always need the ability to modify core parts of the OS, such as loading or modifying kernel drivers etc...

    The first hurdle, is to ensure seperation higher up the chain before meddling with the kernel.
    No matter how well compartmentalised your microkernel OS is, if your user runs all his apps as a privileged user and one of those apps becomes infected with a virus, it will still be able to work it's way down to any part of the core OS it chooses.

    If an unprivileged user gets infected with a virus, it won't be able to trash the OS and the quickest dirtiest fix would be to logout, and log back in as a clean user.

    --
    http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  86. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 1, Insightful

    Proving the correctness of the core of the microkernel may be feasible, but I doubt it is even remotely possible for the "OS".

    When there are hundreds of device drivers, each interacting with each other, and the fact that a lot of hardware out there have their own set of flaws and sometimes produce unpredictable behavior, the best bet would be to write code that is "as correct as you know it", and then test test and test.

    Of course, on niche systems where the hardware can be controlled, proving it may be possible, but still if we're talking about mainstream OS'es like linux, the approach just wouldn't work.

  87. An interesting prediction by mangu · · Score: 1
    From the link you posted:

    "5 years from now everyone will be running free GNU on their 200 MIPS, 64M SPARCstation-5" - Andy Tanenbaum, in 30 Jan 1992

    /me stops respecting Tanenbaum. Given the prediction and the factual verification of its wrongness, from a scientific point of view it's only reasonable to assume that microkernels suck and RISC processors are a POS.


    Any theoretical advantages those could have are obviously offset by some other facts not taken into account when developing the theory in the first place. If he is a true scientist and wants to deserve his title of University professor, Tanenbaum should go back and redo the theoretical aspects of his work and consider the reality.

  88. The Thing Is by ajs318 · · Score: 2, Informative

    Whilst microkernels are a lovely idea in theory, they don't deliver in practice. There is already a bottleneck between user space and kernel space and this will impact upon performance. No matter what you are trying to do, the slowest part of the process will always determine the maximum rate at which you can do it.

    Monolithic, Linux/Netware-style modular and so-called hybrid kernels get around this limitation by moving things to the other side of the bottleneck. It makes sense on this basis to put a hardware driver in kernel space. You usually only pass "idealised" data to a driver; the driver generally has to pass a lot more to the device because it isn't ideal. For example, when talking to a filesystem driver, you generally only want to send it the data to stick into some file. The filesystem driver has to do all the donkey work of shunting the heads back and forth and waiting for the right spot of disc to pass under them.

    It might be "beautiful" to have as little code as possible situated on one side of the division, but it's most practical to have as little data as possible having to travel through the division.

    --
    Je fume. Tu fumes. Nous fûmes!
    1. Re:The Thing Is by the+eric+conspiracy · · Score: 1

      You can think of the process of communicating between the two parts of the system in terms of connection overhead, and data passing overhead. In most cases the process of communicating between two subsystems becomes inefficient when there are a lot of small messages rather than a smaller number of large messages. This is where I think a lot of the problems with microkernel architecture lie - insufficient attention to the connection overhead part of the process.

  89. this argument is old by Anonymous Coward · · Score: 0

    This argument has been hashed and rehashed so many times. Why not write the linux kernel in assember to improve performance? Its the same argument... It could be done but its a big waste of time. Move on.

  90. kick out an ABI by mennucc1 · · Score: 2, Interesting
    Truth is, the linux kernel is getting too big, it takes ~400MB of harddisk to compile a standard kernel 2.6 for a distribution; moreover this size of kernel makes for difficult decisions for distributions, that either exclude some part of it from binaries, or ship huge packages, most of whose are useless to most users. Just consider that the Debian packages went from ~10Mb for kernel 2.4 to ~15Mb for 2.6
    The kernel is becoming too big, and some parts of it (think: hamradio, USB gadgets ...) may well live outside of it. If SANE can manage scanners from userspace, why does webcams live in kernel space??
    I am still craving for the day when Linus will define a "kernel ABI" for driver modules, and some parts of the kernel source will get kicked out of the .tar.bz2
    I believe this day will come; and there are good reason to believe it
    • suppose FOSS dream comes true, and linux ever become the mainstream desktop OS, and every vendor supplies FOSS drivers for their hw.... it will not make sense to ship any single gadget/protocol driver in the same .tar.bz2
    • even today, it does not make sense to ship drivers forever, for hw that is now unavailable to buy; but at the same time it would be unfair to just drop the code to people who still own that hw.
    • having 220MB of source code without a published and enforced ABI for modules means that any change to some parts of the kernel, such as memory management, force almost everybody to rewrite their code ; this, in the long term, may foster innovation. It would be much better if there were some stable ABIs for drivers for lesser demanding drivers (such as webcams).
    Summarizing, IMHO the current monolithic situation cannot scale up forever.
    1. Re:kick out an ABI by Kalzus · · Score: 1

      Agreed, it can't scale forever. When something really *really* blows up, I imagine work will be done to fix it then.

      --
      "The Devil does not know a lot because He's the Devil, He knows a lot because he's old." -- unknown
  91. IOS XR - Next generation micro kernel Cisco OS by Anonymous Coward · · Score: 0

    "IOS XR is not based on their widely deployed IOS operating system, and is instead based on the QNX real-time operating system."
    http://en.wikipedia.org/wiki/IOS-XR

    "Cisco IOS XR Software, a new member of the Cisco IOS family, is a unique self-healing and self-defending operating system designed for always on operation while scaling system capacity up to 92Tbps. Cisco IOS XR powers the Cisco Carrier Routing System, enabling the foundation for network and service convergence today while providing investment protection for decades to come."
    http://www.cisco.com/en/US/products/ps5845/

  92. Language versus interaction architecture by Morgaine · · Score: 1

    >> In other words, it's the language.

    Not really, no. It's the interactions architecture, which is more fundamental.

    You can quite easily create fully thread-safe and hardware parallel-safe interaction structures on any system and make them available through opaque, MMU-protected APIs which are then accessible from simple/primitive languages like C without any danger whatsoever. Even in the face of {fork(); run(); fork(); run(); ...}, and despite willful attempts at livelock chasing and deadlock triggering.

    The language is not the problem, as long as it is not used beyond its inherent capabilities and design constraints.

    Your statement that "It's the language" implicitly presupposes that complex solutions have to be designed with threaded programs, but that's very far from the truth. Indeed, to some extent it's that very premise that has got current computing into the flakey mess that it's sometimes in.

    As a systems and language designer who has been working with parallel systems throughout a very long career, I am appalled that people are still trying to use solutions that were invalidated on theoretical grounds 4 decades ago. Shared address spaces and threading belong to those invalidated methods.

    You are right about the non-existence of a mainstream computer language that does threading "right", but even if there was, it would just be dealing with the symptoms rather than the disease.

    --
    "The question of whether machines can think is no more interesting than [] whether submarines can swim" - Dijkstra
  93. Linus Quote - "not arguing against it at all"-hard by Anonymous Coward · · Score: 0

    Here's my thought to the discussion. Just how much would hardware contribute to the decision to go with either one? And I'm not just talking about raw speed, but capabilities. CPU's already support threads, and virtualization. What else could be added to make microkernels more viable?

  94. Re:Linus Quote - "not arguing against it at all" by mgessner · · Score: 3, Funny

    Only a really, *really* incompetent idiot would write such a server which blocked until the read was finished.

    This sounds like a veiled reference to something; would you care to name it?

    --
    "Sometimes the truth is stupid." - Lawrence, creator of Prime Intellect
  95. It's a generalisable problem by Colin+Smith · · Score: 1

    It really isn't specific to operating system kernel design. It applies to all orgnisational structures which are assembled to perform actions, from computers to businesses and biology.

    Speed and efficiency vs distributed modularity and security. Which is most appropriate depends on the environment, there's no one true right or wrong answer.

    --
    Deleted
  96. We are going way off the subject.. by zafayar · · Score: 1

    Here is my 2 cents.. First of all deciding what kernel is better technically has nothing to do with its popularity. [ Windows anyone ??? ]. The question is What is actually better given the current hardware standards. This argument is going on for ever, and maybe monolithic won the argument 10 year ago - But that does not definately mean that those argument stands today the same way it did then. Computer Science, both hardware and software has come a long way since then. Maybe this is a good time that Andy has decided to start this up again. Not that anything is majorly wrong with linux kernel right now and its in best shape it has ever been in, but I think this is a good time to for linux buffs to compare their whole ideology to a competing one. Not with a view to achieve a grass root level change in the kernel, but as a excersie of self examination. See whats going wrong, and if there is something that is going wrong try and solve it. It would be very foolish to ignore any opposing aruguments and stick to good old dogma. I personally took a class for both Minix and Linux (Kernel programming), so I have come to appreciate both of them. And when i read arguments, both side seems right. I hope this is the hint..

    1. Re:We are going way off the subject.. by Phil+John · · Score: 1

      [ Windows anyone ??? ]

      Sorry to burst your bubble here, the Windows NT kernel design is arguably one of the best out there - it was after all created by the old DEC staff that worked on VMS.

      Most of the security problems on Windows are due to Internet Explorer (just like a lot of Linux security problems are with software outside the kernel).

      99.9% of the blue-screens on Windows are probably due to buggy device drivers.

      --
      I am NaN
    2. Re:We are going way off the subject.. by alteran · · Score: 1

      >99.9% of the blue-screens on Windows are probably due to buggy device drivers.

      Not that I'm expecting you to defend MS here, but I thought microkernals were supposed to stop buggy drivers from bringing down the OS, period.

      Either the MS implementation is bad, or microkernal design isn't all it's cracked up to be-- or both.

      --
      Who is RTFM and when will he help me with Unix?
    3. Re:We are going way off the subject.. by Phil+John · · Score: 1

      It's because NT started off as being a microkernel and then had a boatload of stuff put into the kernel, all the GUI drawing, device drivers etc.

      Why? Because on computers of that time, the hit in performance was very noticable. That barrier doesn't really exist today when computers are more powerful than a lot of the tasks they perform (and the biggest speed problems are to do with hard disk/memory speed).

      The problem is that too much was allowed into the kernel. The other problem that persists today is that not enough hardware permits resetting - my sound card can crash and the system stays up, I can't get sound again until I reboot. This is probably something that will be looked at in the future (and already is with hot-swappable hardware becoming more common place in PC based servers).

      --
      I am NaN
  97. IOS XR - Next generation Cisco IOS. by Anonymous Coward · · Score: 0

    http://en.wikipedia.org/wiki/IOS-XR
    http://www.cisco.com/en/US/products/ps5845/
    "Cisco IOS XR Software, a new member of the Cisco IOS family, is a unique self-healing and self-defending operating system designed for always on operation while scaling system capacity up to 92Tbps. Cisco IOS XR powers the Cisco Carrier Routing System, enabling the foundation for network and service convergence today while providing investment protection for decades to come."

    1. Re:IOS XR - Next generation Cisco IOS. by muddyblooz · · Score: 1

      Uhm... You *are* aware that IOS XR is based on QNX?

    2. Re:IOS XR - Next generation Cisco IOS. by muddyblooz · · Score: 1

      Duh, shoulda read the wiki entry first :)

  98. What the Idiot /should/ have written: by Morosoph · · Score: 1
    if (1==a)

    Good coding practice to stop exactly that bug.

    Unless you're really sure that you never do typos.

    1. Re:What the Idiot /should/ have written: by moyix · · Score: 1

      Or a reason to use better programming languages :)

      Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
      [GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> a = 0
      >>> if a = 1:
          File "", line 1
              if a = 1:
                    ^
      SyntaxError: invalid syntax


    2. Re:What the Idiot /should/ have written: by Jedi+Alec · · Score: 1

      Unfortunately for your example there are also plenty of cases where using the assignment = as a condition. Granted, there's not much point when the value to be assigned is a constant, but I do use it constantly when doing for example a malloc...

      --

      People replying to my sig annoy me. That's why I change it all the time.
    3. Re:What the Idiot /should/ have written: by Abcd1234 · · Score: 1

      No, what you /should/ do is make sure to enable -Wall, and then ensure your code compiles without warnings. Any decent compiler would tell you, in this case, that you were using an assignment as a truth statement.

    4. Re:What the Idiot /should/ have written: by mad.frog · · Score: 1

      Or better yet, turn on the "assignment statement in conditional" warning on your compiler, then write it like:

              if (a == 1) // way more readable, IMHO

      Really need that assignment? Try this:

              if ((foo = alloc()) != NULL)

    5. Re:What the Idiot /should/ have written: by drgonzo59 · · Score: 1

      Good point, I already switched to using Python and my life because 10x easier. With the help of Psyco and another 512Mb RAM speed can be greatly increased or I use weave to code some of the fast stuff in C. Over the years as I had to look through other people's code I have come to appreciate the value of clear straight forward programming without kewl l33t hacks and Python does enforce that to a cerain extent. Whoever said that in Python "there is only one -- correct -- way to do something" was quite right.

  99. Re:Plane OS by thrillseeker · · Score: 1
    I would have guessed the pilots relying on sensors that tell them where important points of reference are.

    We call them eyeballs.

  100. Loaded terms in this debate. by Jerk+City+Troll · · Score: 2, Interesting

    Whenever this issue comes up, I swear to myself that proponents of microkernel architectures created the term which they use to address their opponent. The terms used to discuss this are heavily loaded. “Microkernel” sounds lean, quick, and simple, while by subjective contrast “monolithic” sounds bulky, old, and unwieldy. I think that when engaging in this debate, it is best that we prefer to at least use “unified kernel” in place of “monolithic”, being it is more accurate and contrasts with “microkernel” objectively. The term most people use for kernels like Linux and NT seems to imply that there is no logical separation of components and that all pieces are somehow a gigantic (dare I say monolithic) glob and that is nonsense.

    1. Re:Loaded terms in this debate. by Spaceman40 · · Score: 1

      You'd be correct. I think Tanenbaum came up with both of these terms. He coins it in the first edition of his OS book (which includes the Minix source code, IIRC).

      On that note, some people call them "macrokernels" instead.

      --
      I [may] disapprove of what you say, but I will defend to the death your right to say it.
    2. Re:Loaded terms in this debate. by slashflood · · Score: 1

      How about Macrokernel?

  101. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    I think you missed it. He says that the calling process has to block, not the filesystem server. Your model does the same thing. A process calls for a read and waits for a response. It doesn't know what the filesystem server is doing so it just keeps waiting. That is called blocking. If you don't want your process to block then you need to make another thread that would make the read request. Then you would have that thread block (again, in either model) and the rest of your process could keep running.

    A monolithic model would technically not be blocking because the same thread that makes the call for a read does the read. Both monolithic and micro models block for the hardware. The micro also blocks to change execution from one process to another.

  102. Because it doesn't solve anything by p3d0 · · Score: 1

    Take another gander at what Linus was saying in the GP post. Address-space tricks don't address his issues.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  103. Re:Linus Quote - "not arguing against it at all" by naasking · · Score: 1

    And anybody who tells you that distributed algorithms are "simpler" is just so full of sh*t that it's not even funny.

    And anybody who tells you that it's possible to have deadlock-free code in any software of reasonable complexity that uses shared state concurrency is similarly full of sh*t. Fact is, creating deadlock-free code is harder than solving distributed problems; unfortunately, people have trouble accepting this.

    The whole "microkernels are simpler" argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel, the traditional kernel wins. By a huge amount, too.

    And traditional monolithic kernels are buggy, and unreliable. This too has been proven time and time again. The important question is: what's more important to you, development speed, or reliability?

  104. Re:Plane OS by BostonPilot · · Score: 1
    While modern airplanes have great automation available, your statement that pilots do very little is an exaggeration. Most (all?) takeoffs and most approaches are hand flown. Most systems configuration changes in flight are done by the pilot. The crew most certainly does not sit there and watch the automated system making decisions. Most pilots enjoy flying; that's why they chose the profession in the first place. While navigation enroute has made great automation strides (mostly because of microprocessors and GPS) most approaches in bad weather are still done based on 1950's technology (ILS) and the majority of those are hand flown.

    While autoland systems are used overseas, I do not believe they are used in the U.S (but they probably will be someday).

    While the technology may be available to allow pilots to do very little, that's not how it's done in practice. The last 3 times I flew jump seat (Dash-8, CRJ, Boeing-777) most of the flying was hand flying, with the exception of the cruise portion of the flight. The safest system is probably the track that we are on: automation to do the boring parts, and a wealth of information presented by computer to the pilot in a way humans can easily interpret (so, for instance a HUD with computer synthesized imagery so the human can see through fog, night, etc.).

    And, to answer your question about kernels, I'd feel fine with Linux if it passed DO-178B Level A certification, but that's probably not going to happen anytime soon ;-)

  105. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 1, Interesting

    >> Only a really, *really* incompetent idiot would write such a server which blocked until the read was finished.

    > "This sounds like a veiled reference to something; would you care to name it?

    Minix

  106. Re:Linus Quote - "not arguing against it at all" by ajs · · Score: 1

    Actually, this isn't the way most moderm microkernels work either. Generally, you talk to a THREAD associated with the driver. This thread adopts the callers slot and priority in the run queue temporarily, and scrutinizes the caller's request (performing roughly the analysis that you suggested, but at the appropriate priority, which might be much lower than some other process that wants the same driver a fraction of a milisecond later).

    The request is then either carried out in the handler thread, or passed off to a centralized driver thread after triage.

    This *is* more complex (which is Torvalds' point), but it's not horrible. Most of it can be wrapped in macros/templates/whatever and is uniform across all drivers.

    I think that Tovalds makes some excellent points, and simplistic arguments like "microkernels are more secure because each part is smaller and simpler," are just that: simplistic. Overly so.

    Still, there's value in the microkernel approach, as has been repeatedly shown. I'll remind readers that microkernel's don't all look alike. Most functioning microkernels are hybridized in one way or another with monolithic kernels to achieve usability. In the case of MacOS/X, that involves placing a monolithic kernel on top of the microkernel as a subsystem. In the case of NT/XP/Vista, that involves re-writing the most performance- and security-sensitive subsystems as monolithic subsystems (and, shockingly the NT kernel is about the only place that NT gets security right).

    Microkernels are here to stay, as they offer some useful abstractions, but I don't think that they harken the doom of monolithic kernels like Linux. It's just a different approach.

  107. Re:Linus Quote - "not arguing against it at all" by lokedhs · · Score: 1
    Arguably it's not really relevant either. "proving" a software program only proves that the programs conforms to the spec. Now who proves the spec? And who proves the proof?

    At the end of the day you're going to end up with a hell of a lot more documentation and proofs that no one will ever read, and the system won't be much better than the system that wasn't proven.

  108. Re:Linus Quote - "not arguing against it at all" by Grayputer · · Score: 1

    Actually, I am not interested in proving the kernal correct, no one is in the real world (imo). I am interested in being assured that my PROCESSING is correct. While the micro kernel may be smaller (not equal to simpler) I still need to then look at all the services that the mono kernel supplied that are external to the micro kernel.

    In all cases where a general computing OS is used the services list is probably the same (custom kernels are a different matter and a micro may strip down better, or not).

    Yes you get SOME advantage in security as MAYBE less things run at ring 0 but still lots of stuff will run at elevated priviledge (ring 0 or 1 not 3) and you have more complexity.

    In my opinion performance is one thing you care about, maybe less than security but you care. If the end-to-end security issues are even roughly the same between mono and micro kernels then performance trade-offs start to weigh in more (if I can have 1% better security at a 50% performance loss, do I want the trade? Where is the swap point, 5% security and 25% performance, 10 to 10, 50% better security at a 1% performance hit?). Oh, and yes the brighter reader is correct, it depends on my usage, does is not?

    Micro kernel OSs are more complex end-to-end. More complex typically implies more code, more code typically implies more potential bugs. However, microkernels are more compartmentalized, better compartmentalization improves security (broken part A does not imply access to part B). So the intended usage of the kernel impacts its overall end-to-end security 'rating' for the application in comparison to a mono kernel.

    A system that is only used by a single user, no network access, physical access restricted, user always runs a root, is probably as secure in either case (and a damn rare bird). A system that is naked on the net running 50 different publicly accessable services (web, DNS, mail, IM, ...) is a completely different animal. No one size fits all (shocking I know).

    Life is full of trade-offs, this is just another one.

  109. Re:Just do it! by Anonymous Coward · · Score: 0

    Be had a strict "no C++ in the kernel" rule. Yet another example of the epic amount of misunderstanding and bullshit that still surrounds BeOS to this day. And I say that as a huge fan of BeOS.

  110. Re:Linus Quote - "not arguing against it at all" by Da_Weasel · · Score: 1

    administrational information paths leverage synergies and increase the efficiency of profit centers extrema organisational paths...

    *makes retching noise*

    --
    If you must!
  111. Possibly Less than you think. by LWATCDR · · Score: 1

    Linus is a good programmer. But to think he is the ultimate expert in OS design isn't even logical.
    Most of the current Linux kernel wasn't written by Linus. It was written by many experts each submitting code to Linus.
    Then let's talk about innovation? Linus started with what he had learned from Minix and Unix and wrote his own kernel for the i386. He was daring in making the jump that he could write a unix kernel. He didn't do much in the design of Linux that was innovative.
    BTW I am not saying he copied Minix. I am saying he learned from it which is what it was for. If I remember correctly he did his first builds of Linux using Minix.
    To elevate Linus to a the position of the all knowing God of OS design is at best unfair.

    The idea that Linux is the ultimate OS is also very flawed.
    It may be that the very idea of one kernel for everything from a wireless access point to a super computer is just flawed.
    The next generation of computers may use a very different cpu architecture than the current X86. Look at the Sun T1 and the IBM Cell chips.
    Maybe in the future we will have system that use many cores and many different types of cores. You could have several in order risc cores that run simple utility tasks along with several out of order cores that run more complex branching style tasks, and several FPU/Vector units doing number crunching. For such a machine a monolithic kernel might be a very bad answer.
    I really hate this we have Unix and we nothing new mentality.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    1. Re:Possibly Less than you think. by Anonymous Coward · · Score: 0

      Linux already runs many different CPU architectures from Alpha to Sparc, work is already happening in the IBM Cells and OpenSparc aka UltraSparc T1

  112. Proving correctness & why it doesn't work by shapr · · Score: 2, Insightful
    As a fan of Haskell and type theory, I know and love the good points of being able to prove correctness.
    The problem is that it doesn't match the way most people work right now.
    Check out this brilliant paper by Alistair Cockburn (spoken as Co-burn) - Characterizing People as Non-Linear, First-Order Components in Software Development. Over and over in this paper he says:
    • Problem 1. The people on the projects were not interested in learning our system.
    • Problem 2. They were successfully able to ignore us, and were still delivering software, anyway.
    Alistair comes to an equally brilliant conclusion:
    The fundamental characteristics of "people" have a first-order effect on software development, not a lower-order effect. Consequently, understanding this first-order effect should become a first-order research agenda item, and not neglected as a second-order item. I suggest that this field of study become a primary area in the field "software engineering" for the next 20-50 years.
    In short, without Linus, microkernels may help. With Linus, a monolithic kernel works fine.
    If you've ever worked on a software project with more than four people, didn't the personality and skills of the people involved make more of a difference than any methodology, abstraction, or even the language used? That's always been true in my experience.
    --

    Shae Erisson - ScannedInAvian.com
    1. Re:Proving correctness & why it doesn't work by supersnail · · Score: 1

      I dont think the argument that a monolithic kernal only works because Linus
      did it is valid.
      All *nix OSes and several other very succesful OSes (zOS,VMS, etc. etc. ) are monolithic. The security problems with this type of kernal are well
      known; the solutions/workarounds are also well known.
      There are very few microkernal OSes that have aquired a large installed
      base (at least since the demise of OS/2).
      There are very sound and rational reasons for this, microkernels offer
      increase security/predictabilty/stability at the cost of a performance
      hit where it really hurts. Adding just a tiny amount of overhead to
      each IO, memory management and synchronisation operation adds up to
      a large performance hit. Single purpose, real time command and control
      systems are the only environment where it makes sense to take this
      performance hit.

      --
      Old COBOL programmers never die. They just code in C.
    2. Re:Proving correctness & why it doesn't work by tmasssey · · Score: 1
      There are very few microkernal OSes that have aquired a large installed base (at least since the demise of OS/2).

      OS/2 was not a microkernel. There *was* a microkernel-based version of OS/2: OS/2 for PowerPC. However, it was never actually sold (there was no real hardware to run it on).

      OS/2 was very much a monolithic kernel that borrowed heavily from IBM's mainframe OS experience (Reference). However, it suffered heavily from its 16-bit heritage (OS/2 1.x was targeted at 80286 processors). It was a modular kernel, but it used 16-bit protected-mode drivers for items such as network adapters (NDIS 2.0) and file system drivers.

      In fact, it was OS/2's monolithic nature and 16-bit origins that made OS/2 for PowerPC such a difficult undertaking. Unfortunately, for OS/2 to be a realistic operating system moving forward, you really would have needed a major rewrite like that, just to get rid of the 286 heritage. However, with the lack of momentum behind OS/2 and the failure of PREP/CHRP that just wasn't possible.

    3. Re:Proving correctness & why it doesn't work by shapr · · Score: 1

      I'm not saying microkernels don't work, or that monolithic kernels do work.
      I'm saying that the real thing that works or doesn't work is the people on the project, not the kernel structure, the abstraction, or whatever.
      If you can get the right people into the correct roles, your project will succeed beyond your wildest dreams. All other considerations together have less of an effect than this factor.

      --

      Shae Erisson - ScannedInAvian.com
    4. Re:Proving correctness & why it doesn't work by drgonzo59 · · Score: 1

      But that is a management and HR problem. They need to screen for people that have the right skill level _and_ can work with others. That is probably true in any work environment, not just software.

  113. Re:Plane OS by Brane2 · · Score: 1


    I would personally trust my life to INTEGRITY-178B [mil-embedded.com]from Green Hills -- which does have a microkernel architecture, before I would trust my life to a huge monolithic blob of code such as the Linux kernel.


    But can that "Integrity" play DVD while transfering data intensively through several protocols at once (e.g. SMB, NFS etc), is it able to run F.E.A.R or Quake at decent framerate and how much does it cost ?

    You are comparing apples to oranges. Flight approved gear has to meet very different requirements and raw CPU horsepower usually isn't one of them.
    Sure, they might have to have deterministic response time, but OTOH they do run in a very controlled environment. You probably can't just log in from pilot's seat and install fresh DivX player on it...

    I'd LOVE to se that "Integrity" of yours running Gentoo and a pilot with the balls of steel, doing "emerge --sync ; emerge -uD world" before each flight.

  114. We have an example... by ratboy666 · · Score: 1

    The Smalltalk 80 system was an OS, GUI, programming environment &etc. in Smalltalk, using a VM, with complete OOP orientation.

    And, yes, there was an OS, and it was run on the VM, and no-one seemed to mind.

    Squeak is the descendent of that work. Its portable because the VM can be moved -- the actual Smalltalk code uses the "OS in Smalltalk". Its probably the environment you want for your OS concept exploration.

    Ratboy.

    --
    Just another "Cubible(sic) Joe" 2 17 3061
  115. Re:Linus Quote - "not arguing against it at all" by ghettoimp · · Score: 1

    "Arguably it's not really relevant either. "proving" a software program only proves that the programs conforms to the spec. Now who proves the spec? And who proves the proof?"

    Specifications are often simpler than programs. As a pedagogical example, the notions of "ordered" and "permutation" are simpler to express than the code for most sorting algorithms.

    In the case of operating systems, you might not even be interested in total correctness. For example, you might only try to prove something like "every process eventually gets a chance to run", instead of trying to show that they all run in some particular order.

    As far as who proves the proof goes, I suppose you could have humans look at it. But probably it's more useful to write a tool. All programmers are used to working with type systems now, and your type checker is really a very simple theorem prover. More general purpose provers, such as ACL2, HOL, COQ, and PVS, can also be used to check proofs, so that not many humans need to read or understand them.

    You might find it useful to think of proofs as "really good test suites" that are able to check some property not just on a few random cases, but on an infinity of cases. They may certainly take a lot more expertise and effort to set up than your typical regression suite, but they can be a lot more comprehensive, through the awesome power of induction and symbolic reasoning to reduce the infinite to the finite.

    Lastly, speaking from experience, the process of proving code correct often reveals lots of hard to find bugs. Maybe they could be found in other ways, but maybe not.

  116. Seeing Eye to Eye by cybrangl · · Score: 1

    It seems to me that the argument over a micro vs monolithic kernel comes down to what people expect from Linux. The micro is oviously the choice for security, but as we can see there are some complications to it that make it more difficult to develop. On the other hand, it is much faster to develop in a monolithic kernel, which is what most of the market demands. Why not fork the kernel and start down a path of micro vs monolithic. the micro could be geared towards high security and embedded systems, while the monolithic could be geared towards desktop and the general consumer market. Of course the trick is to make sure both kernels run the same code, which is no easy task, especially if the micro is behind in development.

  117. Re:Linus Quote - "not arguing against it at all" by newt0311 · · Score: 1
    Addressing your points:
    You seem to completely ignore the main reason for using a microkernel -- the ability to prove (even mathematically) that the kernel is correct.
    Even if it is possible to prove that the core kernel is mathematically correct, that does not mean that it is possible to prove that all the associated daemons such as those for memory manegemet, file access, and device drivers are. Furthermore, even if somebody does manage to prove that all those are mathematically correct, it still does nothing to prove the whole system as a whole doe to communication, deadlock, and multithereading problems.
    It is like saying that a small bug in the mouse driver will freeze and crash the system with a monolithic kernel. Good thing if the system was only running Doom at the time and not controlling a reactor, or administering a drug. If the same happens in the microkernel system, the kernel will reload the driver, raise an alarm, or in general -- be able to take the system to a predictable predetermined state.
    WRONG. If the bug is in the interrupt handler, it will freeze any AMD64 or x86 system due to architecture limitations (only the interrupt handler code is running with no scheduler support during interrupts). If the bug is in the bottom half (ie. any portion of teh driver code not in the interrupt handler) of the driver, any monolithic kernel with modularization support (like the Linux kernel, any other *NIX kernel but not the win32 kernel) will be able to force unload the module and reload it, just like the microkernel design but much faster (since the different portions of the kernel don't have to waste time with the overhead of message passing and can communicate with direct function calls).
  118. Re:Linus Quote - "not arguing against it at all" by Kadin2048 · · Score: 1

    When people go and by a new computer, many are willing to spend hundreds of dollars more to get a little extra performance. They will not like to have that taking away from them just so that they can run a microkernel.

    These people are really not the kind of people who are going to use microkernels, or really care that much about stability. Home users, in general, appear pretty far down the "stability/performance" tradeoff scale, towards the performance end. The advantage for them to use a microkernel, or any other architecture which trades performance for increased stability, may be minimal.

    But then again, they're not really the market for high-reliability systems: real time systems, command-and-control applications, and embedded systems are. Increasingly, servers are going to fall into this category as well.

    I have used many Linux computers the last 10 years. They never went down with a virus, and I have not had problems with lack of protection between kernel drivers.

    This is a straw man. I'm sure somebody out there is willing to pipe up and say that they've used an unpatched Windows ME box for some obscene length of time, but we all know it's insecure. Likewise, just because you've never seen a Linux box go down doesn't mean they're immune, or that if you were designing a system that needed "five nines" reliability, that you'd have a basis for making a selection. The point of a microkernel, as someone further up in the thread (GP?) said, is that it's easier to analyze the code and prove, to an acceptable degree, that it is secure and stable. The fact that a server has run for a year or 10 without crashing isn't enough; you need to be able to demonstrate basically a priori that the system will be reliable, in addition to having test cases.

    So anyway, in a limited way I'm agreeing with you. Joe Blow the 3D gamer probably isn't going to give a crap about microkernels, and isn't going to find their advantages convincing. But someone running any kind of production server might, and certainly anyone building high-reliability or embedded equipment should.

    The question then becomes: which group of people is Linux being built for? Where, on the performance versus stability continuum does it reside?

    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  119. Microkernels can still be optimized by guitaristx · · Score: 2, Insightful

    When people go and by a new computer, many are willing to spend hundreds of dollars more to get a little extra performance. They will not like to have that taking away from them just so that they can run a microkernel.

    Agreed, but these are the same people who don't really care if they're at the bleeding edge of technology and have to deal with super-l33t video driver 0.8.2b crashing every so often.

    It is just a false premise, just because some monolithic (or hybrid) kernels are unreliable does not mean that it is necessary or better to use microkernels to get reliability.

    I'm afraid the false assumption has fallen upon you here. It's proven, time and again, that microkernels make it simpler to guarantee security and reliability. Yes, microkernels hurt performance a bit. However, it's throwing the baby out with the bathwater to discard microkernel architecture because of performance. By discarding microkernel architecture, you also discard the architectural segregation of system services, which makes for a very simple way to segragate effort when you've got say, an open-source project with developers located around the globe. Microkernels also ease maintenance, again, because the kernel remains small.

    A HUGE misstep that the monolithic kernel camp has made by pointing fingers at microkernels' performance is this: smart coders write good, clean, testable, reliable, secure programs first, and optimize later. One should never, EVER attempt to optimize code on the first pass. Write it, test it, fix it, THEN optimize it. Leave the clearly non-optimal code in during the first few passes, just for the sake of maintenance. Then, you'll have a good, clean codebase from which to begin profiling and optimizing.

    I can personally testify to spending exorbitant amounts of time debugging architecturally un-sound code, written intentionally so, because a wise architectural decision would've resulted in lesser performance. Out of curiosity, I usually run profilers over this code. Most often, these architectural decisions result in such a negligible performance increase that it pales in comparison to the maintenance nightmare that ensues from it.

    There's nothing magical about microkernels that prevents them from being optimized, just like any other program. The benefits of the microkernel architecture certainly outweigh the performance hit in my book.

    I recommend sodium chloride (5mg) if you disagree with any of the above.

    --
    I pity the foo that isn't metasyntactic
    1. Re:Microkernels can still be optimized by shaitand · · Score: 2, Insightful

      "I'm afraid the false assumption has fallen upon you here. It's proven, time and again, that microkernels make it simpler to guarantee security and reliability."

      It is not proven at all and the top kernel programmers in the world agree. If they didn't, this discussion wouldn't be occuring. If you mean that the code is simpler to audit because there is less of it you are mistaken. A microkernel architecture only involves less code in the kernel, if you consider all the code needed to provide the functionality of the macrokernel it is replacing then a microkernel involves MORE code and greater complexity. Therefore it is MORE DIFFICULT to audit.

      "By discarding microkernel architecture, you also discard the architectural segregation of system services"

      Of course you want to segregate services logically for maintainance. That is already done with macrokernels. There is no reason to run those services in a seperate memory space just to get a logical seperation. A logical seperation is all that is needed for distributing maintainence.

      "A HUGE misstep that the monolithic kernel camp has made by pointing fingers at microkernels' performance is this: smart coders write good, clean, testable, reliable, secure programs first, and optimize later."

      False. You pick a overall design that satisfies that your primary design concerns first. The rest of your statement is true about IMPLEMENTING that design. Not designing a memory manager for performance in the first place is a preposterous concept, you pick the fastest performing design, implement that design in a stable and reliable manner and then go back to optimize individual parts of code. You do not pick a slow as shit but ultra reliable design, implement in the most reliable way possible, and then go back and try to optimize the poor design.

      "Most often, these architectural decisions result in such a negligible performance increase that it pales in comparison to the maintenance nightmare that ensues from it."

      We are talking about the kernel, not a text editor. Performance is critical and there is no such thing as a negligible performance gain. Although I would hardly call either macro or micro kernels unsound designs.

      "There's nothing magical about microkernels that prevents them from being optimized, just like any other program. The benefits of the microkernel architecture certainly outweigh the performance hit in my book."

      The benefits of a microkernel architecture remain theoretical. The performance hit is not. Andy himself has previously estimated a 'negligable' overall performance loss of about 30% using an optimized microkernel versus an optimized macrokernel. I am hardly prepared to trade 30% performance for theoretically increased reliability and stability. Especially when the practical macrokernel implementations don't have stability or reliability problems. You can't get more reliable than 'never goes down' (except for maintanaince and hardware failures of course) and my linux DESKTOPS meet that standard already; let alone servers and mission critical systems.

  120. Multiple-processes: micro vs monolithic by Lemming+Mark · · Score: 2, Insightful

    Sooooo, it's easy to have someone else handle the multi-process bits in a monolithic design. But when it comes to writing services for microkernels suddenly everyone is an idiot? I don't think that was what was meant. Thing is, with a monolithic kernel every process can run in userspace or in kernel space. (OK, I'm assuming a 1:1 kernel threads to user threads, but lets ignore that issue for now) Because all the processes have a kernel context, it's quite simple to manage multiple processes making use of the kernel at once. Run kernel code to service the filesystem request in the kernel-mode context of the process that made the request. At this point, if the kernel supports pre-emption then it's possible to pre-empt that process during kernel-mode execution and resume it later. In a microkernel you don't get that. The filesystem server doesn't implicitly get its multithreading from each process being represented by a kernel thread - because it can't access the kernel. If it wants an implementation of multithreading it has to implement its own (nb. could use a library to simplify this). But lots of tasks now require explicit extra code: the FS server might need to handle scheduling priorities itself, because the internals of the server aren't under direct control of the kernel; threading in the FS server must be made explicit because it doesn't come "for free" when processes are created. This is a problem for every server that needs to serve multiple clients simultaneously. A lot of this should be solvable with library code, I have thought. But the basic argument here (AFAIK) is that you have to code up somewhere in userspace extra implementations to take care of things that are implicitly provided for in a monolithic design.

    1. Re:Multiple-processes: micro vs monolithic by Intron · · Score: 5, Funny

      I see you are also a fan of monolithic posts.

      This micro-post shows a division into seperable units.

      Using message passing, I can efficiently communicate this to you.

      Note that other readers may be reading different sections of my post while you read this one.

      This section of my post never has to access internal structures of the other sections. In fact, I could have written each section in any order. Feel free to reorder them yourself.

      --
      Intron: the portion of DNA which expresses nothing useful.
    2. Re:Multiple-processes: micro vs monolithic by Lemming+Mark · · Score: 0, Offtopic
      Dude, if I had mod points you'd be getting some +5 funny love right now. :-)

      Incidentally, my post would have been less monolithic if I'd remembered /. requires the

      tags. Ah well.

    3. Re:Multiple-processes: micro vs monolithic by Anonymous Coward · · Score: 0
      Using message passing, I can efficiently communicate this to you.

      Warning: potential null reference exception if this message is received first ('this' is null).

    4. Re:Multiple-processes: micro vs monolithic by Hal_Porter · · Score: 2, Funny

      Q) Why did the multithreaded chicken cross the road?
      A) the other side. To get to

      Q) Why did the multithreaded chicken cross the road?
      A) get to the other side. To

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    5. Re:Multiple-processes: micro vs monolithic by sjames · · Score: 1

      preemption in the Linux kernel is cleaverly implemented, but I wouldn't say that it's free or unavailable in a microkernel. Consider, process makes an fs request. Process will block awaiting the response (it will yield it's timeslice and sleep until it has a response). An fs server thread will unblock now that there is a request to dequeue and begins work. The system scheduler may interrupt that thread at any time to do something else. Optionally, the server thread may (probably should) inherit the priority of the calling process.

    6. Re:Multiple-processes: micro vs monolithic by Lemming+Mark · · Score: 1

      Sure thing... but there will be other processes also trying to use the filesystem server that may have a higher priority than our first client. My point is that to handle this correctly there needs to be an implementation of pre-emption *inside* server processes. Sure you can pre-empt the filesystem server itself, but the microkernel can pre-empt operations occuring inside the server, on behalf of other threads. The solution to this could be to multithread the server (in which case you still have the problem of transferring the client's priority onto that thread) or use some other kind of mechanism for scheduling client requests within the server. In a monolithic kernel, you don't have "servers" - OS-level work on behalf of a thread is (not always admittedly, but often) carried out in the context of that process. This in turn means that the kernel's process context is automatically a container for processing related to that process, that the kernel scheduler is able to pre-empt syscall operations performed by that process, etc. It's not necessary for each subsystem to have a local implementation of scheduling in order to implement global policy. The exceptions to this are where work is tasked of to another kernel thread, or where *incoming* network IO for a process is handled. But syscalls, at least, can generally be handled in process context, whereas in a microkernel they're typically carried out in server context.

    7. Re:Multiple-processes: micro vs monolithic by sjames · · Score: 1

      The solution to this could be to multithread the server (in which case you still have the problem of transferring the client's priority onto that thread)

      A threaded FS server is a clear choice here. I don't see a difficulty with priority inheritance, just make the priority transfer part of the IPC. It's not a big problem to use a shared library to implement a standardized threaded server with an IPC work queue. 'Just' fill in the IPC handler.

  121. Re:Linus Quote - "not arguing against it at all" by Jasin+Natael · · Score: 1

    Taking the utopian view, keeping things strictly isolated makes them provable. Everything. Your video driver can now be proven in the context of its defined interaction, instead of in a messy process space. Maybe in the near future, we'll have intelligent systems strong enough to do the following:

    1. Mathematically prove the function of small blocks of code, probably using some type of grid/distributed computing, up to the order of a few thousand or even a hundred thousand lines.
    2. Once code is proven, use procedures we have not yet defined to re-integrate the verified parts into a coherent whole, nullifying the performance losses of the initial compartmentalization.

    Right now, proving code isn't just very hard -- it's very, very hard because there's always the possibility that some useful, correct technique or transformation hasn't been formalized yet. But by keeping everything compartmentalized, each member becomes verifiable. Nobody is going to run independent tests on source with their own hardware because of the immense complexity, although I look forward to a day when we might verify the correctness of source code as easily as we check MD5 sums today.

    By clearly defining acceptable inputs and outputs, and with enough computing power, we should be able to enforce correctness at least in terms of security and stability, if not suitability for a particular task. The video driver might still draw a few wrong pixels, but we will know that it won't draw them outside of its address space, or return a function pointer with corrupted data. I think, though, that this is acceptable. Formal algorithms and approaches tend to be much easier to confirm than their implementations.

    Jasin Natael
    --
    True science means that when you re-evaluate the evidence, you re-evaluate your faith.
  122. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up.

    Well maybe that's how *you* would design *your* Microkernel. And yes, it would suck.

    He's right. That's how microkernels work. There is no opportunity for concurrent processing with a microkernel. Too bad, they seemed like a good idea.

  123. THe obvious solution by goombah99 · · Score: 1

    Having lately been coding Interprocess communication structures, I think Linus nails the issue. The solution to this it seems to me is very simple in concept. We need something akin to a parallel socket connection. As it is stands copying memory, as one does with serial scoket communication, is the bottleneck in any message passing communication between processes.

      Now one way to look at this is that serial communicaiton, like copying, is effectively like have one byte of shared memory between two processes. To transfer a data straucture you effectively have to serialize it across this one byte. You do have locking bewteen the processes, only its just on the one byte (the last byte copied or the last byte serialized). So it's not locking on the data structure which is the problem.

    So the solution to this is to have a page of shared memory. Lots of bytes. and locking on this page.

    One still has message passing and isolated processes since they are only sharing that page not their stacks or registers, or anything else.

    I like to call this a parallel socket. But whatever it's called, if you implemented it, it would bridge the world of micro and monolithic kernels. And it would allow you to acrue all the advantages of micro kernels with only a slight weakinging of their isolation.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  124. Re:Linus Quote - "not arguing against it at all" by iabervon · · Score: 1
    For example, you could make a message be more like a procedure call - you create a new stack, swap your address table around, and then jump into the function in the "server".


    Better make that: you swap your address table around, create a new stack, and then jump into the function in the "server". Otherwise your new stack isn't in your address space, while is going to be a problem. In any case, a bunch of the work of creating a new thread is creating an additional stack in an address space that already has stuff in it. You have to make sure that the address range you're going to use for it isn't in use as a stack already, and isn't being concurrently allocated as a stack on a different processor, which requires the microkernel to do a bit of clever locking.

    Then, of course, you're writing a filesystem driver which is concurrently handling multiple requests that may involve the same data structures, so you need all the same fancy locking that a monolithic kernel would need.

    Fundamentally, if you care about scalability, you need locking for managing your resources, regardless of whether you have a microkernel or a monolithic one, because the on-disk data structures are a shared resource. If you one a microkernel, you additionally have the driver's address space as a shared resource that needs to be managed (and this could have a lot of contention if, for example, you have a lot of processes simultaneously opening different files in the same filesystem, where all of the data is already cached in memory). With this, you reduce the chance that code outside of your driver but inside the kernel could write to your driver's address space, which isn't, in practice, a common occurance, because other code generally won't have pointers that go there.
  125. Provability is exponential by guitaristx · · Score: 1

    Umm, doesn't that mean while you've prooved that the 10k microkernel lines correct, you'd still have ~6 million lines of code sitting outside the microkernal waiting to be prooved? I can't see how a microkernel can magically do with 10k everything Linux is doing with 6 million lines (especially as by the definition of microkernel, than there's no way it could).

    If the majority of the system services are implemented by one "server" or "module" with ~6m LOC, then you're missing the point of a microkernel anyway. In a properly-implemented microkernel system, those 6m LOC would be split into well-defined, easily-provable chunks. As the LOC increases, it becomes exponentially harder to prove the code's correctness. As an example, let's consider the "index of provability" to be 2^LOC (an exponential expression). So, proving a 6m LOC kernel would be:
    2^6e6 (a number requiring six million binary digits to express)
    Now, let's consider breaking that 6m LOC kernel into 20k chunks. Each chunk would be 2^20k, and there would be 300 chunks. So, the index of provability for the microkernel would be:
    300 * 2^2e4 = 2^2.0002e4 * 3 * 5^2 (a number requiring 2.0009e4 binary digits to express)
    The latter is MUCH smaller. Breaking the system down into smaller chunks helps provability a LOT.

    --
    I pity the foo that isn't metasyntactic
  126. Where does EMACS fit in? by BarkLouder · · Score: 0

    Monolithic....micro.....hybrid.......

  127. Re:Linus Quote - "not arguing against it at all" by dubl-u · · Score: 1

    To the extent that I understand kernel architecture, what Linus says makes a lot of sense. But this bit worries me:

    The whole "microkernels are simpler" argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel, the traditional kernel wins. By a huge amount, too.

    This confuses simple with easy, and they're two very different things. For example, a copy-and-paste coder takes the easy path, whereas somebody who abstracts out the common functionality is pursuing simplicity. Linus may be right about the point, but the argument itself is bunk.

  128. Re:Linus Quote - "not arguing against it at all" by iabervon · · Score: 1

    The problem with that is that most of your accesses are going to be to data cached in memory, which can be handled immediately (or, at least, as fast as the context switches). In order to be efficient, you need to be able to handle multiple of these calls concurrently, if they don't conflict, on different processors.

    What you can do is have the kernel handle the non-driver-specific stuff (i.e., cached directory structure and cached file data), since that's essentially a generic facility like allocating physical memory to address spaces. The driver only gets called for stuff that's specific to the filesystem, which is going to require disk access (which is slow and serial) anyway. The generic facility doesn't get protection from other internal generic facilities, but it's relatively small and doesn't have many special cases, so it gets tested effectively.

    Of course, such a design is already available, in Linux, with FUSE. So Linus evidently didn't argue against it effective, if at all...

    (Of course, some things are still tricky; how do you deal with drivers in userspace which may need to allocate memory in order to handle writes, when the writes may be triggered because data has to be written out to free up dirty buffers, and the memory management system has no clue how much memory the driver could need?)

  129. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    frighteningly, i've never heard a better argument for fascism. Oh, except I guess it would require humanity to be running different software.

  130. Let's move away from binaries by ihabawad · · Score: 1

    Folks, this has been said before, but bears repeating. Microkernels vs. monolithic kernels is a valid debate, but not *the* debate. Instead of allowing arbitrary binary code, and trying to figure out how to build complicated tricks to verify that it does not break security, we should be working on an operating system based on a virtual machine with a high level bytecode, a JIT, and a bytecode verifier to ensure that only code with predictable semantics is allowed to execute. With such an OS, the whole thing could run in supervisor mode with no traps at all, thus offsetting whatever performance is lost due to the bytecode execution (which I think would be minimal anyway since we have really good JITs these days).

    1. Re:Let's move away from binaries by Anonymous Coward · · Score: 0

      I was thinking along similar lines, but I hope to God such a system is not based on Java. The approach taken by Microsoft's Singularity is more my style. The "design bytecode to support a particular language" philosophy really needs to stop. Microsoft (as much as I hate them) has taken one step in the right direction with .NET, but the goal really needs to be truly language-neutral bytecode that can support arbitrary machine semantics as well as proofs of correctness/security ala Singularity.

  131. Continuation Passing Style by Nicolay77 · · Score: 2, Insightful

    What you're talking about is very close to CPS.

    There are some ways to convert normal function calls to CPS.

    And there is something called monads used to convert imperative algorithms to functional style.

    And yes, continuations can be a very powerful technique.

    However, CPS functional code is still coding an algorithm. Any way to compute something is an algorithm. May be you should name your critic "I dislike imperative algorithms, and I like CPS functional algorithms."

    --
    We are Turing O-Machines. The Oracle is out there.
  132. Actually, no... by Svartalf · · Score: 1

    It would have had a kernel, but it'd been a separate dictionary running a background process. A good example of what I'm talking about would be MVP Forth running on x86 PC's- it was multithreaded back in the early 80's and you could use it as a full-blown OS environment if you wanted to. You probably could tickle an OS layer in F-Code out of OpenBoot/SunBoot if you tried hard enough.

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
  133. Re:Linus Quote - "not arguing against it at all" by elgaard · · Score: 0

    ==
    So anyway, in a limited way I'm agreeing with you. Joe Blow the 3D gamer probably isn't going to give a crap about microkernels, and isn't going to find their advantages convincing. But someone running any kind of production server might, and certainly anyone building high-reliability or embedded equipment should.
    ==

    Yes, I was talking about home users because the parent talked about viruses and FPS in quake. If you play Quake and your computer get viruses, Linux is the obvious way to go.

    Viruses is not a problem on decent real-time embedded systems, microkernel based or not.

    > Likewise, just because you've never seen a Linux box go down doesn't mean they're immune
    No, just as microkernel bases systems are also not immune.

    ==
    The question then becomes: which group of people is Linux being built for? Where, on the performance versus stability continuum does it reside?
    ==

    If it is a continuum.

  134. David Miller Quote from the last flame-war by anandsr · · Score: 1

    "Why split fundemental os functions, such as memory management, into user
    processes? As all good *nix gurus know, the means to success is to
    divide and conquer, with the goal being to *simplify* the problem into
    managable, well defined components. If splitting basic parts of the
    operating system into user space processes complicates the function by
    introducing additional mechanisms (message passing, complicated signals),
    have we met the objective of simplifying the design and implementation?"

    He had said the same thing in the last flame-war, which means exactly the same thing which Linus is saying now.

    The main point is that the simplest design is the best design.

    A microkernel is not the simplest possible design, a monolithic kernel with proper modularisation is simpler.

    http://www.oreilly.com/catalog/opensources/book/ap pa.html

  135. A fixed kernel ABI will destablise things faster by Sits · · Score: 1

    First up I helped develop a Linux USB webcam driver. These things can sometimes push a serious amount of data about the place and the camera won't wait for you before sending more. Being at the mercy of scheduler because the decoding is in userspace could well mean performance is poor (where I was bayer decoding was done in kernel precisely for speed concerns). The other thing is that if the USB driver is in the kernel the output can be exposed as a video device rather than forcing each program to implement each camera's USB dialect. If you want to use established video playing software this last point is fairly key.

    As for stable kernel ABIs... they will only make things worse as fewer people are able to debug your problem. The only people who have the resources to cope with support for a binary driver platform (which are the only winners from a fixed ABI) for hardware with as many permuations as your typical PC are Microsoft (and on Windows people even circumvent measure designed to improve drivers). You need more not fewer people as the amount of hardware possiblities go up and a kernel ABI actively discourages this.

    Having to keep even the kernel API stable only encourages resistance to change and layers of glue in the kernel in an attempt to keep old binary drivers working (thus hurting future developments).

    As for the space requirements for shipping all those drivers... quite frankly they are negligble compared to the size of disks in your modern desktop computer. Saving even 500Mbytes of hard disk is probably a false economy when your typical disk size goes over 50Gbytes.

  136. Trip down Memory Lane by mikiN · · Score: 1
    The great thing about Linux isn't in the details of the kernel, the big wonder is how so many good programmers decided to join in, when there already existed other free operating systems, such as FreeBSD and the Hurd to work on.

    Seems it was a very close call indeed.

    Remember 386BSD? Here's this article "The unknown hackers on Salon quoting Linus saying:
    "If 386BSD had been available when I started on Linux, Linux would probably never have happened."

    As far as I know, 386BSD was in fact available before Linus made his first release.
    --
    The Hacker's Guide To The Kernel: Don't panic()!
    1. Re:Trip down Memory Lane by sp0rk173 · · Score: 1

      It was, yes, but at the time it was encumbered by lots of AT&T code. Lawsuits were flying, developers didn't want to touch it until that cleared up...which offered linux enough time to gain the momentum it needed to develop it's legendary mind-share. That said, the resulting projects that came out of 386BSD (open, free, net, and the darwin userland) are nothing to scoff at.

  137. My take by MrCopilot · · Score: 2, Insightful
    Linus' Kernel works. Has worked, will work and is a collosalkernel.

    IBM is shipping it. Novell, RedHat, WindRiver, LinuxWorks, Motorola, Sharp, Sony, Hell even I'm shipping it in embedded products. It is easy to "prove it works" as alluded to in another post.

    Microkernels are also shipping from QNX and, uh and, oh I'm sure there are a few more. (Not knocking QNX, considered it but tossed it, due to cost and liscensing.)

    Is one more secure or stable than another, is really the wrong question.

    The question is really is the "System" designed with microkernel more or less stable or secure or functional then the alternative.

    I think it has, to my satisfaction, been settled. From RevolutionOS the movie (BuyIt!) Stallman is asked why HURD is so far behind Linux. His answer, (paraphrased, sorry RMS) Turns out a microkernel is very difficult to pull off because of the constant stream of messages required for the simplest of tasks. This forced ovehead only makes the Kernel more secure not the system, if the "drivers" keep crashing out and restarting you could go months without noticing critical flaws. "But the kernel is rock solid" doesn't really help if I can't ship the "System", does it. The only evidence you need, is the development pace of Hurd or even QNX to show this.

    I respect the professor and his work, but it was an inspiration for a much more scalable design that clearly is superior for the rapid development a modern OS is expected to have.

    As an engineer I see the beauty, but as a Production Engineer I can also see the added complexity a microkernel brings.

    Of course you could, argue theoretically that I'm wrong or prove it by making a GNU/Minix distribution to compete in the real world with Linux. Almost 15yrs and a flood of Students haven't helped Professor T, produce it yet. Admittedly not his goal, but come on I know students and CompSci students have a knack for carrying their favorite teacher/classes with them throughout their career and it shows up in their projects.

    --
    OSGGFG - Open Source Gamers Guide to Free Games
    1. Re:My take by Mike+Buddha · · Score: 1

      Microkernels are also shipping from QNX and, uh and, oh I'm sure there are a few more.

      Don't forget the one that that pinhead Steve Jobs is flogging :)

      --
      by Mike Buddha -- Someday the mountain might get him, but the law never will.
    2. Re:My take by MrCopilot · · Score: 1
      "Microkernels are also shipping from QNX and, uh and, oh I'm sure there are a few more." Don't forget the one that that pinhead Steve Jobs is flogging :)

      Sorry, I misspelled Apple.

      --
      OSGGFG - Open Source Gamers Guide to Free Games
    3. Re:My take by Anonymous Coward · · Score: 0

      Was going to make fun of you for this comment, but this one (and others down the page and even more on last /. post) do a much better job.
      http://linux.slashdot.org/comments.pl?sid=185367&c id=15300080

    4. Re:My take by evilviper · · Score: 1
      Linus' Kernel works.

      CP/M works. DOS works. etc.

      The definition of what "works" changes when something newer and better comes along. Certainly something with vastly improved stability, security, and flexibility would move Linux from the "works" column to the "used to work" column.

      Microkernels are also shipping from QNX and, uh and, oh I'm sure there are a few more.

      You need look no further than OpenVMS. The preeminent example, and damn good proof of the concept, in the real world.

      The only evidence you need, is the development pace of Hurd or even QNX to show this.

      Not true at all. You can list some incredibly slow-moving monolithic kernels too, I'm sure.

      HURD is a good example of bloat and bureaucracy in software design, and not a fair example of anything else.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  138. Re:Linus Quote - "not arguing against it at all" by woolio · · Score: 1

    And what happens when the queues fill up? That's when things get interesting... (avoidance of deadlock, etc, etc)

    Couldn't a program be "blocked" trying to issue a request when the queue is full and at the same time, it wouldn't be able to accept the "Reply" from a previous request do to this?

    Sounds like a resource-based deadlock even though the requests themselves do not create deadlock.

  139. Re:Linus Quote - "not arguing against it at all" by ultranova · · Score: 1

    Perhaps the best way to implement a microkernel is not to move as much as possible into userspace processes, but to move as much as possible into userspace libraries? A library call is synchronous, just like a system call, so writing a reentrant function for a library shouldn't be any harder than writing a reentrant function for a kernel.

    Congratulations, you've just reinvented monolithic kernel ;). Linux kernel really is just a bunch of library routines, some of which can be called by userspace programs and some by interrupts, and some setup code to set up the initial page tables, hook certain routines to run when certain interrupts are raised, and execute /sbin/init.

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  140. Re:Linus Quote - "not arguing against it at all" by lokedhs · · Score: 1
    I have to say that you are one of the more reasonable proof-advocates I've seen. You seem to have the kind of pragmatic approach to proofs that don't have any problems with.

    My point is that a formal proving process is not necessarily better than an ad-hoc code verification process in the respect that just because you can (using a tool, which we for argument's sake can assume to be bug-free) prove that your program conforms to a formally written specification doesn't mean that the code will work. All you have proved is that it conforms to the specification. You simply moved the potential for bugs from the implementation to the formal specification. The problem is that the formal specification is just as or even more complicated to read and write than the implementation itself. Not to mention the fact that very few people know how to express software designs in a mathematical notation rather than code, and even fewer people a actually prefer that notation to normal computer code.

    I think your last paragraph is the most correct one. The real benefit of the formal proving process is that it forces the reviewer to actually go through the code. There is no way to just gloss over the code.

  141. Get busy by SnarfQuest · · Score: 1

    I keep hearing that micro-kernals are the way to go, but nobody ever seems to be able to get one finished enough to actually try.

    Look at Gnu Hurd, which was started long before the original Linux 0.01 was begun. It has apparentry still not produced a kernal usable enough to build a distribution around. Not everyone starts out as a kernal hacker, but without any working examples to play with and learn from, you aren't going to breed any micro-kernal hackers either.

    Re-writing Linux to be a micro-kernal is the wrong way to do it. Linux was designed from the ground up as a monolithic kernal, and changing it to a micro-kernal would involve a total re-write to do it properly. You might as well start from scratch, with a clean micro-kernal design. The only thing you would lose is the magic "Linux" name.

    If you want to argue the micro-kernal issue, then get one of the existing micro-kernal projects, like Hurd, finished enough to base a small distribution around (i.e. to a Linux 1.0 level). At that point, it should be easy to attract others in expanding its usefulness.

    --
    Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
    1. Re:Get busy by zymano · · Score: 1
  142. OT, was Re:Windows is monolithic by Pope · · Score: 1

    You think the XBOX 360 is going to put both Sony and Nintendo out of business? What other competitors in the console business are there?

    --
    It doesn't mean much now, it's built for the future.
  143. Slashdot's text formatting options by Anonymous Coward · · Score: 0
    Well it doesn't, just select Plain Old Text from the dropdown box and skashcode will take care of that for you. In that mode you can still enter HTML code as usual with the advantage of not having to use

    or
    tags to break lines.

    You can also set it to default in your user preferences.

    And since you can't edit posts here, using the preview mode before posting is also a good idea.

    1. Re:Slashdot's text formatting options by Anonymous Coward · · Score: 0

      My god, useful criticism without a flame on slashdot. No wonder the temperature has been dropping recently.

    2. Re:Slashdot's text formatting options by Anonymous Coward · · Score: 0
      My god, useful criticism without a flame on slashdot.
      You suck! Cunt ass motherfucker!

      There. I restored balance to the universe.
    3. Re:Slashdot's text formatting options by Fujisawa+Sensei · · Score: 1

      He must be new.

      --
      If someone is passing you on the right, you are an asshole for driving in the wrong lane.
  144. Re:Linus Quote - "not arguing against it at all" by Tower · · Score: 1

    If your queue is unbounded (really a linked list), that could be avoided. What is functionally a queue doesn't always have to be a contiguous queue in memory.

    --
    "It's tough to be bilingual when you get hit in the head."
  145. I was a microkernel developer by r00t · · Score: 3, Informative

    I worked on a commercial microkernel OS.

    The learning curve was very steep. New developers took at least half a year to be productive. A number of people never became productive and had to be fired.

    Linux is really clean and tidy compared to that. Even BSD is clean and tidy compared to that microkernel OS.

    Separated components tend to get complex interactions. Sharing data can be very awkward, even if you are co-located.

  146. Re:Linus Quote - "not arguing against it at all" by ultranova · · Score: 1

    Well maybe that's how *you* would design *your* Microkernel. And yes, it would suck.

    Perhaps you should read again the text you quoted, and pay special attention to which process is the one that blocks. And congratulations to the moderator that thinks that a combination of condescension and incomprehension is Insightfull.

    Add some smarts for multiple devices, so multiple requests can be initiated at the same time to different devices.

    Why would you have a single server serving multiple filesystems ? One server instance per filesystem makes a lot more sense, since it's a simpler design and can more effectively use multiple processors.

    When data comes back, answer the requesting process with their data. Rather than sitting around blocking on a request, go grab more requests from other processes and queue them up. No need to block. When an initiated request comes back, send back the data to the requesting process, and everyone's happy.

    Well, except if you have a multi-processor machine, and 12+ processes are bombarding the poor filesystem server with requests faster than it can initiate them, at which point the queue starts building up. If I remember correctly, the biggest box Linux has been ran in had 1000 processors...

    Or if the server process is performing slowly because some other process with higher priority than the server but lower than the process that initiated the requst is robbing CPU cycles, then the initiating process is in effect being blocked by a lower-priority process. Not good.

    Monolithic kernel doesn't have these kind of problems, since the process that initiated the system call is also the one that executes it (in kernel context), and keeps its priority througout the syscall.

    And I never said that the server would block, but that the originating process would.

    When data comes back, answer the requesting process with their data. Rather than sitting around blocking on a request, go grab more requests from other processes and queue them up. No need to block. When an initiated request comes back, send back the data to the requesting process, and everyone's happy.

    Please understand the problem: it's not that the filesystem server would block, it's that a single-treaded filesystem server can be easily overwhelmed - run out of CPU power - in a multiprocessor machine with several threads making heavy filesystem IO. And the same goes for every other kind of single-treaded server, of course.

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  147. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    Wow! You're cool. How did you implement an unbounded queue (a truly unbounded queue that will never *ever* fill up). At some point won't the entire information capacity of the Universe (which is bounded) run out?

  148. Re:Linus Quote - "not arguing against it at all" by ultranova · · Score: 1

    That's a pretty big assumption. Or rather, you have basically taken all the hard parts of doing shared code and said "Let's hope someone else already solved this for us".

    Well, since Linux has in-kernel pre-emption these days, it appears they did :).

    Sooooo, it's easy to have someone else handle the multi-process bits in a monolithic design. But when it comes to writing services for microkernels suddenly everyone is an idiot?

    When did I ever claim either thing ? All I'm saying that an efficient microkernel is no simpler than an efficient monolithic kernel.

    Besides, as Linus pointed out, when data is going one way microkernels are easy. And in the case of file systems that is really the case.

    When I'm doing reads, request goes in and data or error code comes out. When I'm doing writes, data goes in and confirmation or error code comes out. Filesystem access is two-way.

    Sure multiple processes can access it at once, but the time scale on handling the incoming signals is extremely fast compared to waiting for data from disk.

    Unless the data happens to be in cache in an SMP machine, in which case a simple single-threaded server is going to be bombarded by multiple processes running on multiple processors at once, and run up a queue.

    And a multi-threaded server is no simpler than a monolithic kernel filesystem driver, and has some specific problems of its own.

    Only a really, *really* incompetent idiot would write such a server which blocked until the read was finished.

    Never underestimate the power of incompetence and architechtural purity combined. Just look at Hurd, with its filesystem servers that work by mapping the whole device into memory at once, and consequently are incapable of using a filesystem larger than a few gigabytes in a 32-bit machine. Dunno if they've got that fixed yet...

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  149. Re:Linus Quote - "not arguing against it at all" by chthon · · Score: 1

    There are things which cannot be proven : See this article in Scientific American.

  150. Re:Linus Quote - "not arguing against it at all" by Grishnakh · · Score: 1

    What argument for fascism? Perhaps you should go look up the definition for "fascism". The parent was talking about a benevolent dictator, which is entirely different. Fascism is where corporations control the government.

    Everyone already knows a benevolent dictatorship is the best form of government. The problem is finding truly benevolent dictators who have the correct leadership qualities, aren't selfish, really know what's best for their people, and don't get corrupted. The other problem with benevolent dictatorships is finding a replacement for the dictator when he dies who isn't a tyrant.

  151. Birds Flapping Their Wings by plantman-the-womb-st · · Score: 1

    This macro/micro kernel debate is starting to remind me of an old African proverb:

    Two birds disputed about a kernel, when a third swooped down and carried it off.

    While the debate is interesting, I rather wish someone would just implement either one, a combination of the two or some other idea that is new.

    --
    Say bad words about my book, in cold oatmeal, or I shall sue!
  152. Re:Linus Quote - "not arguing against it at all" by ChrisA90278 · · Score: 1
    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up.

    First off I agree with Linus, sort of. I think a hybred would be best. Take a lot of stuff out of the kernel if you can and put it inside it's own addres space. But "balance" and "compromise" is key here the answer is not black or white.

    Now to adress the above quote. A DBMS is exactly like a very complex file system. It has many clients reading and writing all at once and performance matters a lot. DBMSes typically run as processes and work well. You can do it by using the process per client method and "pre forking" some server process like Apache does so there is no start up delay. A file system would be a good thing to pull out of the kernel.

    I need to look at how Sun implemented ZFS. It is a 128-bit file system that includes the functionality of a volume manager and a RAID system all in one level. Theyu claim it is very fast beating even UFS while adding many, many functions

    I would put only hardware device abstraction and process managment inside a kernel but leave where exactly to draw the line up in the air. For example: RAID if you areusing a hardware RAID controller then clearly RAID can't go in userland but what if a user wants to concatinate a SCSI and SATA drive into one logical volume? That can't go into the driver? OK not black and white.

  153. Re:Linus Quote - "not arguing against it at all" by WhiplashII · · Score: 1

    Just to chime in here, I agree - and for those that don't see it: If the program can be proven to be correct via the specification (as input to a program), why not write a parser that takes the specification and generates the code (worst case, have a module that generates random code until the test passes)? If you did that, would we then be in the happy land of no bugs?

    What this is: we wrote two programs, and called one a specification. The two programs seem to do the same thing, so we think it is right.

    --
    while (sig==sig) sig=!sig;
  154. Re:Linus Quote - "not arguing against it at all" by ticklemeozmo · · Score: 2, Funny

    NFS.

    1) [root@compy1 /mnt/]$ mount compy2:/share /mnt/compy2
    2) Unplug cable (power or network) to COMPY2
    3) [root@compy1 /mnt/compy2]$ ls -la

    It will be done right when Duke Nukem: Forever finishes installing.

    --
    When modding "Informative", please make sure it both has a source and IS actually informative.
  155. Re:Linus Quote - "not arguing against it at all" by Grayputer · · Score: 1

    Oh, I agree that the smaller the blocks the easier it is to 'automagically' prove the code. I'll also agree that 20+ years of dev experience have taught me that small blocks are better even if we do not formally prove anything. Small blocks are more likely to be 'visually verified' by the developer and the follow-on developers, reducing bugs. If you can't hold the whole thing in your head, it is more likely to have issues. Compartmentalization is GOOD.

    But more code is more code, if you do not 'prove' the implementation. If compartmentalization reduces the errors per 1000 lines of code from X to Y, say 40% of the original value, you still can not claim a 60% reduction in bugs as the lines of code numbers are different in the different implementations.

    To pull numbers out of the air ... If you can get a 30% reduction in errors per 1000 lines via a method but you need 2 times the lines you net MORE errors. Assume a statistical 10 errors per 1000 lines and a project of 10,000 lines, that's a likely 100 errors. Now the improved methodology statistically has only 7 errors per 1000 lines (30% better) but the project requires 20,000 lines yielding 140 errors. Now 10,000 of those lines MIGHT be provably correct due to structure, but if you DON'T prove them you have to count them (I agree if you truly prove them you can remove them from the estimate, yielding 70 likely errors).

    As I said: In the real world people aren't proving the code, they are claiming it COULD be proven. BZZZZT, thanks for playing. You now have to count the extra code at the lower statistical error rate AND you have to pay the performance penalty. Sometimes the lower rate and the additional code does NOT yield a lower predicted error count so why do it. Sometimes it does yield a lower predicted error count, at a performance hit, yielding a real world trade-off.

    ALSO the compartmentalization frequently yields a 'lower exposure' per bug. In a mono kernel exposure is likely all of ring 0. In a microkernel an exposure is not always ring 0, sometimes ring 1 or 2, yielding a POTENTIALLY lower damage/risk. Whether it is ACTUALLY a lower risk depends on how the box/OS is used.

    Basically, the whole threat model changes. This leaves you with an apples and pears comparison, not apples to apples. The trade-off needs to understood and an intelligent decision needs to be made. Consequently stating that a general purpose computing platform delivered with a microkernel that has lower performance is better than a monolithic kernel that has better performance is a useless statement (apples to pears).

    If you understand the trade-off and the application environment you are applying it to, you can decide if you prefer the shiny apple or the shiny pear. It is NOT a choice between the shiny apple and the wormy apple.

    If you want a shiny apple vs. a wormy apple, give me a microkernel environment with better performance than the mono kernel that has less lines of code and a lower statistical error count than the mono kernel and I'll be happy to make the obvious/easy choice.

  156. Microsoft's singularity by jonathan_95060 · · Score: 1

    What I find most interesting about Linus' statement is when you look at Microsoft's Singularity project it twists the statement in knots:

    (1) it is about sharing memory spaces
                -- like a monolithic design, Singularity shares memory space

    (2) it is about the callee changing the caller's state as if it was
            his own
                -- singlularity uses a variety of mechanisms (primarily
                      compiler and shared memory messaging primatives) to prevent this.

    Singularity is quite revolutionary in that it attempts to adhere to the true microkernel principle (2) while discarding the traditional way of acheiving that principle (1).

    Damn, I hate the academic world for letting Microsoft create and patent Singularity! Why didn't MIT, CMU or Berkeley do this research first and put the results in the public domain!

    1. Re:Microsoft's singularity by julesh · · Score: 1

      MS did *not* beat academia to this idea. See research performed in the late 90's, e.g. here (postscript document -- google cached html version here).

      What they may have done is get the first working implementation, although I did first hear of people implementing this kind of system several years ago, I just can't find them now. There was a /. article about one, IIRC.

  157. Re:Linus Quote - "not arguing against it at all" by Sique · · Score: 1

    Congratulations! Someone actually got the joke!

    --
    .sig: Sique *sigh*
  158. Well, actually... by Anonymous Coward · · Score: 0

    .. *my* SparcStation 5 is running Linux

    Sorry Andy, thank you for playing!

  159. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  160. Re:Linus Quote - "not arguing against it at all" by DShard · · Score: 1

    Here is the whole article for those who don't have a sciam subscription. Thanks for the pointer to the sciam link,though!

  161. what would linus know? by nurb432 · · Score: 1

    Not a hell of a lot about modern microkernels..

    Now, ask him about a traditional old-fashioned monolithic kernel, he knows quite a lot.

    --
    ---- Booth was a patriot ----
  162. Kernal vs. Kernel by Anonymous Coward · · Score: 0

    What's the deal with poeple using the word "kernal" instead of "kernel"? Seriously, I find it really difficult to read through some comment or take people seriously when they use this word.

  163. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ? The calling process blocks, possibly for a long time if there's lots of other requests queued up.

    Do magic fairies make the request just happen concurrently without any queueing on monolithic kernels?

    Arguing that the calling process always blocks shows a complete lack of understanding of nonblocking I/O. You know, the kind that VMS was built on, and NT uses to good effect (it's about the one design decision it got dead-on right).

  164. Re:Linus Quote - "not arguing against it at all" by nuzak · · Score: 1

    > why not write a parser that takes the specification and generates the code

    Those are called compilers.

    Problem is, people write bad specs. And thus we get bugs.

    --
    Done with slashdot, done with nerds, getting a life.
  165. if ((a = malloc(size)) != 0) by tepples · · Score: 1

    If you really need to test if ((a = malloc(size)) != 0), then leaving in the != 0 suppresses the warning.

  166. OT: Moderation by Espen+Skoglund · · Score: 1

    How exactly can a post just containing the subject line "comments I liked" and a quote from the linked article be modded up as "insightful"? I mean, it's not like the poster actually added any actual insight beyond him stating that he liked that particular comment. Just curious.

    1. Re:OT: Moderation by bariswheel · · Score: 1

      haha...good point. Maybe the insightee thought that it was insightful of 'me' that i chose the quotes i did. Go figure.

      --
      Insinct is stronger than Upbringing - Irish Proverb
  167. Re:Trust (was Re:Plane OS) by Anonymous Coward · · Score: 0

    You have no way of knowing what exactly G-d wants you to do. It takes an incredibly conceited man to believe that he he understands all of G-d's motives - a human mind could not even understand a fraction of them. You? you just take your own motives and pretend that they're G-d's.

  168. Re:Linus Quote - "not arguing against it at all" by einhverfr · · Score: 1

    That is only done to prevent having the application handle the read errors. You can turn off that option if you want...

    --

    LedgerSMB: Open source Accounting/ERP
  169. Programs vs. specs by tepples · · Score: 1

    why not write a parser that takes the specification and generates the code (worst case, have a module that generates random code until the test passes)?

    Based only on a specification of the human auditory system and information theory, how would you expect a compiler to come up with MP3 or Ogg Vorbis or AAC or whatever?

    What this is: we wrote two programs, and called one a specification.

    The "spec" proves that a given end result exists. The "program" proves that it is computable. For instance, a "spec" may state that an array is sorted after the method Arrays.sort is called on it. A "program" describes the steps that the hardware takes to produce the end result, such as quicksort (partition through a pivot and sort each side), mergesort (partition halfway, sort each side, and merge the two sides), and heapsort (convert to a priority queue and repeatedly pop the smallest element). Proving this "program" correct involves proving that the means in the "program" produce the result in the "spec".

    Of course, the "spec" may itself be a "program" that describes the means to achieve a higher level "spec". Then what you have is a hierarchy of programs and specifications, and at the top is a "spec" of one page that the client has signed off on.

  170. Re:Linus Quote - "not arguing against it at all" by einhverfr · · Score: 1

    It ought to be obvious to anyone with an ability to look carefully at the industry that these approaches have different problems. High quality and well maintained operating systems have existed for decades that use either approach. The fact that the industry hasn't moved quickly to one or the other can only mean that there is a legitimate tradeoff.

    High quality microkernel OS's have included Amiga OS and Unicos/mk (which poweres Crays). I am sure we can all name well engineered monolithic kernel OS's...

    I suspect that in massively parallel fast interconnect environments (like a Cray), or in environments where there are certain parallelisms in the hardware (as we saw in the Amiga), microkernel systems probably have an edge. In these environments, you are essentially doing high performance distributed computing anyway, so why not structure your kernel appropriately?

    However, note that in these cases concurrency issues are not huge problems. Supercomputers were designed to do one computationally intense task as rapidly as possible, while in a server environment, you may have many simple tasks concurrently. This means either little shared information or a very large number of context switches. In essence, in the standard server environment, the complexity of the status information is likely to be more complex and more free-form. In these cases, it probably makes sense to manage it all in one address space.

    Note too that certain architectures, such as the DEC Alpha only have two rings, meaning that your drivers are either fully usermode or fully kernel mode and there is no middle ground. In these architectures, microkernels probably make no sense at all.

    --

    LedgerSMB: Open source Accounting/ERP
  171. done in 1961 by Jecel+Assumpcao+Jr · · Score: 1

    Damn, I hate the academic world for letting Microsoft create and patent Singularity! Why didn't MIT, CMU or Berkeley do this research first and put the results in the public domain!

    While it was a commercial product, Burroughs' Master Control Program (see http://en.wikipedia.org/wiki/MCP_(Burroughs_Large_ Systems)) is a great example of prior art, if that is what you are worried about.

  172. Computers are not Turing machines by tepples · · Score: 1

    It is impossible to decide whether a given Turing machine halts in the general case. However, results for Turing machines are not always interesting because physical computing machines are not Turing machines. Notably, physical computing machines lack unbounded memory. A better model for a computer is a linear bounded automaton. All LBAs can be converted into machines that always halt by running them in a virtual machine and looking for cycles in their states.

    1. Re:Computers are not Turing machines by davidgay · · Score: 1
      However, results for Turing machines are not always interesting because physical computing machines are not Turing machines. Notably, physical computing machines lack unbounded memory. A better model for a computer is a linear bounded automaton. All LBAs can be converted into machines that always halt by running them in a virtual machine and looking for cycles in their states.

      We have a winner for the ridiculous statement of the day. The statement is true, but so totally irrelevant as to be of no interest whatsoever:

      • your halting detector will indeed halt, but not in the lifetime of this universe for most programs (those 2^(2^40) states are going to be a problem to deal with)
      • something with an infinite loop leading to resource exhaustion will be decreed as halting

      David Gay

  173. Re:Linus Quote - "not arguing against it at all" by jelle · · Score: 1

    "Besides, as Linus pointed out, when data is going one way microkernels are easy. And in the case of file systems that is really the case. Sure multiple processes can access it at once, but the time scale on handling the incoming signals is extremely fast compared to waiting for data from disk."

    You're forgetting what happens on SMP and multicore systems: multiple processes will be accessing the filesystem at exactly the same time. And the filesystem in its turn will be accessing the block devices, and there will be multiple filesystems on each block device. Plus, the block device will be accesses by the pager/swap.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  174. Re:Linus Quote - "not arguing against it at all" by jelle · · Score: 2, Informative

    You choose for that filesystem call to wait forever.

    Try

    mount -o soft compy2:/share /mnt/compy2

    or

    mount -o intr compy2:/share /mnt/compy2

    instead

    man 8 mount

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  175. usefulness & correctness by Device666 · · Score: 1

    Soooo, something are usefull if they are at least correct and the program should be designed well to do what you want it to do. I agree it's becomes particulary handy when a program can respond to a meltdown effectively. But when it's not proven correct, then you also don't have any guarantee it will function reliable, which is also a kind of usefulness criteria for a nuclear reactor.

    Programs which take care of very critical tasks let us say, firing a nuke, should:
    1 should be described and clearly with painstaking detail
    2 have a wise and smart president
    3 have a nonambigeous usable user-interface (especially if 2 happens to be false. maybe a geographic quiz will do)
    4 be proven mathematically correct

    Wouldn't that be useful?

    1. Re:usefulness & correctness by Gorshkov · · Score: 1

      Where, in anything that I've posted, have I said or even implied that proving something is correct *isn't* a good thing?

      Please, read before you respond.

    2. Re:usefulness & correctness by Device666 · · Score: 1

      OK let me rephrase. Programs should always be performing tasks as they are designed to do. So that is no object of discussion. But I also tried to bring something else across which I hope does contribute to focus the discussion on topic. This discussion is related to micro and monolithic kernels. Which bring me back to the discussion: there are so many criteria of how a microkernel could be better or a monolithic kernel would be better, the article is I hope more relevant to the criteria being used in the discussion. But it is sure nice to read people try to prove correctness of software made for nuclear reactors, using microkernels. I guess proving the linux kernel being correct would be a very hard thing to do pragmatically, especially if you don't strip that kernel down to 10k lines of code.

    3. Re:usefulness & correctness by Gorshkov · · Score: 1

      Yes, it was - but the shutdown system had nothing to do with a microkernel. As a matter of fact, it essentially didn't *have* an operating system at all. (Don't go there, folks - I know that that's not strictly true). And you don't want me to tell you how it was structured, either - it was the must #@($*&#@ up piece of code I have ever seen in my life. Absolutly unmaintainable .... but it was proven to be correct.

      Let me restate the point I was trying to make with my original post.

      Tannenbaum says micro good, mono bad. This is based on the design elegance and simplicity of the microkernel architecture. If that was the ONLY criteria for judging the worth of an operating system, I would agree with him. But it's not.

      This is where the shutdown system came in, by way of example.

      Parnas's notation enabled us to prove that the system was mathamatically correct, but still didn't tell us if the system would do the job, because it ignoreed the time domain - the constraints the shutdown system had to work under.

      My point was that Tannenbaum is doing the same thing - he's ignoring OTHER criteria that are important for an operating system - mainly, performance, and the ability to handle the workload.

      The difference between the two systems is that Parnas' notation didn't *claim* to prove suitability for the task - just that the programme was mathamatically correct. Parnas didn't ignore the timing constraints the shutdown system had to operate under - he simply didn't address that particular constraint, and left it for other methods. Tannenbaum, on the other hand, is trying to pretend that those other constraints just simply don't exist.

      Yes, it has been in interesting thread, and I've enjoyed it ... but my intention was to use it to illustrate a point, not to be a topic in and of itself.

      Regarding being able to prove that Linux was correct - I don't think it would be that difficult. Don't get me wrong - it would take a VERY long time, and would make even the most ardent techie's head explode from the effort. But the notation Dr Parnas developed that we used was designed to "roll up" .... once you had proved the correctness of one particular routine, you didn't refer to the resulting 6 or 10 or 15 lines of proof again - you simply plugged in the top most line - the one that proved the correctness of that particular routine - into the calling routine .. lower-level proofs just dropped off the bottom, so to speak.

      This was also what - 20 years ago? I'm sure that notations, and idea like that, have come a long way since then.

      In programming terms, his notation wasn't much more than a very high-level psudo-code that you used to construct a description of an existing system.

      So conceptually, proving that Linux was correct (or not) would be about the same degress of difficulty & effort as reading the kernel code, and transcribing (not re-writing) to Pascal, or C++, or some other language. I know, I know - please don't start a flamefest over that statement. I'm trying to illustrate the size of the effort, and simply show that it WOULD be doable, even if it isn't particularly practical.

    4. Re:usefulness & correctness by Device666 · · Score: 1

      What I fail to understand is why there is no real academic debate and instead there is some flamewar going on between Andy and Linus, which seems to be some kind of ego problem of Andy (he got all the explosives in place, which Linus could't refuse to ignite). For me the original post on usenet was a lot of talk about something, but too much competing ego's and no constructive debate. Most of the constructive replies where I think from other people and not so from Linus or Andy. For that sake, I think Linus did quite well making a thing like a linux kernel as a student, especially because he made his code free (eventually). I don't see the reason for Andy to start a flamewar. At least he gave credits to Linus to start discussing Linus kernel. But I often get annoyed by Linus unnuanced in-your-face mentality (binary attitude). However I have much to thank him for. If he wasn't there I probably had to join the Hurd project to get some GPL Microkernel to eat up my resources, led by another in-your-face guy.

  176. "One should never, EVER ..." by oldCoder · · Score: 1
    "One should never, EVER attempt to optimize code on the first pass."

    Sorry, that's too strong. Or misleading. It's no longer the first pass. We're well onto to our 10th or 100th pass, with kernels and operating systems. We're not trying to build the first one. We're trying to build a better one. That means analyze the old to build the new.

    That would be like saying the folks coding weather prediction or climate models should code it first in javascript or ruby and then "Optimize" it into FORTRAN "Once the bugs are out". You can't really build a monolithic OS and then optimize it into microkernel. That's a pretty big refactoring!

    --

    I18N == Intergalacticization
    1. Re:"One should never, EVER ..." by guitaristx · · Score: 1

      Agreed, maybe it was too strong. (Love the sig, BTW). However, the underlying concept remains. The microkernel is still more architecturally sound than a macrokernel, even if it has obvious performance issues. You can optimize out performance issues. It is much, MUCH harder to retrofit wise architectural decisions than optimizations.

      --
      I pity the foo that isn't metasyntactic
  177. Just to clarify... by SanityInAnarchy · · Score: 1

    That was sarcasm.

    --
    Don't thank God, thank a doctor!
  178. Sigh... by nomego · · Score: 2, Funny

    I don't really give a fork.

    1. Re:Sigh... by chawly · · Score: 1

      Liked your post - still laughing.

      --
      How many beans make five, anyhow ? ... Charles Walmsley
  179. Re:Linus Quote - "not arguing against it at all" by drgonzo59 · · Score: 1
    I was talking about viruses and Quake to exemplify the extreme tendency of home desktop consumer to completely overlook the security aspect. But whatever kernel linux would be running it would be running on a box that games would be played at home but it would also supposedly might be used in mission critical situations. As the grandparent pointed out, there is a tendency for servers to become more "mission critical". So then the question becomes, who should Linus try to satifsy? Most would say -- the home users of course, but I don't agree. The speed argument, which was the initial argument against microkernels back in the day, was valid. A 33MHz machine couldn't not cope with a mouse driver that would need at least 30 context switches per second in microkernel architecture, but today a 3GHz Pentium IV might cope with it fine. I think if people were properly educated and would be explained clearly that they would be getting a more secure system, they would be willing to way another second for the browser to open. Next year, they'll upgrade and they'll be running faster anyway.

    The "hard to code" argument is partially valid, but I think the developers are not "stupid" and could cope with it. Linus goes a long way to show that microkernel are not easier to _develop_ -- I don't think that was ever the case though. Micro- doesn't mean simple.

  180. There's a name for that. by Anonymous Coward · · Score: 0
    10GHZ, on the Hurd:
    They switched kernels AGAIN? [...] No wonder that they never get it finished, since every two years they seem to drop their current work, and move on to something "better".
    Babbage Syndrome
  181. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    The spec is just a description of desired properties of the program. For example:

    - "The program never accesses unallocated memory"
    - "The function always returns"
    - "The result of the function foo has has relation bar wrt. the input"
    - "These processes never end up in deadlock"
    - "Resource starvation will never occur"
    - "The program will never crash"

    and so forth. Automatically proving such properties for your program is not comparable to "trying it for a lot of different input, really". Especially for concurrent programs, many bugs are really difficult to reproduce and only occur under special circumstances. If you can prove that your program is "correct" in one of the above senses *for all possible input*, i.e. *no matter what*, then you have done something entirely different (and a *lot* more) than testing it.

  182. Re:Linus Quote - "not arguing against it at all" by Harik · · Score: 1
    Also, you can't travel in time because DT/DT = 1, but since the entire universe is just information you can move instantly to any point in space by corrupting your X/Y/Z pointer. Quantum mechanics is wrong because I don't understand it, and electric current flow powers the sun.

    Did I remember all your crackpot theories? I recognized them instantly, and your website linked in your sig confirmed it was the same bullshit again.

  183. Re:Linus Quote - "not arguing against it at all" by jelle · · Score: 1

    "the ability to prove (even mathematically) that the kernel is correct. " "That is why critical real-time OSes are often based on a microkernel which is only about 4000-8000 lines of code. Even at that size is might take years to prove it does what it is supposed to do."

    That doesn't help you. What you're saying is: strip off all drivers from the kernel, so you can prove the kernel is correct.

    So what if a filesystem driver corrupts the data when the microkernel schedules it in a certain way compared to the block device driver and the swap/pager? You still have to prove all the driver, and you still have the same complicated real-life the driverkernel interactions as without a microkernel.

    "critical real-time OSes" make things more reliable by not allowing the system to do many complex (and therefore potentially dangerous) things in parallel. Single tasks running in sequence, programmed to execute with guaranteed run-times can be extremely predictable (thus reliable). That can reduce the number of fault cases, but it's not guaranteed that allowing the complexs situations to occur adds fault cases (that is a likely possibility, but not a guarantee), but what is guaranteed is that the microkernel approach takes away performance.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  184. Re:Linus Quote - "not arguing against it at all" by MOBE2001 · · Score: 1

    This is lame. It's dishonest to put words in somebody's mouth that they did not speak or make claims on their behalf. May your karma catch up with you. ahahaha...

  185. Re:Linus Quote - "not arguing against it at all" by pthisis · · Score: 1

    And traditional monolithic kernels are buggy, and unreliable. This too has been proven time and time again. The important question is: what's more important to you, development speed, or reliability?

    It's a balance between the two, and in real life the fact that people were choosing Windows 98 over more stable alternatives shows that features (achieved through faster development) are generally preferred over absolute stability.

    But in real life, monolithic kernels tend to be more reliable than microkernel systems with equivalent features anyway, so it's not really a question of making that tradeoff by choosing microkernel vs. monolithic kernel; the fact that you can develop faster also means you can fix bugs faster.

    The only reason people have a perception of microkernels being more stable is because microkernels are so hard to develop that they tend to stagnate feature-wise, and all stagnant systems that are still maintained tend toward bug-fixing and stability.

    Hence all major consumer OSes are monolithic. Some start off with a microkernel approach, but they all move to a monolithic approach (see: MacOS X, Windows NT/XP).

    Even most complex embedded systems are monolithic; they'll claim that there's a microkernel, but often that's basically a lie and there's a micro-supervisor that takes care of scheduling 2 monolithic kernels (one for "critical" stuff and the other for bells and whistles), which is really not very different from, say, RTLinux.

    Now, for simple systems microkernel systems are often an excellent choice. But I haven't seen a single one that competes on a per-feature basis with major monolithic kernels successfully without essentially scheduling a monolithic kernel to support all the interesting stuff; QNX is probably the closest, but it's a pretty far cry from a modern Linux, BSD, XP, or MacOS X system feature-wise.

    --
    rage, rage against the dying of the light
  186. Re:Linus Quote - "not arguing against it at all" by jelle · · Score: 1

    "Here, it seems, the means justify the ends. Linus basically says "I won't take any challenges"."

    Nope, he is making some pretty bold statements that tell the microkernel people 'go ahead, build it and show me wrong'.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  187. Re:Linus Quote - "not arguing against it at all" by ghettoimp · · Score: 1

    "The problem is that the formal specification is just as or even more complicated to read and write than the implementation itself." Certainly not all is roses with formal verification. Few people have the mathematical background, experience, desire, time, etc. to make much use of formal verification, and even experts have to do a lot of work to prove anything interesting about real programs, and expertise + time is costly. But, I don't agree that specifications are, on the average, as complicated as their implementations. For example, imagine a system for implementing a potentially very large but sparse array. It might be quite complex in order to be efficient. But its interface might be quite simple (i.e., "load" and "store"), and correctness properties might be very succinctly stated, e.g., load(addr1,store(addr1,val,mem)) = val, addr1 != addr2 -> load(addr1,store(addr2,val,mem)) = load(addr1,mem) store(addr1,load(addr1,mem),mem) = mem store(addr1,val1,store(addr1,val2,mem)) = store(addr1,val1,mem) addr1 != addr2 -> store(addr1,val1,store(addr2,val2,mem)) = store(addr2,val2,store(addr1,val1,mem)) In cases where properties like these are not easy to state or prove, it may still be possible to show that some convoluted but efficient program behaves the same as another program which is very simple but would be too inefficient to use. These sorts of proofs add a lot of value, because you can now just consider the correctness of the simple but inefficient program.

  188. Re:Linus Quote - "not arguing against it at all" by Hard_Code · · Score: 1

    To me, it comes down to the fact that if you want to build really robust systems, guess what, you have to deal with that "decentralized" problem. It doesn't go away. A local display is a lot simpler to create. A distributed display, like X11, is a lot more complicated, but opens a new world of possibilities. Same goes for everything else: distributed disk, distributed compute resources, distributed input devices (multiple keyboards, mice, anyone?), distributed screens, distributed media production/consumption (phonon, nimm: http://www.linuxdevices.com/news/NS5209121793.html ).

    So eventually you have to solve the problem. Might as well drive the solution straight to the core of the kernel so it can handle these situations natively.

    --

    It's 10 PM. Do you know if you're un-American?
  189. Re:The problem of sharing must be solved at CPU le by jelle · · Score: 1

    "If a 32-bit address falls within the current segment, then the instruction is executed, otherwise a new segment is loaded from the address and a security check is performed."

    checking "falls within" for each memory access? That is not a simple operation in hardware. The data structures for the segments are also likely to be pretty large.

    That would take quite a lot of registers and logic to make that run at 3GHz (cache doesn't run that fast, so all data would have to be in registers). Be prepared to have to accept significantly higher power consumption and prices for processors that do that.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  190. Singularity follows this approach by Anonymous Coward · · Score: 0

    You don't need to have separate address spaces for your objects. You can solve this problem with language-based technologies and get better performance too.

    See Deconstructing Process Isolation
    Mark Aiken; Manuel Fahndrich; Chris Hawblitzel; Galen Hunt; James R. Larus. April 2006
    Most operating systems enforce process isolation through hardware protection mechanisms such as memory segmentation, page mapping, and differentiated user and kernel instructions. Singularity is a new operating system that uses software mechanisms to enforce process isolation. A software isolated process (SIP) is a process whose boundaries are established by language safety rules and enforced by static type checking. With proper system support, SIPs can provide a low cost isolation mechanism that provides failure isolation and fast inter-process communication. To compare the performance of Singularity's approach against more conventional systems, we implemented an optional hardware isolation mechanism. Protect domains are hardware-enforced address spaces, which can contain one or more SIPs. Domains can either run at the kernel's privilege levels and share an exchange heap or be fully isolated from the kernel and run at the normal application privilege level. These domains can construct Singularity configurations that are similar to micro-kernel and monolithic kernel systems.

    The paper concludes that hardware-based isolation incurs performance costs of up to 25-33%, while the lower cost of SIPs permits them to provide protection and failure isolation at a finer granularity than conventional processes.

  191. Re:Linus Quote - "not arguing against it at all" by naasking · · Score: 1

    But in real life, monolithic kernels tend to be more reliable than microkernel systems with equivalent features anyway, so it's not really a question of making that tradeoff by choosing microkernel vs. monolithic kernel; the fact that you can develop faster also means you can fix bugs faster.

    I think you should review your history. In particular, investigate KeyKOS back in the early 80s, a microkernel-based operating system which operated for decades, and which hosted a fully binary-compatible UNIX environment. I would say that qualifies for a system of "equivalent features", and KeyKOS was much safer, much more reliable, and far more secure than any monolithic system you'll find in existence then or now.

    The reason monolithic kernels are more prevalent is that the kernel development model is so much simpler, that even hobbiest and newbie programmers can experiment with it (and it sometimes shows in open source kernels). Microkernel development (the actual kernel) is simply harder because appropriate tradeoffs demand much more architectural and hardware knowledge from the developer.

    I don't see how the userland development need be any more complicated for microkernels than monolithic. Plenty of microkernels, both old and new, have provided unix environments; granted, some of those were no safer than their unix counterparts, but that is a matter of proper design and not an inherent limitation of the core microkernel architecture (see KeyKOS, Xen, L4).

    QNX is probably the closest, but it's a pretty far cry from a modern Linux, BSD, XP, or MacOS X system feature-wise.

    Only because it's not targeted for the same market. Their preview desktop release a few years ago was still quite impressive.

  192. Re:Linus Quote - "not arguing against it at all" by mrogers · · Score: 1

    ;) Fair point, but in a monolithic kernel all the library routines share the same address space and run in supervisor mode. I'm talking about userspace libraries that would have access to the address space of the calling process but not vice versa. Maybe the similarity to a monolithic kernel would make it easier to convert existing kernel modules into libraries?

  193. Tractability may in fact follow by tepples · · Score: 1

    your halting detector will indeed halt, but not in the lifetime of this universe for most programs

    It was an upper bound.

    A lot of people who post to Slashdot and elsewhere are unfamiliar with the definition of a Turing machine or its implications, especially the difference between Turing machines and the machine in front of them. They like to discount the possibility of correctness proofs on the basis that just because "the halting problem on a Turing machine is undecidable" that the halting problem on a real computer must be undecidable. In fact, there exists a worst-case decider for all real computers that reduces the impossible to intractable. From there, a bit more research may result in a practical program prover that can reject most of those 2^(2^40) potential states.

    An example of a problem for a program prover:

    Given: some source code for Quicksort, Array A[0..n-1]
    Prove: Quicksort(A) returns within k*n*n + C instructions for some constants k and C. (Called "worst case O(n^2) time".)
    Prove: After calling Quicksort(A), there exist no integers 0 <= i < j < n for for which A[i] > A[j]. (Called "correct sorting behavior".)
    1. Re:Tractability may in fact follow by EvilSporkMan · · Score: 1

      I'm confused about your first example claim (labeled "Prove"). I was under the impression that stating that the number of instructions used by quicksort on the n-element array under discussion (call it I(n)) is O(n^2) is the statement that for n>C, I(n)= 0. If we substitute m = n-C, we have: for m>0, I(m+C) = k*((m+C)^2), but it's not obvious to me how you can cope with the shift for I(n) and the O(n) terms on the right side of the inequality.

      --
      -insert a witty something-
  194. Re:Linus Quote - "not arguing against it at all" by sploxx · · Score: 1

    Arguably it's not really relevant either. "proving" a software program only proves that the programs conforms to the spec. Now who proves the spec? And who proves the proof?

    Mod parent up.
    You're friggin' correct. Going even further, you would have to prove the correct functioning of a circuit at the individual transistor level. An what if a cosmic ray hits?

    Sure, proofs may help to investigate code more thoroughly. But so do unit tests and other measures.

    I think the whole 'proof your code' issue comes from those computer scientists which take the way math -> CS and not physics -> CS. No question, the former group of people is important for theoretic computer science. But some of them forget that a computer is a real, physical device. And most of the pen-and-paper mathematical work in CS someday lands on real physical devices.

  195. Modern desktop computers are old by tepples · · Score: 1

    modern desktop computer

    Modern desktop computers are a mature industry running on razor-thin margins. The next big profit center is handheld devices of some sort. Is it straightforward to get Windows to cross-compile a Linux kernel for a handheld device?

    1. Re:Modern desktop computers are old by Anonymous Coward · · Score: 0
      Is it straightforward to get Windows to cross-compile a Linux kernel for a handheld device?

      Well... I've got bad news, and good news, and a question.

      The bad news is: no, it's not straightforward.

      The good news is: There are at least a few people who have already figured it out.

      The question is: What's your time worth to you?

  196. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    Specifications are often simpler than programs.

    Write a network driver sometime, the program is simple, the spec is horrendous (lists of registers and 'expected behaviour' of the hardware) the proof, almost impossible (vast numbers of settings and conditions).

    Specs for things inside an operating system are usually much easier to test, all the interfaces go to known code, in the case of hardware and the wild world outside of the computer, who knows.

  197. Re:Linus Quote - "not arguing against it at all" by joto · · Score: 1
    You seem to completely ignore the main reason for using a microkernel -- the ability to prove (even mathematically) that the kernel is correct.

    Ah, you mean to prove that the microkernel is correct. Which is all fine and dandy. But pretty useless, considering that about the only thing of any value a microkernel does, is managing processes, memory and IPC. Without a gazillion other drivers/processes/whatever, your microkernel is useless, and with a gazillion drivers/processes/whatever (all communicating in a nonobvious distributed manner), your proof is useless.

    That is why critical real-time OSes are often based on a microkernel which is only about 4000-8000 lines of code.

    Hmm, and here I thought most real-time operating systems were basically a boot-loader, a C library, usually a scheduler, and some way to link the OS with your app. Sure QNX is cool and all, but it's hardly a typical representative of real-time operating systems.

    If the same happens in the microkernel system, the kernel will reload the driver, raise an alarm, or in general -- be able to take the system to a predictable predetermined state. Going back to the analogy is it is like having the dictator execute a corrupted staff member and replace him immediately.

    If the driver is so flaky that it constantly fails and needs to restart, maybe you should look at the driver for the solution to your problem, instead of building a complicated microkernel just to have a restartable driver. If the driver is stable, then how the fuck are you supposed to know that this restarting magic actually works?

    Good thing if the system was only running Doom at the time and not controlling a reactor, or administering a drug.

    If it was a hard realtime system (as reactor/drug implies), then you have already lost. Your driver failed, and no matter how flawless the "restarting driver"-magic is, you have already broken you real-time deadline.

  198. Re:Linus Quote - "not arguing against it at all" by joto · · Score: 1
    As a pedagogical example, the notions of "ordered" and "permutation" are simpler to express than the code for most sorting algorithms.

    Bzzt, wrong! Quicksort is almost a one-liner. In C, you might get 5 or 6 lines, but it's hardly difficult.

    Contrast that with saying in a formal way that the output (Y) of qsort is an ordered permutation of the elements given as input (X).

    Assume:
    Y = quicksort(X),
    X element-of int-sequence,
    Y element-of int-sequence, and
    n = length-of X
    then:
    n = length-of Y
    for-all i element-of 1..n exists j element-of 1..n such-that X_i = Y_j
    not (exist j element of 1..n such-that for-all i element-of 1..n X_i =/= Y_j)
    for-all j element-of 2..n Y_{j-1} <= Y_j

    Note the extremely convoluted way of telling that Y was a permutation of X (I'm not even sure it's sufficient). In contrast, telling that Y is sorted was easy. Now you have to prove it.

    Personally, I'm pretty much convinced by this example that informal proofs are the best. Let's prove that Y is sorted, and don't bother about proving that Y is a permutation of X, because that is "obvious" by inspection.

  199. Re:Trust (was Re:Plane OS) by hackwrench · · Score: 1

    If we accept the premise that even a very narrow definition of God in which (he, she, it) exists, then why would it not well within his ability to provide a way for a person to know what it is God wants that person to do? People themselves are capable in varying degrees of communicating to others what they want in an imprecise manner. For one person to work towards what God wants him to do, it does not require that he know all of God's motives, just the ones that involve that person. It seems to me that I do much more than take my own motives and pretend that they're God's, I take a look at what motives I could take as my own and figure out whether or not they are from God. I also start with the premise that God wants to drive out evil, and then look for what will drive out evil, wherever it lies, in me, in another person, or in something else altogether. Once evil is driven out, what remains is of God.

  200. Re:Linus Quote - "not arguing against it at all" by drgonzo59 · · Score: 1

    So why do the makers of real-time OSes spend months to get their products certified for covert channel analysis. How silly of them to do that, they should really just forget it because cosmic rays will come down and burn the transistors anyway, right?

  201. Re:Linus Quote - "not arguing against it at all" by putaro · · Score: 1

    Fundamentally, if you care about scalability, you need locking for managing your resources, regardless of whether you have a microkernel or a monolithic one, because the on-disk data structures are a shared resource.

    You need locking if you want to have things run in a multi-threaded way. However, I would argue that it is much easier to design and manage your locking protocols when you (you includes the development team for your server) are the only ones who have to really understand them and use them.

    With this, you reduce the chance that code outside of your driver but inside the kernel could write to your driver's address space, which isn't, in practice, a common occurance, because other code generally won't have pointers that go there.

    When a pointer can be created from an integer and when you have functions like "strcpy" which will run happily through memory if you don't have a terminating null, you have a lot of chances for other code to overwrite your data structures. What is this "your driver's address space" you speak of? Doesn't exist in a monolithic kernel. You might have pre-allocated a bunch of space for yourself to use, but it all comes out of the common pool(s) and it's all in the same address space.

  202. Obvious problems with R, MySQL "benchmarks" by tlambert · · Score: 1

    Obvious problems with R, MySQL "benchmarks"...

    I've posted about MySQL's problems before; they could get about a 15% performance improvement on Linux and a huge performance improvement on MacOS X just by pipelining their requests. This would require a library change (2/3s of the improvement) and a change to the way requests are dequeued on the server (about 1/3).

    The R problem is 50% him not passing "-O2 -fstrict-aliasing" to the compiler, and 50% him using the system malloc instead of dlmalloc like it says to use in the R admin manual.

    I have to agree with the parent poster on this one; I wouldn't have said things quite that way, but then the guy who did the R "benchmark" was pretty inflamatory in his comments, too.

    -- Terry

  203. Microkernel better for Berserkers by Anonymous Coward · · Score: 0

    Based on recent research, a microkernel approach will be more suitable for highly distributed and expandable self-aware and self-replicating computer-based lifeforms. As we develop the technology to replace ourselves and create the ultimate race of Berserkers, Linux will be replaced as the O/S of choice by a more partitioned and distributed microkernel based on a future version of L4 merged with Mach.

  204. Throw Hardware At It by bill_mcgonigle · · Score: 1

    "The fundamental result of access space separation is that you can't share data structures. That means that you can't share locking, it means that you must copy any shared data, and that in turn means that you have a much harder time handling coherency. All your algorithms basically end up being distributed algorithms. ... on typical modern hardware. I can imagine hardware which would support these tasks to make them fast and easy. Before you guffaw too loudly, remember linux would only run on hardware with a MMU for quite a long time.

    I wonder if any of Intel's VT instructions could be tickled for something like this (I don't know enough about it).

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  205. How about contexts in hardware? by Anonymous Coward · · Score: 0

    This post was up earlier: http://www.computer.org/portal/site/computer/menui tem.5d61c1d591162e4b0ef1bd108bcd45f3/index.jsp?&pN ame=computer_level1_article&TheCat=1005&path=compu ter/homepage/0506&file=cover1.xml&xsl=article.xsl&

    and what struck me is how many of these problems go away if the hardware context is encoded in the PTP/PTE for a page of memory. SPARC does this. Contexts could be created for drivers and the driver could address only that set of pages of memory, and not the whole kernel.

  206. Re:Linus Quote - "not arguing against it at all" by Anonymous Coward · · Score: 0

    WRONG. If the bug is in the interrupt handler, it will freeze any AMD64 or x86 system due to architecture limitations...

    Which is why the interupt handler is part of the microkernel. If the microkernel has been proved correct, the interupt handler is bug free.

  207. Re:The problem of sharing must be solved at CPU le by master_p · · Score: 1

    But 80x86 processors already do the job of checking if memory addresses fall within the current segment; and not one segment only, but one of the CS, DS, SS, ES, GS and FS segments of each process, depending on instruction. These processors also have a segment descriptor table which is read each time there is a kernel call (which is 99% of what a program does anyway, since windows messages are generated from the kernel); and each kernel access goes through a 'double-dispatch' ring protection check mechanism which reads two entries of the segment table: one for the ring, and one for the target segment. So I do not see any big performance hit.

    There is also another technique that the Motorola 68020 used (as indicated by another post). It goes like this: each procedure is marked with an entry point which defines the attributes of the current module (base address, limit, access type). Each time a CALL instruction is executed, the CPU pushes the old module description in the stack and loads a new module descriptor from the destination address. Upon return, the module pointer is restored from the stack contents. This can be applied on 80x86 with minimal cost: the entry point of each procedure shall be the id of the segment descriptor of the module. Each time there is a call, the register CS is pushed to the stack, and then is loaded with the value found in the destination address, while at the same time an access check is performed. The call instruction can be special (like MC68020's CALLM), so as that the current code is unaffected; all that is needed is for the O/S linker to patch each exported procedure's entry point with its segment id, and replace the instruction CALL with CALLM for each call to an exported procedure defined in a dll/vxd/so/other module type.

  208. I'd fly that plane by Anonymous Coward · · Score: 0
    Would you get on a plane that is flown by Linus' latest 2.6 monolithic kernel? Could it be because a bug in one of the hundreds of drivers might lock up the system and you'll crash and die?


    IF these N x 100 drivers are compiled into the plane, they're probably critical to the system, no?

    Your proposal of a checked microkernel with unchecked user-space drivers is better how? Your plane will certainly allocate memory and schedule processes correcly, all the way into a mountain.

    The microkernel running the same hardware as a monolithic one will be bigger. It's more complex by design. If, on the other hand, all you need is one or five processes calculating speed & altitude, then the microkernel vs. monolithic argument is just insane. You don't run N x 100 drivers and play mp3:s on a plane's computer.

    For just a few processes a monolithic approach is probably best. You have less code to look after. At some point you reach a level where you can't trust all your code, but some drivers are not nessesary for the critical operation. That's the spot for a microkernel. When you continue to buld an even more complex system, which is to do alot of things, you suddenly find yourself with so many critical operations that you simply can't manage them all; then you move back to monolithic, because it's less code.
  209. Re:Linus Quote - "not arguing against it at all" by rew · · Score: 1

    do some asynchronous juggling to be efficient.

    Ehhhm. This is exactly the complexity that you're trying to avoid in a microkernel.

    You want central services to take the complexity out of the different drivers.

  210. Re:The problem of sharing must be solved at CPU le by jelle · · Score: 1

    CS/DS/SS/ES are from the 16-bit time. (and btw, they were a bad idea then, so doing something like that again is bad now too). When processors were 16-bit, they had a lot less memory than they have now. Today, those couple of registers are not going to be enough.

    Did you notice that for each definable segment, there is a separate register? That is because only registers are fast enough.

    Adding stack (memory!) operations to each function call slows down things a lot too.

    "while at the same time an access check is performed"

    What you're missing is that calls are all over the code, at many different addresses, so to do an 'access check' requires an add an a subtract for each possible active segment. That is a lot of operations.

    Seems to me that everything you're talking about is best done completely in software.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  211. Re:Linus Quote - "not arguing against it at all" by ticklemeozmo · · Score: 1

    huh. I really had no idea about that.

    Thanks :)

    --
    When modding "Informative", please make sure it both has a source and IS actually informative.
  212. Re:Linus Quote - "not arguing against it at all" by anandsr · · Score: 1

    I think you mis-understand. Monolithic is like a central dictatorship. When there is a benevolent dictator it works well, but in case of a bad one you get a mis-managed affair, where everybody is destroying things for everybody else. While Micro-kernel is a Burocracy, where the system is trying to keep everybody from hurting everybody else. This results in lots of inefficiencies. The system is useful because it works with the normal human greed, being compartmentalised. But a benevolent dictator is the most efficient solution, and it does work in the Open Source world. I would recommend Microkernels for Proprietory systems where many companies where going to work on adding features to the micro-kernel. This is exactly where QNX rules.

  213. arborescence by booch · · Score: 1

    I thought you were making that word up! You weren't.

    --
    Software sucks. Open Source sucks less.
  214. I agree, of course. by Futurepower(R) · · Score: 1

    I posted Linus' comment, and I agree, of course. I've sometimes spent 15 minutes writing a comment I thought was useful, and been moderated down to -1.

    Now I seem to be getting credit for Torvald's thinking.

    Or, maybe I was moderated up for having the brains to re-format what Linus said so that it is more readable?

  215. Re:Linus Quote - "not arguing against it at all" by pthisis · · Score: 1

    I think you should review your history. In particular, investigate KeyKOS back in the early 80s, a microkernel-based operating system which operated for decades, and which hosted a fully binary-compatible UNIX environment. I would say that qualifies for a system of "equivalent features"

    Great example.

    By design it was impossible for KeyKOS to support variable-sized inodes or disk blocks, partition resizing, etc. Even removable media (floppy disks) were a horrible kludge that often threw the object store into an inconsistent state.

    Working core dumps (and I'm talking of user applications, not the kernel) were completely impossible under the KeyKOS design, making debugging very difficult (and they tried to spin that as a positive!).

    The checkpoint/transaction manager was a performance nightmare once you had to scale to multiple concurrent processes; single process (which were all KeyKOS generally published benchmarks for, aside from a well-known carefully constructed transaction benchmark explicitly designed to make sure that only completely independent data was ever written to the system) were pretty efficient, but tangled references quickly forced the set of objects that needed to be committed to the ENTIRE SYSTEM once you had a fair number of processes running at once. Disk usage was incredibly inefficient.

    Moreover, the checkpoint system wasn't ACID compliant so you didn't get anything useful for all that complexity; in crash recovery situations, a transaction that had already been committed could be replayed multiple times (causing data inconsistencies or worse).

    I could go on, but the major point is that all of these problems stemmed directly from the design of the KeyKOS microkernel, and the barriers to solutions were ones that would not have existed in a monolithic kernel.

    None of those problems were easily soluable, and the attempt to improve the system in EROS wound up in a development rathole that was eventually abandoned because of systemic complexity and severe performance problems. Attempts to follow it up (notably CaprOS with the EROS code, and Coyotos recoding the design from scratch) also have achieved little to date.

    --
    rage, rage against the dying of the light
  216. Re:Linus Quote - "not arguing against it at all" by naasking · · Score: 1

    By design it was impossible for KeyKOS to support variable-sized inodes or disk blocks, partition resizing, etc.

    KeyKOS had no notion of inodes or diskblocks, it had a single-level store. Files and filesystems were implemented by processes that operated on red-black trees. There is nothing in the design the precludes the features you mention. Unless of course, you are discussing how to manage storage add/remove disks, etc. when using a single-level store. This is a completely separate issue from microkernels and the KeyKOS architecture.

    Even removable media (floppy disks) were a horrible kludge that often threw the object store into an inconsistent state.

    Once again removable media are sometimes a problem for single-level stores, not for microkernels or KeyKOS/EROS in particular. I also highly doubt your claim of inconsistency, as the developers were very careful to avoid those ends, so please provide a pointer to validate this claim.

    The checkpoint/transaction manager was a performance nightmare once you had to scale to multiple concurrent processes; single process (which were all KeyKOS generally published benchmarks for, aside from a well-known carefully constructed transaction benchmark explicitly designed to make sure that only completely independent data was ever written to the system) were pretty efficient, but tangled references quickly forced the set of objects that needed to be committed to the ENTIRE SYSTEM once you had a fair number of processes running at once. Disk usage was incredibly inefficient.

    This paragraph leads me to believe that you have little idea about how KeyKOS operated. KeyKOS and its successors are built on transparent orthogonal persistence, which means a snapshot of the entire system is always written to disk as an atomic transaction. Contrary to your assertion, disk usage has been shown to be incredibly efficient.

    Unless by "transaction manager" you're talking about the ATM software which ran on KeyKOS, which would be a completely different matter and unrelated to KeyKOS as a viable OS.

    Moreover, the checkpoint system wasn't ACID compliant so you didn't get anything useful for all that complexity; in crash recovery situations, a transaction that had already been committed could be replayed multiple times (causing data inconsistencies or worse).

    Checkpointing is and was ACID. If you believe it was not, then please explain.

    I could go on, but the major point is that all of these problems stemmed directly from the design of the KeyKOS microkernel, and the barriers to solutions were ones that would not have existed in a monolithic kernel.

    Completely untrue. I suggest you read some KeyKOS kernel and architecture papers to learn the true limits of KeyKOS.

    None of those problems were easily soluable, and the attempt to improve the system in EROS wound up in a development rathole that was eventually abandoned because of systemic complexity and severe performance problems.

    Only partly true. The EROS founder abandoned it in favour of Coyotos because the reliability guarantees achievable via C-based development were too low, and the message passing primitives which defined the architecture made "certain" high-performance designs challenging. This is not "severe" performance problems, any more than Linux had "severe" performance problems before epoll. By high-performance, we're talking saturating Gigabit ethernet here (EROS achieved 90% saturation), which is above and beyond the bandwidth needed for most uses.

    Attempts to follow it up (notably CaprOS with the EROS code, and Coyotos recoding the design from scratch) also have achieved little to date.

    It's been a year. CapROS has been ported to the ARM, the Coyotos group has developed the BitC language, and the

  217. Wrong by microbee · · Score: 1

    We don't attack Windows running GDI in kernel. Actually, it was a good move, which showed exactly why microkernel didn't work in real life as a general purpose OS.

    We attack because Microsoft is not honest about it and still talks about "microkernel" while they know it's not.

  218. Modularity by microbee · · Score: 1

    I have to laugh when you say NT is more modular.

    Look at which system has the biggest number of supported filesystems, and then talk about modularity.

    Linux VFS is a great example of modularity design. Actually, the credit goes back to Sun's Solaris when they introduced NFS.

    Please, know what you are talking about instead of just buying everything MS marketing has to say.

  219. Three Letters by sp0rk173 · · Score: 1

    QNX

  220. Re:Trust (was Re:Plane OS) by sp0rk173 · · Score: 1

    Possilibity, Dogma, etc, are not truth. You take them to be, and that is incorrect and intellectually lazy.

  221. Re:Linus Quote - "not arguing against it at all" by sploxx · · Score: 1

    You know, I've seen EMI-certified screws.

  222. Re:Linus Quote - "not arguing against it at all" by sjames · · Score: 1

    Now consider a microkernel. The filesystem driver is a separate server process. Executing a system call means sending a message to that server and waiting for an answer. Now, what happens if the server is already executing another call ?

    The same thing as you suggest when it happens in a monolithic kernel, The multi threaded fs server uses appropriate locking and preemption to make sure the request can be fulfilled as quickly as possible. That would be the proper locking and preemption needed for an OS service. Nobody claimed that microkernel was a magic free pass that lets you get away with crappy implementations.

    The other issues with deadlocking are solved with proper priority inheritance. If a high priority process is blocking on the fs server, then the fs server is promoted to it's priority. In many microkernel systems, making a blocking IPC call also yields the remainder of the calling process' timeslice to the called process. Given a good threaded server daemon design, much of the complexity of getting locking and preemption right 'just works'. At the very least, it's no more complex than getting it right in a monokernel.

    Things in the Linux monokernel work exactly the same way! The kernel code inherits the timeslice of the process that makes the system call. Unlike an fs server, if the Linux fs code makes a mistake, it can lock up the entire system until reset.

    It has been a long time since the Linux kernel was single threaded. Think the 'big kernel lock' and the considerable effort that went into getting rid of it. The linux kernel's threading is mostly cooperative with the exception of interrupt handlers.

    Sure, there are ways around this. The server could be multi-threaded, for example. But how many threads should it spawn ? And how much system resources are they going to waste ? A monolithic kernel has none of these problems.

    If those threads are blocking on a work queue, the 'wasted' system resources amounts to a few process table entries (a few KB)

  223. Re:The problem of sharing must be solved at CPU le by master_p · · Score: 1

    "CS/DS/SS/ES are from the 16-bit time. (and btw, they were a bad idea then, so doing something like that again is bad now too)"

    Segmentation as it was introduced on 80x86 is a bad idea indeed. What I proposed was a way to exploit segmentation in order to have modularization.

    "Did you notice that for each definable segment, there is a separate register? That is because only registers are fast enough."

    Not really. Registers are caches for segment indices. The segment information is stored either the global descriptor or local descriptor table.

    "Adding stack (memory!) operations to each function call slows down things a lot too."

    No, it will not. We are talking 32 bits more per call. That's negligible, since the stack areas will already be in cache anyway.

    "What you're missing is that calls are all over the code, at many different addresses, so to do an 'access check' requires an add an a subtract for each possible active segment. That is a lot of operations."

    And what you don't understand is that these checks are already performed at each call. And not only there is a segment limit check, but since most calls will call the kernel, there is also a jump from higher to lower ring as well (and that is costly!).

    "Seems to me that everything you're talking about is best done completely in software."

    It seems to me you have no idea how 80x86 works.

  224. Equivilant concepts by sjames · · Score: 1

    Throughout this discussion, one common theme is mis-understanding a few concepts by taking them as explicit and literal.

    For an eaxmple, passing a 'message'. Many hear this and think it's necessarily writing some structure to a socket like object. In fact, any system call can be seen as passing a message. It might be a write to a socket, or it could be (on intel platforms) the assembly instruction int $0x80. in fact, writing to a socket would be passing a message through a syscall in order to request that a message be passed through a socket.

    Shared memory is another example. At the program level, it looks different than message passing, but that's only because SMP capable processors have considerable amounts of hardware dedicated to converting those 'simple' memory accesses into explicit messages from CPU to CPU (to maintain cache coherency) as well as CPU to memory controller (an internal message in an Opteron) and memory controller to RAM. RAM is a simple (or these days NOT so simple) state machine that recieves read and write messages from a memory controller and sends back acknowledgements and data. The fact that it's all swept under the rug by the CPU doesn't mean it never happened, just that the programmer doesn't have to code it.

    However, a progremmer using shared memory DOES have to at least be aware of it if the code is to be efficient. For example, if you know the size of a cache line and how the data will be accessed, you are well advised to arrange the data such that only one thread will be modifying data on a single cache line at the same time, and so where possible, data that is accessed as a unit resides in the same cache line (that is, good data locality).

    Shared memory to message passing CAN be implemented in software. I have done it as an experiment using a signal handler to catch SEGV and explicitly fault the page over to the process trying to write by passing messages to other processes 'sharing' the memory. That can be horribly slow, especially if you use TCP/IP to pass the messages, but when handled by dedicated hardware (such as the CPUs on a multiprocessor machine) can be fast enough that many forget that it happens at all.

    A function call is a sort of message passing. In this case, the compiler hides the complexity. Try gcc -s on your favorite hello world program in C and you'll see where the compiler has arranged to push the relevant variables onto the stack, that is it builds a message. Then it executes a call instruction (passes the message). In this case, the stack frame and instruction pointer are the context that gets switched.

    In that sense, the difference between micro and mono kernel is how the message passing is implemented and how explicitly. The performance differences are a matter of how well the hardware supports the message passing scheme.

    It is noteworthy that when Linus was discussing mono vs. micro the first time, the hardware that concerned him supported monokernel style message passing MUCH better than any of the methods in use by microkernels. That appears to still be true.

    So, it comes down to the tradeoffs between speed, stability, verasatility, and development and maintainance. One noteworthy benefit to development is that it's easier to test (for example) a new fs server by giving it an example filesystem to support for the developer. It can then be run in a debugger if necessary and if it crashes and burns, the rest of the system is just fine (including the old FS service).

    back in the '386 days, speed was a real issue in most cases. These days, a great many systems have 'speed to burn'. So for the same reason most generally agree that there's no good reason to use every possible dirty assembler trick for a web server (in fact, many good reasons NOT to), it may be time to ask if the benefits outweigh the performance costs in a microkernel approach.

    Also worth noting, it's not as if the Linux kernel needs to be abandoned and replaced. For example, fuse IS a filesystem running as a userspace service. It's probably not going to be deployed as the root filesystem anytime soon, but it exists. There's also 9fs.

  225. HURD microkernel by Anonymous Coward · · Score: 0

    HURD is the true GNU microkernel based on mach.
    www.gnu.org/software/hurd/hurd.html

  226. Re:The problem of sharing must be solved at CPU le by jelle · · Score: 1


    > "Did you notice that for each definable segment, there is a separate register? That is because only registers are fast enough."

    >> "Not really. Registers are caches for segment indices. The segment information is stored either the global descriptor or local descriptor table."

    Nope. CS/DS/SS/ES are not caches they are actual registers. Registers are never caches, registers are (simple) flip-flops. Caches are (mostly) SRAM. Totally different beasts.

    "No, it will not. We are talking 32 bits more per call. That's negligible,"

    It's not.

    "That's negligible, since the stack areas will already be in cache anyway."

    Besides adding cycles to basic instructions such as a call, you're adding significantly to the memory bandwidth.

    "And what you don't understand is that these checks are already performed at each call. And not only there is a segment limit check, but since most calls will call the kernel, there is also a jump from higher to lower ring as well (and that is costly!)."

    Nope, 'the checks' are a result of being able to know 'page faults', and each page is 4kbyte (or more for hugetlb), and if page boundaries are not crossed, no checks are needed so none are done. They actually added hugetlb support to the chips to not only reduce the table sizes, but also to reduce the number of page boundary crossings, to improve the performance.

    "It seems to me you have no idea how 80x86 works."

    Seems to me that you are a software person who thinks he knows hardware.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  227. Re:Linus Quote - "not arguing against it at all" by Hast · · Score: 1

    Sooooo, it's easy to have someone else handle the multi-process bits in a monolithic design. But when it comes to writing services for microkernels suddenly everyone is an idiot?

    When did I ever claim either thing ? All I'm saying that an efficient microkernel is no simpler than an efficient monolithic kernel.

    Oh I think making an efficient microkernel is harder than a macrokernel. The reason for doing it are typically in spite of performance issues.

    But your post blew up the problems of a microkernel while completely dismissing the hardships of a macrokernel. My point was that both have problematic areas.


    Sure multiple processes can access it at once, but the time scale on handling the incoming signals is extremely fast compared to waiting for data from disk.

    Unless the data happens to be in cache in an SMP machine, in which case a simple single-threaded server is going to be bombarded by multiple processes running on multiple processors at once, and run up a queue.

    And a multi-threaded server is no simpler than a monolithic kernel filesystem driver, and has some specific problems of its own.

    Both micro- and macrokernels are going to have issues with actual reading from disk. The problem being that you can only read from one place at a time (not strictly true, but there are limits). As such multiple processes which attempt to read at the same time need to be handled by some sort of queueing system. It's just a question of where you put that.

    Besides my point was that it doesn't matter if you application is the only one running on a macrokernel OS. Disk access takes a long time, so you *will* be blocked for some time. (Or you'll have to implement asyncronous file access.)

    Besides, as Linus pointed out, when data is going one way microkernels are easy. And in the case of file systems that is really the case.

    When I'm doing reads, request goes in and data or error code comes out. When I'm doing writes, data goes in and confirmation or error code comes out. Filesystem access is two-way.

    Yes, but for each operation the data is only going one way. And that's the point.

    Microkernels are slow if you have to send a lot of data back and forth rapidly. (And in this context anything leaving RAM is slow.)