Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Understanding OS X Kernel Internals

Posted by Hemos on Mon May 22, 2006 08:16 AM
from the knowing-more-about-the-insides dept.
jglidell writes "The OS X kernel has been in the news alot this past year, whether it's why its slow, Mach/micro-kernel makes it bad, it's going closed source and what not. Amit Singh has put up a new presentation on the innards of OS X. It does a pretty good job of summing up the OS X kernel architecture, and has some pretty detailed diagrams... for instance they show that there are so many process/threads layers in OS X. So if you are in the mood for doing some OS studying then head over."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Spelling (Score:1, Insightful)

    Grrr... "alot" isn't a word! It's "a lot."

    The spelling police are on their way!
    • Re:Spelling (Score:5, Insightful)

      by dhasenan (758719) on Monday May 22 2006, @08:42AM (#15379792)
      Not to mention fonts. I can never forgive anyone for using Comic Sans in a presentation.
      [ Parent ]
      • Re:Spelling by Vishal (Score:1) Monday May 22 2006, @09:59AM
      • Re:Spelling by Crizp (Score:1) Monday May 22 2006, @10:32AM
      • Re:Spelling by silic0n (Score:1) Monday May 22 2006, @01:45PM
      • Re:Spelling by chrish (Score:2) Tuesday May 23 2006, @08:55AM
      • 1 reply beneath your current threshold.
    • Re:Spelling (Score:5, Funny)

      by mangu (126918) on Monday May 22 2006, @08:42AM (#15379795)
      "alot" isn't a word! It's "a lot."


      I also get kinda pissed off because lotsa people write it that way.

      [ Parent ]
      • Re:Spelling by Tibor the Hun (Score:3) Monday May 22 2006, @10:12AM
      • Re:Spelling by decepty (Score:1) Monday May 22 2006, @05:59PM
      • Re:Spelling by Smurf (Score:2) Monday May 22 2006, @08:13PM
    • Re:Spelling by Cannelloni (Score:1) Monday May 22 2006, @09:48AM
    • Re:Spelling by TeXMaster (Score:2) Monday May 22 2006, @02:23PM
    • Re:Spelling by Ford Fulkerson (Score:2) Tuesday May 23 2006, @07:41AM
    • Re:Spelling by jaylene_slide (Score:1) Monday May 22 2006, @11:08AM
      • Re:Spelling by psmears (Score:1) Monday May 22 2006, @02:29PM
      • 1 reply beneath your current threshold.
    • 2 replies beneath your current threshold.
  • huh? (Score:2, Insightful)

    by Aussie (10167) on Monday May 22 2006, @08:25AM (#15379664)
    (Last Journal: Friday March 21 2003, @03:46AM)
    whether it's why its slow

    What the hell does that mean ? Editors drunk ?
    • Re:huh? by Bromskloss (Score:1) Monday May 22 2006, @08:40AM
    • Re:huh? by PFI_Optix (Score:2) Monday May 22 2006, @09:20AM
      • Re:huh? by yuktar (Score:1) Monday May 22 2006, @09:37AM
        • Re:huh? by PFI_Optix (Score:2) Monday May 22 2006, @10:29AM
    • Re:huh? by Ant P. (Score:2) Monday May 22 2006, @09:20AM
      • Re:huh? (Score:4, Funny)

        by M. Baranczak (726671) on Monday May 22 2006, @12:47PM (#15382048)
        Nope, it's still gibberish.

        whether it's why it's slow

        Well... why is it slow?

        Mach/micro-kernel makes it bad

        Debating the pros and cons of Mach is a valid topic, but a phrase like this is so vague that it's meaningless.

        it's going closed source

        OK, that one's intelligible. But then we come across gems like this:

        for instance they show that there are so many process/threads layers in OS X.

        A small request for submitters: Take a minute to actually proof-read your summary. I'm not even talking about simple typos, or the correct use of "you're/your" - those look ugly, but most of the time people can still figure out what you meant. Just ask yourself: will these words make sense to a moderately intelligent English speaker who's not on a meth bender?
        [ Parent ]
    • Re:huh? by jaysones (Score:3) Monday May 22 2006, @09:27AM
      • Re:huh? by Eq 7-2521 (Score:1) Monday May 22 2006, @10:30AM
    • Re:huh? by m50d (Score:2) Monday May 22 2006, @03:49PM
    • Re:huh? by Gulthek (Score:2) Monday May 22 2006, @09:23AM
    • Re:huh? by heinousjay (Score:1) Monday May 22 2006, @09:59AM
    • 2 replies beneath your current threshold.
  • Needs more editor. (Score:4, Insightful)

    by dajobi (915753) on Monday May 22 2006, @08:28AM (#15379687)
    "alot"
    "whether it's why its slow"
    "they show that there are so many process/threads layers in OS X."

    Do the editors even look at submissions any more? Or to put it another way, is our children learning yet?
  • Where are good internal docs? (Score:5, Interesting)

    by thogard (43403) on Monday May 22 2006, @08:35AM (#15379740)
    (http://web.abnormal.com/)
    I have a small program that mmaps a bit of code and then points the program counter at it. Everything runs fun until a OS call happens. I've heard that Mach allows user land programs to install their own OS calls but I haven't seen any example code to do it and I suspect such a feature isn't in OS X. I've hunted through the source and I while I could write my own system call and compile it in, there should be an easier way. Can anyone point me in the correct direction?
  • Terrible summary. (Score:3, Insightful)

    by IANAAC (692242) on Monday May 22 2006, @08:37AM (#15379760)
    I could barely get through the summary.

    If English is a second language for the submitter, fine. But good grief, do you suppose one of the PAID editors could have done just a bit of work to make the summary more readable?

  • "OS X is slow" claims investigated (Score:5, Informative)

    by Logic and Reason (952833) on Monday May 22 2006, @08:46AM (#15379821)
    (http://gardnerman.com/)
    Before anyone starts spouting off again about Mac OS X being "slow by design" or somesuch, read this article by an Apple engineer [ridiculousfish.com] that investigates those claims.
  • by [HooL] (155038) on Monday May 22 2006, @08:48AM (#15379835)
    A flash presentation which is over 6 MB large (still loading)..
    Good bye, dear server!
  • Ad (Score:5, Informative)

    by AstrumPreliator (708436) on Monday May 22 2006, @09:03AM (#15379961)
    I looked at the "presentation" and no, it doesn't do a very good job of explaining anything. Maybe combined with an extensive lecture to explain what the hell he's talking about would make it a bit more clear. From what I saw it was basically just enumerating the different components. Then I noticed the second to last slide. It's basically an ad for a book coming out.

    Maybe it's just me though. Did anyone else find it extremely enlightening?
  • Underpowered Little Machine (Score:5, Insightful)

    by Beefslaya (832030) on Monday May 22 2006, @09:07AM (#15380004)
    As the purchaser of a brand new Core Duo Mini, (my first Mac, I feel "as happy as a little Gurlll!") I noticed that my system out of the box with 512 of RAM was dog slow when you start loading iPhoto, or any more then 2 apps.

    Initial startup yielded a smoking fast web browser, and other single line items.

    I purchased the 2GB Ram upgrade (not from Apple at 600 USD, 280USD from Crucial) and I noticed such a difference, that I couldn't understand WHY they would even consider shipping that little silver wonder with less then 1GB of RAM.

    It's not the kernel, it's the apps... They just don't give enough power to the off the shelf machines to support the great apps that come with it.

    Vive le Mac... Thanks for putting excitement back into computing for me.
  • Closed? (Score:5, Insightful)

    by ShadowBottle (663193) on Monday May 22 2006, @09:27AM (#15380149)
    Riiiight. Just because some idiot alarmists say that the kernel has gone closed when it simply just hasn't been released yet, the media and clueless bloggers start crying that it's gone closed source.
    "Well... it hasn't. It's still open. IT JUST HASN'T BEEN RELEASED YET.
    OSNews is reporting that Ernest Prabhakar, Apple's Open Source and Open Standards product manager, has stated in the Fed-Talk mailing that Apple has not actually closed Mac OS X's Darwin kernel for the Intel version of the OS; they simply haven't released it yet. Speculation about Apple closing the kernel arose from the fact that other non-kernel Darwin sources actually have been released, and the previous PowerPC-based kernel is still available as open source as well.Ernest wanted to make sure that tech media didn't confuse 'speculation' with 'fact'. A good lesson we all could benefit from...."

    God damn alarmist idiots.
    • Re:Closed? by squiggleslash (Score:2) Monday May 22 2006, @10:36AM
      • Re:Closed? by jcr (Score:2) Monday May 22 2006, @11:41AM
        • Re:Closed? by squiggleslash (Score:2) Monday May 22 2006, @12:49PM
          • Re:Closed? by jcr (Score:2) Monday May 22 2006, @01:17PM
            • Re:Closed? by squiggleslash (Score:2) Monday May 22 2006, @03:12PM
              • Re:Closed? by jcr (Score:2) Monday May 22 2006, @04:55PM
              • Re:Closed? by Warlock7 (Score:2) Monday May 22 2006, @08:45PM
              • Re:Closed? by squiggleslash (Score:3) Tuesday May 23 2006, @08:18AM
              • Re:Closed? by squiggleslash (Score:2) Tuesday May 23 2006, @08:21AM
              • Re:Closed? by Warlock7 (Score:3) Tuesday May 23 2006, @11:11AM
          • Re:Closed? by Warlock7 (Score:2) Monday May 22 2006, @01:59PM
            • Re:Closed? by squiggleslash (Score:2) Monday May 22 2006, @03:18PM
              • Re:Closed? by Warlock7 (Score:2) Monday May 22 2006, @08:36PM
              • Re:Closed? by Lars T. (Score:2) Tuesday May 23 2006, @12:05PM
              • Re:Closed? by squiggleslash (Score:2) Tuesday May 23 2006, @07:59AM
              • Re:Closed? by Warlock7 (Score:2) Tuesday May 23 2006, @07:33PM
        • Re:Closed? by geoff2 (Score:1) Monday May 22 2006, @02:35PM
    • 1 reply beneath your current threshold.
  • OSX: Highly Thread Sensitive (Score:3, Interesting)

    by ElitistWhiner (79961) on Monday May 22 2006, @10:36AM (#15380828)
    As an ex-NeXT developer, the historical speed bumps behind this architecture are directly related to code density. NeXTSEP ver 2.0 was nicely running on 25mHz. NeXTSTEP ver 3.0 suffered performance on 25mHz compared to ver 2.0 because of the additional kernel overhead resultant from code densification.

    With every ver. release through 10.4.x MacOS X, mach/BSD layer exhibits funtional improvements with speed increases of the processor CPU and latent performance behaviors from the additional kernal overhead added by code complexity and densification.

    Prima Facia evidence to the 4X speed improvement in performance from Apple's new Intel CPU bears witness to the limits of the kernal architecture.
  • The big mystery remains: why Mach? (Score:1, Interesting)

    by Anonymous Coward on Monday May 22 2006, @11:10AM (#15381190)
    I know that the original code, from NeXT, was Mach because there wasn't any choice. But in this day and age there are plenty of microkernels that actually perform well, even as a platform for full kernels. There's plenty of benchmarking for Linux on L4, and Linux on Exokernel. Both have minimal impact on performance. (L4 is usually 2-10%, Exokernel is similar.) Mach is a dinosaur. And since microkernels are small, with well-defined interfaces, porting to a more modern one should be relatively easy, even keeping backwards-compatibility of libraries. (You might need a mach emulator, or mach-on-top-of-l4 for a few mach-specific system calls, but that would hardly be a problem.)

    So why hasn't apple done it?

  • by ChrisA90278 (905188) on Monday May 22 2006, @12:27PM (#15381877)
    I read the Flash presentation. It's at such a gross high level and lacks any details other then the names of some modules. There is no new information here. OK there are lots of parts and it looks complicated but Linux has all those parts too (except for the bagage that is needed to support old Mac OS9 aps)

    My opinion is that mac OSX is very well designed if you beleive that in the future there is be more and more "cores" inside most notebook and desktop computers. OSX is well setup to take advantage of 8-core machines. It should scale well.

  • *snort*

    Not bad! I think for extra points you should have bought up speculation that Apple closed the OS X kernel to ease the future transition to the Vista kernel.

    And of course, no modern anti-apple troll should be complete without reference to Apple's 'betrayel' of PA semi [reghardware.co.uk]
    [ Parent ]
  • Re:OS X Kernel - Why? (Score:4, Informative)

    "OS virtualization is going to kill off the native OS X software market"

    Ahh, and welcome back to another thrilling episode of "doesn't know what the fuck they're on about" theatre!

    Honestly. OSV is SLOW compared to native. No one wants slow.
    [ Parent ]
    • Re:OS X Kernel - Why? by Whiney Mac Fanboy (Score:1) Monday May 22 2006, @08:38AM
    • Re:OS X Kernel - Why? by ArbitraryConstant (Score:2) Monday May 22 2006, @08:46AM
    • Re:OS X Kernel - Why? by dal20402 (Score:2) Monday May 22 2006, @10:09AM
      • Re:OS X Kernel - Why? by dal20402 (Score:2) Monday May 22 2006, @10:54AM
      • Re:OS X Kernel - Why? (Score:4, Interesting)

        by MagnusDredd (160488) on Monday May 22 2006, @03:39PM (#15383484)
        Quoth the AC:
        200 bucks for a Windows license? I don't think so. Are you so clueless that you think IT people drive down to the local computer store and buy a boxed copies of Windows???


        You're assuming that the only market for software is medium to large enterprise. Autocad (which is made by a well known vendor) is used by tons and tons of architects. Since I've worked in IT support for a few architectural firms, I can tell you that most of them are comprised of small business of under 50 employees. I've used Autocad under Windows, however when I needed to use something to make some plans for a shed for my church, I used Sketch-Up, because there's an OSX native version.

        Furthermore, most of the people that I've run across who are excited about virtualization are primarily interested in using it to run the existing Windows apps they own, and plan on replacing those with OSX native versions where available, and comparable OSX native apps where not available. The other major segment (where I fall into this equation)interested in virtualization, is the IT people who use/support multiple platforms.

        Boot Camp is for games. Noone I have spoken with that knows about virtualization is seriously intersted in using it for anything other than games.

        Saith the parent:
        "If you have enough Mac customers that your Mac software is a profitable product, you are going to lose money from your decision. If you didn't have that many Mac customers, you shouldn't have been making a Mac product anyway."

        Quoth the AC:
        Woah!

        Only someone who has never worked in a real life software dev house could make such a wildly stupid statement.

        + Savings from dumping Mac developers and overhead to support them
        + Savings from dumping Mac support and packaging
        - Percentage of Mac running customers who stop buying your product due to canceled OS X version

        Revenue goes down, but profits go up in almost every case outside of having 75-100 percent or so of your Mac customers stop buying your product. It is pretty funny to see Mac people freaking out about everyday business economics - "But that won't happen because I wouldn't like it to!" Heh.


        What?
        I'm not understanding something...

        This seems like Carly Fiorina Logic. If we stop making HP calculators, people will just buy handheld HP units with similar funtionality. It doesn't matter that the calculator group provides a substantial net profit for the company. If we stop spending all that money on supporting calculators and simply use the computer support people we already have... Think of the savings!!!!

        When a group/division in a company that caters to a market makes the company lots of money, leave them alone. They're doing their job, pulling a PHB stunt in wall street business tactics will only hurt your company.
        [ Parent ]
      • 1 reply beneath your current threshold.
    • 1 reply beneath your current threshold.
  • Re:Profit! (Score:4, Informative)

    somebody must have mispelled "book commercial" as "presentation".

    there's nothing really new in that presentation, most of slashdotters know this stuff already, the only thing that we didn't know as of yet is that you can mispell "book commercial" in such an interesting way.

    you can "troll" or "flamebait" my post, but this is the way that it is.
    [ Parent ]
    • Re:Profit! by bariswheel (Score:1) Monday May 22 2006, @09:51AM
      • Re:Profit! by dgatwood (Score:2) Monday May 22 2006, @04:40PM
    • Re:Profit! by ceri (Score:1) Monday May 22 2006, @02:41PM
  • by keiterk (976395) on Monday May 22 2006, @09:08AM (#15380007)
    Oh, and by the way, the hum doesn't bother me whatsoever. 90% of the time its perfectly silent. Also, my old laptop, an HP ZD7000 P4 3.2ghz had the EXACT same problem.
    [ Parent ]
  • Re:The average person (Score:3, Insightful)

    by LWATCDR (28044) on Monday May 22 2006, @09:20AM (#15380109)
    (http://www.gemstate.net/friends | Last Journal: Tuesday September 11, @10:32AM)
    So go read a less technical website than Slashdot.
    This story was boring because the presentation was dumb. It had a little useful information but not much. The subject is interesting.
    OS/X security? How to lock it down? There are many sites on the web. Look for just about any good site about UNIX security and start from that. OS/X uses the UNIX security model.
    [ Parent ]
  • by zpeterz63 (851922) on Monday May 22 2006, @09:49AM (#15380331)
    could care less

    I think you mean "couldn't care less". I don't really blame you as this is a very common mistake people make, but seriously, think for a moment on what you're saying.
    [ Parent ]
  • by Overly Critical Guy (663429) on Monday May 22 2006, @11:19AM (#15381252)
    You're right, the composition of that poem took the entire development staff at Apple to complete.

    We should all switch from Apple's "crappy kernel" to the wonderful Linux kernel, which is now so buggy even its major developers agree it needs a bug fix cycle.
    [ Parent ]
  • That's Edgar Allan Poe [wikipedia.org], not "Allen."
    [ Parent ]
  • Re:Comic indeed (Score:1)

    by ProKrypt (688278) on Monday May 22 2006, @11:34AM (#15381416)
    (http://prokrypt.mesoazn.com/)
    um.. Comic Sans was made by Micros~1
    [ Parent ]
  • Re:Why bother (Score:2)

    by Guy Harris (3803) <guy@alum.mit.edu> on Wednesday May 24 2006, @01:39AM (#15392144)
    Werent we told recently that we no longer have the right to make modifications and compile the apple kernel from source?

    No.

    Maybe it would be useful to look at it for learning purposes, but now-a-days I believe you can get into quite a bit of trouble if you look at source code thats not your own then go off to make your own project under a different licence.

    "Now-a-days"? Try releasing a *BSD system under the GPL, or the Linux kernel+glibc under a BSD license, and see how much trouble you get into.

    Whether looking at project X and using its ideas when writing a new project gets you into trouble is another matter. I'm not sure whether the GPL [gnu.org] or the modified BSD license [xfree86.org] or the APSL [apple.com] limits what you can do if you read code covered by that license or not.

    [ Parent ]
  • Way off...

    "The OS X kernel has been in the news alot this past year, whether it's why its slow, Mach/micro-kernel makes it bad, it's going closed source and what not. Amit Singh has put up a new presentation on the innards of OS X."

    "The OS X kernel has been in the news alot this past year. Whether it is why it is slow (Mach/micro-kernel makes it bad) or it is going closed source and what not, Amit Sing has put up a new presentation on the innards of OS X."

    The OS X kernel has been in the news a lot this past year; either a discussion of why it's slow, or why a mach/micro-kernel makes it bad, or because it's going closed source, etc. Amit Singh has put up a new presentation on the innards of OS X.

    (You skipped over the 'a lot', messed up the meaning of a sentence with parentheses, changed a period to a comma that should have been a period, ruined someone's last name... you have no right to be a grammar nazi!)
    [ Parent ]
  • 12 replies beneath your current threshold.