Home > Mac OS X > What is Mac OS X? What is Mac OS X? Eugenia Loli 2004-01-07 Mac OS X 36 Comments This document attempts to give a hacker over-friendly answer to the question “What is Mac OS X?”. About The Author Eugenia Loli Ex-programmer, ex-editor in chief at OSNews.com, now a visual artist/filmmaker. Follow me on Twitter @EugeniaLoli 36 Comments 2004-01-07 6:46 pm OS X is one if not my favorite OS for average computer user – affordable & stable. 2004-01-07 6:48 pm The author gets the Mach 3.0 citation right, but misses the BSD one. The BSD is not FreeBSD 5.x, but 4.4BSD-Lite2. It is mentioned repeatedly in the Apple developers documentation, and is in the OpenDarwin FAQ: “Mac OS X began life as a child of OpenStep 4.x. The first stage in the evolution was the move from OpenStep 4.x to Rhapsody, which was based on BSD Lite2, with a batch of NeXT-instigated changes. When we shifted to Mac OS X from Rhapsody/Mac OS X Server, we incorporated FreeBSD 3.2 changes for the networking piece. The rest of the BSD portion of the kernel remained more or less as it was. At the same time, we (i.e., Fred, with your [Darwin’s] help) pulled in command and library updates. Most of these are from FreeBSD, although I’m not positive about the heritage of the pieces that are now in the system.” 2004-01-07 6:49 pm I have read that Panther is indeed built off of FreeBSD 5.x 2004-01-07 6:51 pm >I have read that Panther is indeed built off of FreeBSD 5.x OSX has some code from FreeBSD indeed, mostly off 4.x though. All their new BSD code is based off FreeBSD, but not everything is FreeBSD as Rayiner said. 2004-01-07 7:10 pm Unlike NetBSD and OpenBSD, FreeBSD decided to stick with the Mach VMM, and its VMM today traces its legacy back to Mach. In addition to networking, XNU (the Darwin/OS X kernel) uses two major components from the FreeBSD kernel, the Unified Buffer Cache (UBC) which attaches to the VMM, and the FreeBSD VFS, which attaches to the kernel through the UBC. This is also where the kqueue mechanism attaches to the kernel. Traditionally the VFS would be managed by a Mach server, but XNU uses no Mach servers whatsoever (most likely for performance) In 10.1 the userland tools were a hodge podge collected from FreeBSD, OpenBSD, and NetBSD, but since Apple has moved primarily to FreeBSD as the source of all userland utilities. 2004-01-07 7:48 pm A lot of the userspace stuff is FreeBSD, but most parts of the kernel are 4.4BSD (excepting networking and a few other bits). Not a big deal for Apple’s target market, but may become more important if XServe really takes off and Apple wants to start going after traditional UNIX vendors. If anyone is really interested, you can always take a look at the source: http://cvs.opendarwin.org/index.cgi/src/ http://www.freebsd.org/cgi/cvsweb.cgi/src/ http://www.tribug.org/pub/4.4BSD/4.4BSD-Lite2.tar.gz The Darwin BSD code is in src/xnu/bsd The FreeBSD kernel code is in src/sys The 4.4BSD kernel code is in 4.4BSD-Lite2/sys Its fascinating, really. They are clearly derive from the same codebase (4.4BSD) but it is fairly obvious that the FreeBSD code is more recent. Interesting places to look: the ‘kern’ subdirectory of all three trees holds the core kernel code. While the directory and file layouts are similar, the implementations are very different. Compare kern_proc.c in both trees. 4.4BSD and Darwin are nearly identical, while the FreeBSD code doesn’t even have many of the same functions. Also, compare the ufs/ufs directory in all the trees. The Darwin and 4.4BSD ones are nearly identical, and FreeBSD is similar, but has new features like directory hashing. Its also interesting to note the ‘vm’ directories. ALl three have completely different VMs, and its clear that NeXT removed most of the BSD VM and made it depend on the underlying Mach VM. Compare the ‘net’ directories in the trees, and you’ll see that Darwin is very similar to FreeBSD in a lot of places, and quite different from 4.4BSD. Diving through all this BSD code actually a nice mix of technology and archeology One thing that is clear everywhere is that the BSD code is very well done, and its obvious where its reputation for being squeaky-clean came from! 2004-01-07 8:13 pm Are you sure the VFS is from FreeBSD? The code looks very different. Compare cache_lookup() in vfs_cache.c (src/xnu/bsd/vfs in Darwin, sys/kern in 4.4BSD and FreeBSD). The Darwin and 4.4BSD versions are nearly identical, and the FreeBSD version is very different. On the other hand, lookup() in vfs_lookup.c is nearly identical, and different from the 4.4BSD version. My guess is that the code is probably a mix of 4.x FreeBSD and existing 4.4BSD code. 2004-01-07 8:20 pm Ah ha! http://www.geocrawler.com/archives/3/158/2001/10/50/6766298/ Note that the message is from an Apple engineer. 2004-01-07 8:29 pm some replies seem to be very good .. looks like experienced kernel hackers replies, good. for the past weeks i am dicussing , Why/Can SCO trouble APPLE for using System V code in MAC-OS 9,10 ? IS there alleged SCO Code in APPLE’s OSes? Ofcourse, SCO hasnt revealed and proved that much CODE that it properly put LINUX down on mat , but is there a possibility APPLE might hear from SCO . If interested to read or reply the question please visit this thread :- http://www.neowin.net/forum/index.php?showtopic=126350&st=0 Thanx. 2004-01-07 8:33 pm Are you sure the VFS is from FreeBSD? The code looks very different.[…] My guess is that the code is probably a mix of 4.x FreeBSD and existing 4.4BSD code. Well, after having a look through http://cvs.opendarwin.org/index.cgi/src/xnu/bsd/sys/ it appears that much like the 10.1 userspace, portions of the code come from a number of different BSDs as well. Have a look at this: http://cvs.opendarwin.org/cgi-bin/cvsweb.cgi/~checkout~/src/xnu/bsd… Part of the SysV IPC implementation comes from NetBSD. I’m rather uncertain about the VFS now. It seems like much of it is Apple’s own implementation based in part on FreeBSD code, partly upon NeXT code, and partially upon recent work. Have a look at vfs_cache.c: http://cvs.opendarwin.org/cgi-bin/cvsweb.cgi/~checkout~/src/xnu/bsd… The only real clue that it’s FreeBSD related at all is this small section in the copyright information: This code is derived from software contributed to Berkeley by Poul-Henning Kamp of the FreeBSD Project. So I’m uncertain as to the true pedigree. The UBC seems to be a fresh implementation, rather than a port from FreeBSD: http://cvs.opendarwin.org/cgi-bin/cvsweb.cgi/~checkout~/src/xnu/bsd… 2004-01-07 8:42 pm Nice article in general. However, the implication that the only games available on OS X are simple Breakout-like ones is accurate. There are plenty of games available. Most good PC games eventually get ported. It lacks in the sheer number of games and you often need to wait a few months after PC versions for your OS X ones. I find the Mac sufficient for casual gaming. 2004-01-07 8:43 pm “The author gets the Mach 3.0 citation right, but misses the BSD one. The BSD is not FreeBSD 5.x, but 4.4BSD-Lite2. It is mentioned repeatedly in the Apple developers documentation, and is in the OpenDarwin FAQ:” That’s all well and good, but from looking at the source, I can tell you that the BSD kernel stuff is taken from FreeBSD, which is the 4.4BSD-Lite2 derived code. I have no idea what it was originally, but as time goes on, they are importing FreeBSD kernel code as well as libs and utils. There are a few utils from both OpenBSD and NetBSD as well. I think that FAQ needs just a little revision. Who’s to say that it was written by someone with first-hand experience with the codeand history? 2004-01-07 9:25 pm Who’s to say that it was written by someone with first-hand experience with the codeand history? ———- Justin Walker, the guy who wrote the statement, is a Darwin commiter (networking) and used to work at Apple. 2004-01-07 10:13 pm Thanks for informing me. I didn’t feel like checking 2004-01-07 10:59 pm “Note that current (at least G4 and above) Apple computers come with Ethernet ports that are auto-sensing and self-configuring, so you do not need a cross-over cable to connect it directly to another computer (no hub is required, etc.).” Note that I’m a Mac user, (w/ an iBook 600 if you don’t know from my previous comments.) However, I just use the Mac b/c it works for me. I have no religious attachment to it, and I don’t care if you hate it. It’s small things like the ethernet, and firewire target disk mode that either make life a lot easier, or can really save your ass. The telnet one is news to me, though. (Macs have their own set of annoyances, though. Especially when Apple ships software that is not release-quality. Here’s looking at you iTunes 2.0, iPhoto 1.0, and 2.0, Panther, iMovie 3.0, and QuickTime Player, which seems stuck in the purgatory of mediocrity.) Oh, and for those who hate Macs, go here: http://www.mercury7.net/m7/video/nullification.html Some macophile friends of mine with too many half-working Powerbooks that a local Apple dealer was throwing out, an air cannon, some D-Cell batteries, and too much time on their hands. Notice the one screen with a hole in it whose backlight is still glowing that appears toward the end of the video. 2004-01-08 12:48 am Newer versions of HFS+ support case-preserving, case sensitive modes, though this is disabled. Also, though I don’t understand it in great detail, NetInfo was completely ignored. I believe that the rc scripts are executed first, and the properties specified therein are applicable at certain points of boot, until NetInfo takes over. I believe NetInfo allows for services akin to, but not exactly the same as Active Directory. There was one other thing I noticed, but I forget what it was. Oh, well! 2004-01-08 1:34 am — “Why/Can SCO trouble APPLE for using System V code in MAC-OS 9,10 ?” — No. Apple has a valid licence from SCO and has had it for a long time. Besides, don’t forget A/UX, Apples version of System V. 2004-01-08 1:55 am SCO reported that Sun was the only one that had a full UNIX license. The real reason that SCO cannot target Apple is that there is no SysV code in OS X, and that the BSD court case sets a precedent. 2004-01-08 9:56 am I have recently finished reading a BSD book written in french (“Cahiers de l’admin : BSD”, published by Eyrolles in 2003). It ends with a script that parses the source code of a given Unix-like operating system and displays the number of C files that were “borrowed” from somewhere else. Guess what : according to that example, OS X contains more files taken from NetBSD or OpenBSD than FreeBSD. I’m not at home right now but if you want I can give you the exact numbers this weekend (just to say that I’m not making this up). 2004-01-08 10:14 am Yup. They’re importing more from FreeBSD, but in the begining there was quite a bit more of the other two. 2004-01-08 1:05 pm Some of the better information i have seen published on OS X. The best explination of the problems with linux i have seen yet from anyone. I bought an older G4 PowerBook in october of last year and couldn’t be more please with a platform. I recently installed X11 for OS X to shell X windows apps from the Solaris boxes i Admin. It is so much faster then Linux or BSD the two platforms i used previous to do the same task. I am constantly impressed with Apples implementations of Unix area applications/Tools. 2004-01-08 4:11 pm For once a full fledge well thought out article. Obviously the author knows what he’s talking about. 2004-01-08 4:22 pm I bought a 12″ Powerbook on 12.05.03, still not impressed. I purchased it for casual use at home when I wanted a break from the work day programming tedium on windows…but my “break” has turned into a frustrating headache. It’s a beautiful OS, but try to get any real work done and you’re SOL, at least in my experience. Anyone want a new 12″ Powerbook? (accidentally threw away the box but everything else is there for the taking…) 2004-01-08 4:52 pm Depends on what you mean by real work. It works fine for me, and I’ve been using Linux at work. Currently in the process of migrating things over to OS X. 2004-01-08 5:09 pm I dont know much about Mac OS X since i am a regular windows user but i do agree on one thing of this Article about windowXp problem. Man they are real. Since i am also using WinXP i have to tell u guys that windows IE 6 crashed a lot and there is still a lot of activity still going on even when the OS is completely booted, makes me feel what the hell it is doing??. If i put on the firewall the system works fine but the network slows down making my 11Mbps connection to 10kbps and if i remove firewall all the nasty trojan keep on appearing on my PC. 2004-01-08 5:44 pm “Depends on what you mean by real work. It works fine for me, and I’ve been using Linux at work. Currently in the process of migrating things over to OS X.” “Real work” at home means web development activities (coding, image work, etc…), with a splash of Python app development thrown in for good measure. Even on a 1ghz G4, 512mb of ram, the entire experience feels sluggish and heavy to me…the water sure is beautiful but difficult to swim in because it’s not water, it’s jello. The command line experience is fine…no complaints there -it’s nice having unix lying around beneath everything. Once you move into the GUI realm the problems abound. I can’t find a decent editor/IDE for the programming I do – SubEthaEdit would be perfect if it just supported tabbed documents. I like where xcode is going but then it only supports a limited number of languages (which I can understand, but still) Tried a number of others (bbedit, pepper, etc…) but none were suitable for my needs. Image management is a bear…there’s no thumbnail preview in the Finder which means you’re forced into using a separate app to view/manage your images. iPhoto would be alright if it wasn’t terrible, and I’d prefer not to have to open an app such as photoshop for no good reason. Using image management as the basis for comparison, Windows, GNOME, and KDE (not as familiar with the rest of the *nix WM’s) all have something like thumbnail previewing built in to their respective file managers, and all perform admirably and feel much lighter and faster than OS X. (panther) 2004-01-08 6:23 pm .there’s no thumbnail preview in the Finder Yes there is. 2004-01-08 6:58 pm OS X is really really sweet, as this article states, especially because I’m a FreeBSD user. But I’m a Mac-Hater. This is because I’m “only” middle class. I am not in that upper echelon, driving Mommy’s BMW, and therefor I NEVER look at Apple Hardware. And Apple IS a hardware company. But to be honest Apple’s consumer hardware is downright insulting. I believe the XServe G5s have a really good chance in the ENTERPRISE market (esp. those cluster ones) and the PM G5s looks especially nice in the PROFESSIONAL UNIX workstation market, in fact, I would go so far as to say they’re a steal (I can imagine (and heard) engineers from companies such as Sun prefer these over their own company’s offerings). But every product that contains a G4, and for the rediculous price Apple sells them for looks like crap to me. This is due exclusively to the system bus the G4 uses. Talk about 1995. It can’t even make use of DDR SDRAM , I imagine they only use it because supply/demand leaves them no choice financially. And yet Apple sells these machines all over the 1000 mark. I don’t pay a grand for sub 200 mhz effective bus machines.. in fact I’ve had 3 pentium2-3 donated to me by friends buying AXPs and P4s. 2004-01-08 7:04 pm thx “hah” – my apologies – spoke too soon. looked it up and it does have it – i don’t have the machine in front of me so i can’t try it out. seems there were some problems under jaguar with the speed of this option – have these issues been addressed in panther? okay, one issue down, anyone have any suggestions for text editors? my current staples are TextPad and Visual Studio on Windows, and Kate on KDE. (I’ve been toying with learning vim but for now I’d really prefer to stay with a GUI) sorry to turn take this thread off-topic, just rather frustrated and in need of help atm. 2004-01-08 7:19 pm I’ve never used it, but BBEdit appears to be the most used Mac editor. You don’t mention it in your post. Have you tried it? Also, take a look at jedit. It should run quite well on a Mac, given the Apple java enhancements. http://www.jedit.org/index.php?page=screenshot&image=23 2004-01-08 7:44 pm Kate on KDE should get ported sometime, the KDE framework works on the Mac. KDE has been ported by Fink IIRC so sou know that you can even swap KDE for Aqua (admittedly you’ve probably got to be Guru level to do it but it is possible). Personally I use BBedit Lite when playing with Python. 2004-01-08 7:58 pm beacon – thx for the advice. i’ve tried both bbedit and jedit but without luck. (although admittedly when i installed jedit it didn’t look anything like that screenshot you linked to – don’t know what’s going on there) i just want tabbed documents and good, configurable syntax highlighting. jedit is close but didn’t really have the right feel to it…i’ll give it another shot i guess. 2004-01-08 8:37 pm I’m not trying to start anything here but buying a PB then using it for 20 minutes isn’t going to make you are pro. Sit down with it and just play with it. You’ll enjoy it. O an d get Panther, it offers more speed, jaguar is sloooow. I remember when i tried to code Java on an iBook i once had, it sure was slow so i can agree there. 2004-01-08 9:12 pm CrackedButter – that’s not the case here. I’ve seen similar advice posted elsewhere…that’s why I’ve given it an entire month. I’m a very patient person and I stick with most everything until I reach the level of proficiency I’m after. I’m past the point of no return here, it’s either eBay or keep it, and I’m inclined to not lose any of the money that I’ve invested in this machine thus far. I want to be a “believer”, I really do, I’m just posting my impressions thus far. (admittedly, my initial post might have sounded like i’m giving up but i don’t think i’m going to at this point) 2004-01-08 10:16 pm Have you considered joining a support mailing list, such as the Mac OS X support list on Yahoo? While I don’t think you will find many coders on such lists, you can often find good help on the day-to-day stuff on running OS X. I ran OS X on a PowerBook 800 mgz and didn’t find it particularly slow, especially with Panther. My PowerBook 1.33 ghz zips right along. There are ways to optimize your OS X experience. 2004-01-08 10:50 pm Go to http://www.macrumors.com and join up on the boards, interact with other users, i’m registered there under the same name so talk to me if you want? Leroy is correct aswell.