Kernel Questions

Posted:
in macOS edited January 2014
Linux distros use the Linux kernel.



Darwin/Mac OS X uses the Mach microkernel (Project Mach was an operating systems research project of the Carnegie Mellon University School of Computer Science from 1985 to 1994, which included Avie Tevanian of NeXT and Apple)







I am not clear about these:



What kernel does FreeBSD use?



What kernel does NetBSD use?



What kernel does Solaris use?



What kernel does AIX use?



What other Operating Systems have used the Mach kernel in the past?



I have heard that IBM's OS/2 was built on Mach. Is that true?



What version of Mach does Panther use?



What is the difference between a kernel and a microkernel?

Comments

  • Reply 1 of 11
    I'm going to do my best to answer to the best of my knowledge, but it's very VERY likely that I'm wrong. If so, could someone please correct me? Thanks!



    (A lot of this can be found on the Wikipedia)



    Quote:

    Originally posted by dstranathan

    What kernel does FreeBSD use?

    What kernel does NetBSD use?

    What kernel does Solaris use?

    What kernel does AIX use?





    FreeBSD uses the FreeBSD kernel.

    NetBSD uses the NetBSD kernel.

    Solaris uses the Solaris kernel.

    AIX uses the AIX kernel.



    You can consider Mac OS X to be special, as it amalgamates the Mach micro-kernel with the BSD system.



    Quote:

    What other Operating Systems have used the Mach kernel in the past?



    Some names include:
    • NeXTSTEP

    • MkLinux

    • GNU Herd

    • OS/2 Warp for the RS/6000 (I think)

    • OSF/1

    • MtXinu

    • HPBSD

    • Lites

    • Unicos-max

    • QNX/Neutrino (Ed: Oops, no it's not, thanks jginsbu)

    • Tru64 (Thanks, Eugene)

    You can trace the Mach history here.

    (I'll edit and add others as I find 'em)



    Quote:

    I have heard that IBM's OS/2 was built on Mach. Is that true?



    I initially thought it was, but after some research, I don't think so.



    Quote:

    What version of Mach does Panther use?



    3.0, I believe.



    Quote:

    What is the differecene between a kernel and a microkernel?



    (Ed: Read lundy's post, it's much better)

    A monolithic kernel (like Linux and Windows 9x) is burdened with the responsibility of having the whole "OS" inside a file. A micro-kernel has several smaller programs which manage different aspects of the hardware. In this case, the kernel is only responsible for making sure all the little sub-programs play nice. If one starts to act up, you can just restart it, without taking down the whole machine.



    I hope that helps and that I'm right
  • Reply 2 of 11
    bartobarto Posts: 2,246member
    Mac OS X doesn't use a vanilla Mach kernel, but Apple's own XNU kernel, which incorperates Mach kernel and FreeBSD kernel code in amongst Apple's own code.
  • Reply 3 of 11
    bartobarto Posts: 2,246member
    Quote:

    Originally posted by Phroggy

    A monolithic kernel (like Linux and Windows 9x) is burdened with the responsibility of having the whole "OS" inside a file. A micro-kernel has several smaller programs which manage different aspects of the hardware. In this case, the kernel is only responsible for making sure all the little sub-programs play nice. If one starts to act up, you can just restart it, without taking down the whole machine.



    Except apart from QNX, I don't know of any microkernel OS that can restart crashed drivers. Also, most microkernels and monolithic kernels tend to gravitate towards the center of kernel modules to perform tasks. They are opposing philosophies, but in practice most kernels borrow heavily from both.



    Barto
  • Reply 4 of 11
    Quote:

    Originally posted by Phroggy

    Some names include:OS/2 Warp for the RS/6000 (I think)
    QNX/Neutrino 2.10




    QNX isn't based on Mach, although it too is a microkernel OS. It is arguably the best example of the of the type, taking the possibilities of microkernel OS design farther than any of the Mach-based systems. See http://en2.wikipedia.org/wiki/QNX.



    IIRC (and this is going back a long way for me), IBM had intended to move OS/2 to Mach, and didn't get farther than the RS/6000 version. Basically Mach was already running on RS/6000 and OS/2 wasn't, and it was easier to rejigger OS/2 to run on top of Mach than to rewrite the OS/2 kernel itself. The plan was to eventually give OS/2 much greater platform portability by moving it to run on Mach, but for many reasons OS/2 never became the platform IBM wanted it to be and thus wasn't deserving of the investment. That said, OS/2 is still in use in many areas, including ATMs (which some banks decided would be better run on Windows embedded and then they caught some of those viruses that were going around this summer -- yay). Anyway, it's a sad story, especially since I still miss the object-oriented-ness off the Workplace Shell. If you're really interested in OS/2 history, the source to seek out is Tim Sipples, if you can track him down somewhere on the net (he was working for IBM, but I'm fairly sure he isn't there anymore).
  • Reply 5 of 11
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by dstranathan

    What is the difference between a kernel and a microkernel?



    For portability from one processor and hardware to another, one would like to have an abstraction of the hardware - that is, a small portion of the OS that is specific to that hardware. The bigger the hardware-specific part is, the harder it is to recode and port the OS to a different hardware.



    The portion of the OS that knows how to "talk" to the specific hardware needs to have some way to get and receive instructions from the other parts of the OS. In a microkernel, the hardware-specific part (kernel) is very small, and gets messages from outside the kernel to do things like get memory, start and stop reading disks, etc. The messages sent can be the same no matter what the underlying hardware is, as, for example, the microkernel carries out the message "get data from disk" however the hardware needs to have it done. This makes it easy to port the small kernel to another OS, but having to do everything via message-passing can get inefficient.



    A monolithic kernel would tend to have more of the code written to "know" what hardware it was on, and therefore not have to pass generic messages into another part. This is faster, but when hardware changes it is possible that more code has to be changed, as there is less of a strict division between code that is specific to the hardware and code that is not. This division is known as the hardware abstraction layer.



    So kernels like Mach try and use parts from monolithic kernels that are needed to improve efficiency, while keeping parts from microkernels that are very crucial to portability while not being too inefficient.



    Clear as mud.8)
  • Reply 6 of 11
    eugeneeugene Posts: 8,254member
    Quote:

    Originally posted by Phroggy



    Some names include:NeXTSTEP
    MkLinux
    GNU Hurd
    OS/2 Warp for the RS/6000 (I think)
    OSF/1
    MtXinu
    HPBSD
    Lites
    Unicos-max
    QNX/Neutrino 2.10
    You can trace the Mach history here.

    (I'll edit and add others as I find 'em)




    I think Tru64 uses Mach since it's based on OSF, and there's definitely a branch of HP-UX based around Mach too.
  • Reply 7 of 11
    Quote:

    Originally posted by Phroggy

    You can consider Mac OS X to be special, as it amalgamates the Mach micro-kernel with the BSD system.





    How so? I mean, how can you blend a monolithic kernel and a "modular" microkernel? Seems to me you can't blend them, otherwlse it contradicts the definition of "monolithic"
  • Reply 8 of 11
    Quote:

    Originally posted by dstranathan

    How so? I mean, how can you blend a monolithic kernel and a "modular" microkernel?



    Admittedly, it probably wasn't the best choice of words, but as I understand it, Apple's XNU truly is a hybrid kernel. It uses a lot of Mach code for things like memory management, and I/O, but it also uses BSD code in the same memory space for things like POSIX compatibility and networking.





    After some searching I found this:

    "XNU is based on the Mach microkernel design, but it also incorporates BSD features. It is not technically a microkernel implementation, but still has many of the benefits of a microkernel, such as Mach interprocess communication mechanisms..."
  • Reply 9 of 11
    Several people have said (more or less) that a microkernel has only the barest of features in it, whereas a monolithic kernel includes everything plus the kitchen sink. Nobody has really tackled what it means to be "part of the kernel".



    Tranditionally something is part of the kernel if it lives inside the kernel's address space. A true micro-kernel OS puts a tiny piece of code, with carefully constrained functionality, in the kernel address space... and nothing else. This tiny piece of code is generally the basic tasking mechanism, a message passing system, and the fundamential processor hardware interface (usually interrupt and page table handling). Everything else (even the scheduler and virtual memory algorithms) lives in other address spaces and operate as seperate processes. They communicate with eachother and the kernel using the kernel-provided messaging system.



    The up side of this approach is that it is typically almost bullet proof. Since nobody can put new code in the kernel's space, nobody can introduce bugs into the kernel. The downside is that almost everything must go through the message passing system and across the inter-process address boundries. This varies from slow to damn slow.



    A typical side-effect of the microkernel design is that code is more often architected to be asynchronous and re-entrant. This means it blocks less, and there are fewer places where waiting is forced upon the clients of the OS. This is sort of a side effect of this forced modularity, and it doesn't mean that this isn't possible in a monolithic kernel... its just harder to maintain the discipline when building the OS code.



    There is a whole spectrum of greys between this black and white. As more code is added to the kernel it becomes less and less a microkernel. As more code and data lives in the kernel's address space, it becomes less of a microkernel. Apple's approach seems to be to try and keep the organization of the code living in the kernel's space as modular as possible (i.e. avoid polluting the architecture) but at the same time allow much more code to live in the kernel's space for the sake of efficiency. They have also threaded their kernel's process, and are continuing to make it more heavily threaded all the time. This approach makes Darwin/MacOSX much faster than using a pure microkernel would have, but it means a buggy kernel extension can bring the whole machine crashing down around your ears.
  • Reply 10 of 11
    mcsjgsmcsjgs Posts: 244member
    That's a very good explanation. Even a techno-ignoramus such as myself could understand it.
  • Reply 11 of 11
    If Programmer had been my teacher for Operating Systems at the university, I would probably have passed the exam... I should have known about AI earlier ;-)
Sign In or Register to comment.