April 24th 2002
By Mike Flaminio
Last week was an interesting column with plenty of feedback. I lined up my top ten gripes about OS X. I came up with a couple more in the past week, first is better SMB support. Yes, OS X lets you connect to Windows computers, but it's awkward to do so. A SMB network browser is needed to simplify the task. Second, built-in multi-disk burning support. This is because I'm lazy and never trusted most backup utilities. I think it would be cool to take my whole hard drive and burn it to DVD or CD and when the first disk is full, it asked for a second and so on. Other than Retrospect, I'm not aware of a utility that will do this.
Yeah, this is getting old. Anthony Papineau wrote in with some suggestions for a fix to my problems. Basically he suggested that I make a startupitem, which will set the root directory's permissions to 755. There are two problems to this, first which is actually outlined below is something not to do -- mess around in the /system/library folder. The second is I'm not sure of all the repercussions of restricting the root directory.
The other suggestion was to disable the group-write security measure in Sendmail. I'm assuming that the security measure is there for a reason, so I'm content to side with caution and not make any changes. So I made up my own startupitem that will change the root directory's permissions each time at start up. I'll run it for a while before posting my fix and see how it goes.
I found a cool piece of software last week that I thought I'd pass along. It's a little freeware app called WeatherPop that places the current weather in your menu bar. Definitely worth a download.
OS X Hacks
Finally, I'm looking around for some OS X/Unix hacks. Basically I'm looking for stuff that adds some cool functionality to OS X for a future column. If you have any suggestions, please email me.
OS X v. OS 9
This week will be a little more of a remedial column. We'll take a look at the main differences between Mac OS 9 and Mac OS X. It'll be a good read for those new to OS X or considering switching. Also, it'll put down a foundation for the upcoming OS X troubleshooting column. I'll try to keep to short, except for the key area I want to stress.
To briefly explain how OS X works, here's my recreation of Apple's OS X layers diagram. Essentially what we have is Darwin, the BSD-based Unix foundation and the media layers including 2D PDF-based Quarts, 3D OpenGL, QuickTime video and audio. On top of that we have our application environments, Mac OS native Cocoa and Carbon, legacy Classic and Java 2. To top things off, Aqua is our user interface.
From this graphic, we see two particular things, first the Darwin layer and second, the application layers. Note that Darwin is the foundation for the entire OS, and that the application layers exist side by side. As most know, Classic offers legacy compatibility for older Mac OS applications. It should be clear that Classic is not an emulation, running on top of Carbon.
All combined, we find OS X's strengths. One other feature is the removal of evil software called system extensions and control panels. Instead, added functionality within OS X is achieved through an application. This provides one key feature, which is separation between software and the OS. If something goes horribly wrong, the offending application can die or be killed and all will be well again. To see for yourself, open up the terminal and type in ps -ax to see all running applications. The Dock, for example, is not part of OS X, but a running application. In fact, the Finder itself is an application.
Buzz Words Compliant
I'm sure everyone has heard these things before, but I'll put them in anyway. Not to diminish their importance, but after years of talking the benefits of OS X, these points get a little boring. I'll cover it briefly with the assumption that everyone else feels the same way.
Protected Memory - Application memory isolated from other applications. If one application crashes, the OS and other running applications are unaffected.
Preemptive Multitasking - Shares CPU resources. Allows primary applications to utilize most CPU power, but still allows other tasks to function, like the Finder or Web browser. This essentially keeps one application from locking up the computer. The down side is some performance may be lost, as a single program can't utilize as much CPU power at once (in other words, locking up the computer).
Virtual Memory Manager - Dynamically allocates memory to fit application's needs, resulting in more efficient memory usage.
Symmetric Multiprocessing - Evenly shares two processors for all tasks when running in Cocoa, Java 2 or Carbon.
Multithreaded - Allows applications to divide up larger tasks into smaller parts. Needed for efficient multiprocessing.
OS X is a multi-user OS. OS 9 had support for multiple users, but nothing like OS X. Each user in OS X has their own directory. This directory contains everything from documents to settings/preferences. Users can log in locally at the Mac or remotely over a network. When a user logs in, their computer contains complete different information from other users.
There are numerous advantages to how OS X handles users. There are three in particular -- security, system stability and customization. Multiple users are secure, as each user cannot access or modify other user's files and settings. It's stable, since one user is limited to how it can effect the system as a whole, and it's customizable, as each user can have their own desktop picture, fonts, screen saver, etc. Also, each user can have their own applications settings, such as email and web browser settings, allowing each user to run the same installation of an application, but have individual settings such as mailboxes and bookmarks.
With multiple users come things such as permissions, which is a little foreign to Mac users. This means basically we don't have access to part of our own computer. Kind of scary, but it's for our own good. It's not that we're too stupid to know what we're doing, but accidents happen and a unix-based OS isn't the easy thing in the world to fix.
OS X's system structure can be a little confusion, but it makes perfect sense. Basically there are three levels to the OS X system. We'll call them the core level, system-wide level and user level. This is completely different than OS 9 and is the heart of how OS X works. I'm going to get a little in-depth here, but stick with me as this will tie into the troubleshooting column.
There are four key directories we'll talk about. First is the System folder and second is a set of three Library folders. Mac users might think they're familiar with the System Folder, but this is not the folder we all know. Mac users are used to rolling up their sleeves and working in the OS 9 System Folder to move around extensions/control panels, preferences and other important stuff. The OS X System folder on the other hand is purely hands off. Take a moment to absorb that. Majority of Mac users will never open the System folder. The fact that OS X won't let you muck around in there is a hint to keep out, but as we know, where there's a will, there's a way. But even if you really know what you're doing, tread lightly in the System folder. If you only go into the System folder when you really need to, and do so knowing exactly what you're doing, your experience running Mac OS X will be much better.
While the System folder is forbidden ground, the Library folders are an open playground -- at least two of them. Lets look at the graphic, where we see three columns. These are the three Library folders. One is in the System folder, which is -- everyone say it -- hands off, the second is in the base directory and the third is in each user's directory. The purpose of the three different folders was hinted in the multi-user section. It does primarily two things, customization and system stability.
Lets start with column three and go backwards. When you open your Home directory you'll find your very own Library folder. This is yours and only yours. You can do whatever you want in it, and it will not affect any other users on the computer. Each user has their own Library, and that holds information to be used when that user logs in. Lets open this up and we'll see a bunch of folders. As an exercise, lets add a new screen saver to our account. You can get any one you want, but as a suggestion, lets get one of my favorites, Plasma Tunnel. After you download it, unstuff the file and place it inside the Screen Savers folder in your Library folder. Once there, open the System Preferences, select Screen Savers, and it should be there. You have now added a screen saver to your account and only your account. If you log in as a different user, that user will not have that screen saver, unless of course they too install it in their own Library folder.
This should give you an idea of how the user Library folder works. While in the System Settings, you can also do other changes, such as your desktop picture. That too is saved for your account, and will be different for other users. There's much more you can do to your Library folder, poke and around see what you can see. One particular folder you want to check out is the Preferences folder. This holds all the settings for your account. This is similar to the old Preferences folder found in the Mac OS 9 System Folder. In here you'll find both system and application preference files, just like you did under OS 9.
Moving on to column two. This is the base directory Library folder. This Library folder is similar to your personal Library folder, except that all users share it. Using our same screen saver, if we open this Library folder and place the Plasma Tunnel in the Screen Saver folder, it will now be available to all users. Same goes for other folders, such as Preferences, Fonts, etc. Sometimes applications place their preferences in the column 2 Library, rather than Column 3. As a tip, if you're looking for a preference, first check your home Library for user-specific preferences, then the base Library for system-wide preferences.
Finally to column one, we find a Library in the forbidden System folder. This is the top Library folder that affects the whole system including the OS itself. Why would you want to place something in the column 1 Library instead of the column 2? The answer is, you probably don't. There are times when you would want to, but these are only times when the other Library folders can't do what you need. Bottom Line: Always first try using column 3 Library, then column 2 Library and only use column 1 Library when absolutely necessary.
So now that we know Library folders let us customize settings for each user or for the entire system. What about stability? Well, lets say that screen saver we just added was a real dog of a program (it runs very nicely, by the way). As soon as it started, it did something horribly wrong and made the computer unstable. If we installed the program in our personal Library folder, it will not effect other users or the system itself. If another user logged in, everything would run fine because the screen saver isn't running under their account.
Now if we had installed the program in the column 2 Library, it would affect all users, but it shouldn't affect the system itself. For example, as long as the OS is running the core functions of Darwin should still run. So while bad things might happen while users are logged in, the integrity of the system is maintained. What this means is all we have to do is root out the bad egg and there will be no damage to the system. We might not be able to say the same thing for our applications or other data, but the OS itself will be intact.
I don't want to spend too much time on Aqua. It's been hashed and rehashed numerous times in numerous ways. Essentially, Aqua is loved for brining a functional GUI to a Unix-based OS, and both hated and loved for not being the classic Finder. It's a work in progress from Apple, and there are countless little hacks and tweaks available to make changes to the OS X Finder. As I found out after last week's column, if there's something you don't like about Aqua, there's probably a way around it. The key differences in Aqua over OS 9 Finder are the Dock, the new window manager, which includes a new file browser and finally a new menu bar with numerous differences.
When you first use it, Aqua feels very strange. It'll take some time to get used to, but works quite well in spite of all the criticism.
One last thing worth noting, OS X includes a few server applications. Namely Web, FTP and SSH/Telnet servers. With a click of a button they can each be turned on In the Sharing system preference panel. As described in an earlier column, Sendmail is also included, even though that is a little more involved, but it's there. It's quite interesting to realize how much power OS X offers, both with what's included and what can be installed. The combination of Apache, MySQL and PHP is a prime example of what OS X can do in knowledgeable hands.
So there it is, the main differences between OS X and OS 9. As I mentioned this is really a primer for a future column on OS X troubleshooting. As a result I skipped some stuff and breezed through others with this in mind. As always, feel free to make corrections and additions in the comments.