Women in Technology

Hear us Roar



Article:
  What Is Darwin (and How It Powers Mac OS X)
Subject:   Tweaking kernel
Date:   2005-09-28 12:04:35
From:   valsjo
Very good info!


Though, I would like more info about if it is possible to tweak/recompile the kernel and install that one instead of Mac OS X Tiger kernel; like you can do with Linux kernels.


Apple doesn't say much about this.


If I look at other sites about Darwin, often they just talk about how to install a completeley new Darwin system, but not if you can "replace" Apple's kernel with another one.


O'reiily: more technical articles, likes this one, about Darwin/Mac OS X are most welcome!

Full Threads Oldest First

Showing messages 1 through 6 of 6.

  • Tweaking kernel
    2006-01-05 08:20:11  xyzxyz [View]

    Some people may wonder why one would want to replace the mach kernel.
    I for one want to run CNC software on my Mac that requires RTAI, a realtime modification that requires intercepting interrupts before they are handled by the kernel. There is currently no patch to the MACH kernel to support this realtime software.

    Alan
  • Tweaking kernel
    2005-09-29 05:29:05  Mafretete [View]

    Yes, you can replace the Mac OS X kernel and compile one yourself. For example, it was not possible to spoof your MAC address with Mac OS X <= 10.3, but you could modify the Darwin source code to allow this and use the recompiled kernel with Mac OS X.
  • Tweaking kernel
    2005-09-28 16:40:44  DanielEran [View]

    Recompiling the kernel is a common topic for Linux users because its kernel design requires recompiling everytime you add driver support for a device. This is not a desired feature.

    The point of kernel extensions in the I/O Kit is to allow Mac OS X's kernel to dynamically load device drivers as needed when booting. Linux can't do this. Do you want to muck with compiling your kernel when you change your hardware? Yikes!

    Also, "kernels" aren't some kind of module you can pop in and out. Even within Linux, there are scores of dependancies between applications and the specific version of the Linux kernel. And you obviously can't drop in another kernel in place of Linux and expect your system to somehow work.

    By the same token, it is innane to suggest that it would be possible (or useful) to replace the Darwin kernel with Linux (or the NT kernel, or even BSD). It would be problematic even to get the Tiger (Darwin 8) kernel to work in Jaguar (Darwin 7).

    Darwin's use of Mach makes it significantly different from most other Unix/Linux distributions. The windowserver (and everything else!) is closely integrated with Mach's messaging structures; you simply could not replace Mach with a more conventional style kernel without redesigning the entire architecture of Mac OS X.

    And why would you want to? Linux does not have some magical advantage in performance over Darwin when similarly tasked and similarly equiped.

    Sure you can customize the Linux kernel and build in support for specific things and trim out features that result in a faster, tuned system fit for a specific purpose, but that (a tunable server system) isn't what Apple is trying to provide at all.

    Linux, conversely, will never approach the ease of use, familiarity, consistancy and integration that Apple has aimed for when engineering Mac OS X's architecture.

    The idea of a "kernel" is a bit of an abstraction anyway. There is not a clear line between what is exactly the kernel and other components that interact very closely with it.

    • Tweaking kernel
      2005-09-28 22:03:32  John_Fieber [View]

      The point of kernel extensions in the I/O Kit is to allow Mac OS X's kernel to dynamically load device drivers as needed when booting. Linux can't do this.

      Um, Linux has had dynamically loadable kernel modules for a long time. So has FreeBSD. So has Solaris and about every other contemporary Unix I can think of.
      • Tweaking kernel
        2005-09-29 05:18:48  Mafretete [View]

        The problem with Linux is that you cannot ship a precompiled kernel module - it would not work with a slightly different kernel. On Mac OS X, most kernel extensions for OS X 10.3 still work in OS X 10.4, even though 10.4's kernel is much newer.
        • Tweaking kernel
          2005-09-30 19:30:37  thebluesgnr [View]

          But you don't have to build a new kernel if the module is linked against a different version, just rebuild the module, which is usually a very simple and easy thing to do.