Department of Physics and Astronomy

Initial Report on Mac OS X

This is my initial overview of Mac OS X, which I sent to two colleagues in Michigan after I had finally had a look at it. The main conclusion is that Mac OS X is the successor to NeXTStep, and most everything we know about administrating a NeXTStep machine applies to Mac OS X.

11 September 2002

Dear Jim and David,

I've borrowed an Apple PowerBook G4 with Mac OS X on it for a few weeks, and it's giving me a chance to get familiar with Mac OS X and to see how much it resembles a NeXT. The overall answer, short and indeed sweet, is that underneath it all it it's almost exactly like a NeXT. Just about everything you guys know about managing a NeXTStep machine can be applied to Mac OS X, or at least to Darwin, which is what they call the Unix upon which Mac OS X is built. (The windowing system is apparently called Aqua.) These notes summarize the most noticeable similarities to and difference from NeXTStep, and where appropriate the differences from Linux.

Mac OS 10.2 (called Jaguar) came out just this past weekend, but I have been using 10.0. From what I've heard the major differences are all in the Aqua GUI interface or in tools which run under it, not in the Unix, so for practical purposes my comments below probably apply just as well to both. When I get a chance I'll try to upgrade and see if anything is really different in Jaguar.

GUI and appearance

One thing you'll notice right away is that there is a lot of the "look and feel" of the NeXT. Unlike the old Mac's, you have to log in to the machine as a valid user, and when you type an incorrect password into the login box it shakes "no" sideways just like a NeXT does. (And just like a NeXT, you can set it up to automatically log you in at boot time, though of course you shouldn't do this.) The same sounds you have on the NeXT are available (plus a few new ones). I have my alert sound set to "Basso" just as I used on yuling. Even the keyboard is very much like the NeXT keyboard: there are keys to adjust the screen brightness and sound level. You'll remember that NeXT replaced the "apple" key with a similar key but with a "propeller" logo on it; on this PowerBook there is one key with both the apple and propeller printed on it. I don't know if you ever noticed, but on old Mac's there were little raised bumps on the D and K keys to help your fingers find the typists "home" position, whereas PC keyboards had the bumps on the F and J keys. It always confused me when I switched between a Mac and anything else. Well, this new G4 has them on F and J -- no more confused fingers. Except...

The most noticeable (and painful) difference is that the control key is down next to the propeller and alt/option keys, rather than at the left where the Unix gods intended. I have not yet found a way to turn the Caps Lock key into a control key, but I haven't given up hope yet. (Turning the Caps Lock into a control key is one of the first things I do to a Linux box when I get my hands on it.) The good news is that the other keys are all in the "right" places. For example, TeX users will be really happy that the backslash is not off in right field, it's over above the Enter key. (I found a way to create an extra backslash key on yuling so if I remember how I did that then maybe I can do the same thing to turn CapsLock into Control.)

Once you have logged in to Mac OS X a lot of other things feel like a NeXT. There is a Dock, though it can be on the bottom of the screen (which seems to be the default) or on either side. (I think you could move the Dock in NeXTStep too, but the default was on the right.) Getting an application to stay in the dock between login sessions is slightly different from in NeXTStep. In Mac OS X you launch the application and then click on the icon in the dock while holding down the control key. This brings up a menu which lets you check off the menu item "keep in dock". To remove something from the dock you simply drag the icon out onto the desktop and it disappears in a little cloud of smoke.

You'll also see some NeXT in the file browser. Aside from showing files as icons or as a list, you can get the "column" display that you've already seen in NeXTStep and in the NetInfo Manager.

Unix CLI

To get a shell you need to run the Terminal application, which is at Macintosh HD->Applications->Utilities->Terminal. The default for new accounts is tcsh, and just as on a NeXT even csh is really tcsh. The Bourne shell is zsh, not bash, and it does support shell function definitions.

The feel of the Unix is definitely BSD, like the NeXT, but they do seem to have made some concessions to Posix, though I cannot tell from just a quick look whether or not it is truly Posix compliant (I doubt it). However, for example, they have finally added uname (which came from SYSV -- on NS 3.3 at UM I had to write my own script to do this to make my tools work across different flavors of Unix) . The result of `uname -a` is:

  % uname -a Darwin localhost 5.5 Darwin Kernel Version 5.5: Thu May 30
  14:51:26 PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC Power Macintosh powerpc
So the Unix on Mac OS 10.0 is Darwin 5.5. The windowing system running over this is called Aqua. It's Aqua that provides the same GUI look and feel as the traditional Mac (more or less) with the added NeXT features.

The kernel is indeed mach, though it has the name /mach_kernel rather than /sdmach. The root user has a separate home directory, /var/root, rather than using / -- I think NeXT was one of the first systems to do this. Just as in NeXTStep there are both the traditional Unix directories (/etc, /usr, /tmp/, /dev, and /var -- did NS have /var, or /private?) and the specific directories for this OS and Window system with intercaped names (/Library, /Applications, /System, /Users, /Developer etc..). The names are not the same as in NeXTStep, but the idea is the same.

The traditional code development tools are there: emacs, vi (of course) and gcc (and as on NS cc is the same as gcc). Unfortunately there is no f77, but there wasn't native Fortran on the NeXT either. (On yuling the only thing we had was a script that ran f2c and then compiled the C code.) The version of gcc is 2.95.2 so they have avoided the problems of 2.96 (while Red Hat did not). There is a GUI program called TeXshop to run TeX, but it looks for a teTeX installation in /usr/local/teTeX and there is nothing there on the machine I have. On the other hand Mathematica 4.1 is installed. I don't know if that is standard or a Vassar addition.

Other important improvements are the addition of ssh (it's OpenSSH 3.4p1 so it's fairly current), perl 5.6, and BSD (not GNU) locate. I was also able to install and run MacSSH (it runs under the Mac Classic system) but hey, who needs it when I have a shell and CLI ssh. You also get rsync, though you have to tell it `rsync -e ssh` to use ssh not rsh. There is sudo, env, RCS, and a number of other goodies.

A number of Unix commands have the same "feel" I remember from the NeXT. For example, the version of 'more' is really dumb and won't let you back up a page (though they now include 'less' for that -- I always had to build less myself on NeXTStep). The 'msgs' system is already installed (oh Joy), so this really is a BSD system. The su command will only let you su to root if you are in the "wheel" group -- something I've only seen enforced on a NeXT (but I'll bet this also derives from BSD). AS I remember, in NS 3.x there were actually 2 version of su, and one enforced the wheel group restriction and the other didn't, and /bin/su was just a link to the one you wanted to use. There is only one version of su on Mac OS X, and it is su.wheel.

One thing I have noticed though is that there are also a lot of things either missing or intentionally removed, even though the man pages have not been brought up to date. The man page for the su command says it will get a Kerberos ticket, but even though there are references to the most common Kerberos commands there they are not actually on the system. But it does appear that some commands (like rsh and rlogin) are actually kerberized underneath.

I'm not familiar with OpenBSD enough to say for sure, but just from all the man pages it looks like everything is based on BSD 4.4 and not on OpenBSD.

Configuration system

Just as on a NeXT, common system configuration information which is traditionally kept in /etc is also available in NetInfo or in NIS. In fact, just as on a NeXT all the config files in /etc, like passwd and printcap, have a disclaimer saying that they are only used at boot time and are not effective when NetInfo is running.

Just as on NeXTStep, key system information like the hostname and whether or not to turn on NIS, NetInfo, AppleTalk, etc. are kept in the file /etc/hostconfig. The commands nidump and niload are there for converting between NetInfo traditional Unix flat config files. I have not yet tried my niedit script (which is like vipw and does an nidump, lets you edit the file, and then does an niload). You may recall that we had to be careful about using niedit on the 'machines' map (which maps to /etc/hosts) because it would loose extra information in NetInfo about the NetInfo server. I suspect one also will now have to have to use the same caution when editing the 'users' map (which maps to /etc/passwd) because in NetInfo they have added extra fields for things like a password hint (both useful and dangerous -- you can and should turn that off).

There is no shadow password file, and passwords use DES not MD5 and so are presumably easily crackable, but only to someone who knows how to get the password list out of NetInfo. Most script kiddies will try to crack /etc/passwd and get nothing.

There is a NetInfo Manager in the Applications->Utilities directory and while it looks a little different it works more or less the same as the same thing on NeXTStep. Anybody in the 'wheel' group seems to have administration privileges, but it does ask you to authenticate each time you commit changes.

Since NetInfo appears to be the same I would really like to put it to the test by adding a Mac OS X machine to a NeXT cluster. You guys have yuling and williams still running so maybe you can try it out and let me know how it works.


The laptop I'm using has two internal NIC's, one wired and the other wireless. The system tries to start both at boot time. The names are slightly different. The ethernet interfaces are 'en0' and 'en1' (the first for wired, the second for wireless) while the loopback device is called 'lo0'. You can list the status of all of them with `ifconfig -a` but not with `ifconfig` by itself as on Linux. Similarly, the route command won't list routes. In fact the man page says there is a `route show` command but they lie (as can be proved by `strings`). To list the routing table you need `netstat -rn` (or just -r if DNS is working well). Ping gives you sequence number and round-trip time as it should, not the dumb "host is alive" crap you get on a Sun.

There have been some improvements. The traditional inetd is still there (not xinetd as on RedHat 7.x) but everything is commented out for security (as well it should). They have added TCP wrappers (aka libwrap, aka tcpd) for access control. It's the same syslogd we already know, with the log files kept in /var/log. I haven't tested remote logging but the man page says it works.

There is now ssh (good thing!) and it's even fairly current (OpenSSH 3.4p1). There is also an sshd but it's not started at boot time and I've yet to find out how to start it.

Printing and E-mail

As on a NeXT printing and e-mail seem to be bifurcated: there are printing and e-mail applications that run under the GUI and have nothing to do with the Unix printing and e-mail systems. The GUI mail reader supports IMAP and MIME attachments and will spool messages while you are off-line. I have not figured out whether or not it can put read messages into a read-messages folder automatically the way pine does (which I like).

The only thing I've done with the GUI printing system (which is under Applications->Utilities->Print Center) is try to define a network printer (this seems to be supported using the BSD protocol, ie port 515). I successfully define a printer but it did not show up in either /etc/printcap nor the NetInfo map. I remember that the NeXT was similar and I never used the GUI print tool. I will try to print something remotely this way when I get a printer set up for the test.

Unix printing is BSD, with printer info stored in the NetInfo map called 'printcap'. They seem to have fixed the problem I remember in NeXTStep of the lpr command ignoring the PRINTER environment variable, but I have not tested that completely.

The Unix mail system is sendmail for MTA, including smrsh, and procmail for local delivery, but the sendmail (version 8.10.2) is very broken in many ways! By default new users have a .forward file which is a link to /dev/null (huh?) and you can't start the daemon without errors. It looks like someone built it but never actually tested it or intended to use it. Maybe this is fixed in Jaguar? For what it's worth the config files are in /etc/mail (even and the executable is /usr/sbin/sendmail not the traditional /usr/lib/sendmail (and that makes more sense).

System startup

The startup system is straight BSD, not SYSV. The files are /etc/rc, /etc/rc.boot, and /etc/rc.common. Configuration parameters are in /etc/hostconfig. None of these startup scripts even mentions rc.local, so there doesn't appear to be much room for customization beyond this. The hostname is set by changing the HOSTNAME variable in /etc/hostconfig, but the name of the machine displayed on the login shield is actually taken from the APPLETALK_HOSTNAME variable in the same file. I have not figured out how to start NFS or even just the portmapper. It may be that they didn't finish getting it ready.

Just like NeXTStep the swap system uses a swap file, not a separate disk partition. The swapfile is in /var/vm and while there is a man page for /etc/swaptab there is no such file on this system. Swapping seems to be configured using /sbin/dynamic_pager, for which there is no man page, not using mach_swapon, which is cited in the man page for swaptab(5).

In addition to the BSD startup the windowing system does it's own startup. I don't know much about it, except that it appears to be somewhat different from the "extensions" of OS9. Just as on a NeXT, the windowing system is started up by getty, as described in the file /etc/ttys. You may recall that I was able to get a NeXT to boot headless by commenting out the window system startup and by building a dongle to connect the 'on' pins on the monitor/keyboard connector in the back. (Getting a headless NeXT to run a printer requires more wizardry, but I was able to get yuling to do that too.) I would like to try the same experiment on this machine, to comment out the window system startup and boot to just Unix. But I won't try it until I get my stuff off this thing, since I could well hose the whole system (for example, I may need to remember to add passwords to /etc/passwd). I'll let you know what happens.

Mac Classic

Obviously changing the inner workings of the OS would break lots of things for older software unless provisions were made for backward compatibility, and of course they were. Any application built for Mac OS 9 (and earlier?) is run under something called the 'Classic Environment'. This has worked fine for both MacSSH and MacGSView (the Ghostscript viewer). I downloaded PPC binaries from the net and they installed and work find. The one thing you will notice is a short delay as Classic fires up for the first time. After that, it's a regular OS9 Mac, and even the toolbar along the top and the menu format changes back to the older look and feel from OS9.

Even though software made for OS9 all seems to work, it isn't always as fast. My brother gave me a game called Diablo II, which is basically fancy souped up version of rogue or nethack (remember those?). It has a lot of graphics and sound as you fight the monsters. Running this game sends the CPU usage up to 100% even when nothing is happening, and when you are fighting the monsters there are really noticeable delays. In contrast the game runs fine on my brother's Dell Inspiron. Of course it is running Windows 98, which doesn't have the overhead of both a true multitasking OS and the Classic emulator on top of that. When my saw the same game running on my computer he asked me what was wrong with it. Well, maybe you can make the machine dual boot to include direct OS9 for game playing?

One thing I found very interesting is that Microsoft Word and PowerPoint seem to work fine on this thing, and they are not running in the Classic environment. It's a bit strange to do a `ps` and see a Unix process running that has "Microsoft" in the command path. I wonder when Billy will let loose the Linux versions on us? (I'm sure he's got someone doing it, even if he decides never to release it - he's no fool, and Corel already has a Linux version of their word processor.). Actually, I didn't even think of it, but Internet Explorer is also running on this thing outside of the Classic Environment.

I'll tell you more later when I get to play with with Jaguar. And I'll let you know how my experiment goes with turning off the windowing system. I hope you guys can try out adding a Mac OS X machine to your NeXT cluster. It would be great to confirm that NetInfo does work between Apple and NeXT, though I'll be really surprised if it doesn't.


  Copyright © 2005 by Spy Hill Research (served by Last modified: 19 January 2005