Check out my latest product, BuildFactory

Amit Singh puts kernel_task in it's place
Phil Aaronson of BuildFactory and cute daughters fame, pointed out last night that in his magical Mac OS X Internals (A Systems Approach) book, Amit Singh explains kernel_task more in some detail.In my own defense, I really think my speculation/weak-research was relatively close on, the kernel_task process you see in Activity Monitor is somewhat similar to the sigma0 concept on L4-based systems (L4 X.2 Manual (PDF). That is, sigma0 does handle (from the best of my understanding of course), basic page allocations of memory for the userland processes. kernel_task however does so much more, more along the lines of sigma0 plus the generic root task that you create to run on top of the L4 microkernel (I should really start making use of the µ symbol). From Amit's book here's what he describes kernel_task much more accurately:
The kernel uses a single task - the kernel task - with multiple threads that perform kernel operations such as scheduling, thread reaping, callout management, paging and Unix exception handling. Thus xnu is a monolithic kernel containing markedly different components such as Mach, BSD, and the I/O Kit, all running as gorups of threads in a single task in the same address space.
This is where Apple, as I pointed out previously, made a microkernel, I mean, µkernel not a µkernel. For example, when you fire up Darbat they do something different, more in tune with the µkernel design, with all that BSD, Mach and IOKit fluff. They run it...in userland...where all that fluffy non-kernel space stuff should really be imprisoned. What this means of course, is that IOKit is running in it's own chunk of address space outside of the kernel which, besides being very cool, means that in Darbat 0.2 they could accomplish KEXT compatibility with Mac OS 10.4, while not messing up their lovely µkernel design.
If I had a Mr. Rogers sweater, I'd probably pull that on right now and say I'm glad we could spend this time together to learn a little bit more about the world, thanks for stopping by my neighborhood.
[tags: apple, darwin, xnu, mach, l4]
Write reply
This item is closed, it's not possible to add new comments to it or to vote on it


