I finally bought an iBook 12 after threatening to for years. I was experiencing growing frustration with the extremely unfortunate hardware design of my x86 laptop (which is hot, loud, shitty battery life, etc). I learned that the modern incarnation of the G4 iBook 12" has AirPort and a combo drive built in, which makes it exactly the same as my old laptop, and for about the same price. One of those weird horizontal upgrade situations.
When I was lusting after them I was resolved on installing Linux, so I would have my comfortable weird FVWM configuration and all the Debian utilities I so love. I found out a few weeks ago that the AirPort Extreme in these things is a totally proprietary piece of hardware that is almost impossible to write open source drivers for. I decided I could always use some crappy USB 802.11 in Linux until I decide to swap for a pre-Extreme card. Well, I haven't even installed Linux yet, and I've had it for almost a week.
So when I got the thing, the first thing I did was reinstall OS X into a 11GB partition so I'd have lots of space for Linux. It informed me that it would take 8GB. I was incredulous. I told a Mac fiend and he told me I was full of it. Turns out he exists in the lovely pre-iLife world. I think Garage Band is pretty cool (though I probably won't use it much), and I could imagine someday needing to use something like iMovie. But I discovered right off some huge wastage.
For example, iDVD is this program that opens a window that says "you do not have a super drive." A very useful utility, I'm sure, if you like having those sorts of windows floating around. I showed that window to a friend and he immediately wanted me to click that checkbox that says "do not show this warning again", but then...then what would iDVD do? I figured it was harmless until I discovered it eats about 1GB of space! I think it's effectively clip art for the DVD navigation screens you can build. Another 1GB in a really shitty world book encyclopedia (I clicked through to the highlit entries, it had a one-picture and 200-words-of-text entry for the entire 13th century, and all they talked about was arches). Monolingual conveniently eliminated about 500MB in foreign languages.
This deletion festival was frustrating because there is no package management. I was rm -rfing .app files and hoping that's the approved deletion technique. Monolingual is a huge hack that is essentially ``rm `find / -name Spanish.lproj`'' or whatever. There was no way for me to present a screen listing the installed packages, their sizes, and a delete button. I couldn't find a single indication of the existence of the encyclopedia except its icon. A totally unadvertised valueless 1GB add-on with no obvious deletion instructions. Smart, real smart. Did they notice? I have a 30GB hard drive. I thought Mac users GENERATED media, and so, they'll need all the space free that they can get, why include so much useless garbage?
On the other hand, most applications really do exist as just a single huge .app folder. That's pretty cool. Kind of obviates the need for package management.
MacOS X is an interesting experience, to say the least. Most things "just work." The things that don't, it's usually because Apple decided explicitly to make it not work. It's an interesting contrast. Very frustrating when you discover that the reason iChat AV doesn't work with USB webcams is that there is sufficient competition in the USB webcam market that Apple decided to make their exit (i.e., politics, not technical reason...Apple itself has sold a large number of USB webcams so it's certainly not a shortage of expertise). There's a third party work around, but it's shareware and (for me) it doesn't work.
Most things in MacOS X seem to work like that. Apple has made mostly poor choices, but built a powerful framework for third parties to distribute shareware apps to fix. The hacks are sometimes very good but are mostly a big clusterfuck of "I work with Jaguar but not Panther." Apple seems to have a well-entrenched philosophy of toggling which options you are presented with in every release, even while the core software remains the same. Apple is a very bad company in this respect.
But they also have a philosophy of working. My Mac hasn't crashed once (though once I managed to run a third-party app that took the keyboard over, and I was too lazy to ssh in from somewhere else and kill it). It hasn't filled me with an insane rage like Windows does when it presents an imperceptible screen flicker as a way of saying "incorrect password." The Unix prompt becomes ever more powerful as I learn how it is integrated into the Aqua way of doing things. For example, even though Mozilla.app doesn't appear to let you do an equivalent of ``mozilla -remote "openurl(blah)"'', I can do the same thing in AppleScript, something like ``tell application "Mozilla" to OpenUrl "blah"''.
Right now the list of things I need to do to MacOS X to make it comfortable for me has about a dozen items on it. Things like making keyboard shortcuts work like my old FVWM config, fixing a bug in the cctools linker (!!!), and porting over my home grown audio software. The perception at this point is that if I were to install Linux, I would encounter a similar todo list that would probably be a lot easier to deal with, but no more short, and perhaps more boring because I've done it before. Besides, at the moment I'm liking the Apple+Greg combo network configurator I've got on the Mac a little more than my old just-Greg network configurator on my PC laptop.
There's some paradigm shift here that captivates me that I feel I must grok before I can move on from OS X. In the Unix world if I were to build their configurator, it would be a combination of about 4 unix tools: kismet in daemon mode, iwconfig, my VPN/NFS/etc shell script, and maybe a GUI front end. In Apple world, it's only two parts: MacOS, and my VPN/NFS/etc shell script. The existing configurator I'm certain is built up of many parts expertly layered, probably mostly inside of this 'configd' program. But to me, I have been able to think of it as a large chunk that 'just works.' How eerie.
I am also beginning to understand how I have heard people describe Macs as "having a soul." I spent a morning working on my old PC laptop (because I don't get anything done on the Mac, too busy trying to hack it) and it felt -- I can't describe it -- thin, shallow, hollow, empty. At first I thought it was just some basic animal response to visually bright colors and backgrounds, but WinXP has that and I find it terrifying. Now I think it is a combination between the layered approach that Apple takes and my total unfamiliarity with it.
In the PC world, the computers feel shallow because I understand a little bit of almost every layer. I am familiar with the hardware from a user perspective and also (somewhat) an electronic perspective. I know for the most part exactly which buses are present in my system and what physical chips they connect to. I've read data sheets for a lot of these chips. I know how ACPI works and in concept the BIOS. I've hacked on bootloaders and kernels and system libraries and system utilities and user applications. I've written device drivers. I know exactly what all the layers are and I have a very FORTH-fiend-like response of wanting to therefore rip through all of them and get at the core hardware I know is there. It is reflected in my x86 laptop, which runs a custom /etc/rc script so I know and want every process that is running on it. It runs X in the absolute simplest way, just executes my .xinitrc to load settings and start one of the simplest full-featured window managers, whose features I mostly don't use.
Compare that to the Windows world, where I've known it historically for a long time and even though I do not know their software layers, I have an excellent intuitive grasp of what they must look like because ultimately Windows is still shaped by its compatibility path back to MS-DOS 1.0. It is a pervasive mentality that affects everything about the system.
So when something doesn't work in Windows, it is frustrating because I don't know the layers well enough to work around it. When something doesn't work in Linux, it is time consuming because I know exactly the layers to work around it best (fitting with my aesthetic) and I will not tolerate a clunky work around. But it results in a computer that feels thin, you are exposed to everything, constantly reminded of the existence of each individual layer -- in Linux because I manipulate it directly and in Windows because I'd rather manipulate it directly because their bullshit doesn't work.
But on the Mac I have the barest feel for the layers. The layers are usually better documented, but they're less visible. Compare OpenFirmware to AMIBIOS. A philistine could tell me that OpenFirmware is less visible because it has a graphic boot screen instead of a text diagnostic (to be honest, I don't even know which screens are generated by the BIOS and which by Darwin loaders, which is pretty slick). But it's also less visible because I haven't had to poke my nose in there once. I haven't even run into operating system quirks that are a result of BIOS quirks.
But the Mac is still usable without understanding these layers. To me, even! I guess this is what happens when you have tight integration at every single level.
I am experiencing some difficulty when I am digging into the layers now though. I want to have FVWM's key-remapping power and do some other hacks to make the keyboard less offensive, and I am finding myself eying every layer of keyboard management from ADB to Cocoa trying to decide where this best fits in. How long I put up with OS X probably will mostly be determined by how often I have to dig in like this.
About the hardware quality, I'm finding it to surpass my wildest expectations. I was expecting it to be exactly like my old laptop, but without the crapulence. For the most part, that is exactly what it is. For example, consider cooling. My old laptop has a hot passively-cooled power supply in one corner, and a hot actively-cooled CPU in another. The iBook appears to be completely passively cooled and even if I use it all day it does not get painfully hot. The display is, I think, somewhat better than my old laptop's, but only due to the extreme crapulence of my old laptop. I guess the better screens are reserved for PowerBooks.
The real shock came when I installed Quake on it. I'd always heard how bad Macs were at gaming, but I was much impressed. Quake is not the newest game, but I am not the newest gamer, so I still consider it a reasonable test. Quake was, of course, unfathomably easy to install. There was no mucking around with drivers, settings, whatever. Just click on the little "GLQuake" icon, and then play. And it was fast! Not mindblowingly fast, but a totally playable 100fps at 1024x768@16bpp. It was obvious in hindsight. The Radeon 9200 is no record-setter today, but it is no slouch. Why build in a high-quality gaming video chipset into a passively-cooled laptop? Well it's obvious, go into system prefs -> dock and turn on magnify. Now play with your dock and imagine how intolerable that would be if you had a crappy "AGP shared memory aperture" framebuffer. This overabundance of stupid obnoxious GUI features hasn't made my computer slow, instead it has actually made my computer faster by requiring the manufacturer to be less chintzy. Sweet!
Oh and the wireless is great too. It's a smidge faster than my PC wireless card (beats me), but most importantly it has great range. A good 20 feet further into my backyard than I could go with my shitty Netgear PCMCIA card (the cost of an antenna crammed into PCMCIA, I suppose).
So I was searching for something unrelated and stumbled onto one of those "I'm a Linux user turned Mac addict" stories from a hardware reviewer. I clicked on it out of curiosity, to see if perhaps my story is quite common. And let me tell you, I am again overwhelmed by the Apple mystique. This was no Linux user, this was simply a Windows user who had managed to treat a Linux machine like a Windows machine once or twice and therefore felt obligated to put the word 'linux' in his AIM name. I fear this is who you now think I am.
Let me be clear on this. I am a top-rate Linux expert. I once tracked down a typo in a bootptab file by modifying the kernel to give better error messages. Before I installed Linux for the very first time, I had to recompile my kernel to work around a BIOS bug. I've helped maintain 3c507 (ethernet), MAD16 (sound card), and BTTV (TV tuner) drivers, with patches that have been accepted into the current mainstream kernel. I've been running Debian since 0.93rc6 -- before apt-get. After years of experimentation my fvwm config is essentially 20 keybindings and no decorations or menus. I charge $150/hour for Linux system administration. I got in a flame war with some glibc2 morons on LKML in 1997 about /dev/pts and, when UNIX98 was later adopted, won. My prime joy in life is writing compilers. I've written several assemblers from scratch. I read microcontroller data sheets for fun. I've soldered on motherboards and ISA cards and they still work. I built a flash programmer to save my previous laptop. I'm "the register allocator guy" at work.
So now that you can all smell my balls, I just want to make sure you understand that I am not going to be going on and on about how cool the genie effect is and how great it would be if Linux would implement all of the GUI features that Enlightenment first did 5 years ago. Capice?
On another note, I had to reboot my apple today to make networking work. I had a very satisfying experience of walking to a cafe, ordering food, sitting down, opening my iBook, and finding my ssh sessions working exactly where I left them. Then I came home and everything was just as satisfying, then ten minutes later the network stopped going at all, for no obvious reason. It seems like DHCP broke, but maybe the hardware interface layer broke. Maybe it's my fault for doing the automatic Airport update earlier today and not rebooting like it told me to. Whatever it was, everything I knew to try didn't work, but rebooting did. *sigh*
As I've mentioned, my iBook crashes about once a month. It's a bad thing. Also, the VPN software I use (openvpn) drops packets in a weird sort of way -- as if it's overrunning some sort of queue. I tracked it down and determined three places the overrun queue could be (all on the Mac side of things, I successfully ruled out my server), but never isolated it all the way. Mostly because it was extremely timing-dependent -- i.e., running tcpdump or ktrace would foul up the timing to the point where droppage behaviour would change dramatically. The NFS was usable for MP3s, but the dropped packets occasionally caused skippage. Also, video files were totally unsuitable over this crappy link. I decided it was a Problem Worthy of Investigation, then ignored it.
No more! The wonderful author of the tun/tap driver I use, Mattias Nissler tracked it down for me, and fixed it, and now it works! Hip hip hooray!
Lesson: even extraordinarily lazy programmers such as myself benefit from open source.
Things to watch for: does my laptop still crash?
I was sitting around and decided I needed my Kitty Cat Dance fix. I happened to be closer to my x86 Linux box than my iBook so I used it. Thankfully this thing still has a Flash player. But that's about all it has. I noticed the mouse has been sitting in the basement for more than a month (even though the computer down there hasn't had a power supply for some weeks). I also noticed it still uses some ancient version of Mozilla with tabbing configured in a pretty unacceptable fashion. Then it dawned on me.
I'm an ex-Linux user.
It's not that I am terribly fond of Mac OS X (hell the only 'Aqua' programs I run are Preview and Firefox), it's just that the iBook is such a compelling workstation that I never actually sit down in front of my stationary computer except to watch video. Linux still handles file storage, firewall/routing, shell server, and so on, but it's just very rarely the machine I am sitting at for many hours at a time.
Or maybe it's just that my eyeglasses prescription is finally aging out and the closest chair to my Linux box is 8 feet away.
But still, it's fairly remarkable that Mac OS X is flexible and stable enough to not frustrate me enough to get me to install Linux on it. It's kind of like the perfect portable information appliance.
The sad part of the story is that my iBook power connector is showing the first signs of a presumably fatal deterioration.
As my Apple's 1st anniversary passed, I was reminded of the three things that still piss me off:
The bug in uControl is pretty much just a matter of sitting down and tracing it through. uControl is simply too hacked-on to expect it to work without bugs. Pure laziness on my part.
The power connector is just stupid. Some laptops have power connectors that last 9-18 months, others have power connectors that last for the lifetime of the laptop. It's pretty much a question of lever arms. For some reason, Apple decided to be worst-in-class (i.e., the longest lever arm I've ever seen on a laptop) until the Intel PowerMac came out. It is by far the most visible engineering error on my Apple and I'd like to see some Cupertino beard-stroker homeless over this oversight. But it still works (for the moment), and taking apart my iBook to install a better connector is a lot of work and risk. So until it dies, here I am.
Which brings me to configd. Sometimes when my iBook wakes up from sleep and rediscovers my wireless network, it resets the routing tables. My VPN is still running (so my NFS works and so on), but it is no longer the default route. The effects are that anyone watching the airwaves can watch my web surfing habits and my router inappropriately classifies me as "guest" meaning I get severely-throttled bandwidth.
Apple has this concept called (I believe) Core Foundation System Config. The idea is that dynamic system state is tracked in a daemon called configd. Think of it like a super-duper /var/run. To facilitate its role as state broker, configd loads a bunch of plugins from /System/Library/SystemConfiguration. One of these plugins is called Kicker and is basically a simple hack to execute an arbitrary shell command when various state changes. It reads /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/Kicker.xml to determine which programs are run for which events. This Kicker.xml is more or less self-explanatory, and there are lots of web references to how to get it to do exactly what I want (run my VPN-configuring shell script every time the network state changes).
So I followed their instructions and the result was that my script would run when configd starts, but not at any time afterwards. There is a handy shell util scutil which connects to configd and you can just run:
$ scutil > open > notify State:/Network/Global/IPv4and it should wake up Kicker, which will (should) kick my script. It just wasn't going.
So I downloaded Kicker source to make sure that it does what I think it does. Much to my pleasure, it's pretty readable code and I was able to determine exactly how it operates, which still gave no clue as to why it wasn't operating. But it had the email address of Allan Nathanson in comments at the top, so I figured it would be easier to query him than to build a new Kicker binary and use some variant of "printf debugging" to get to the heart of the matter.
His response is so useful I will include it here:
First off, the Kicker bundle is not documented because we don't consider it to be available for non-Apple usage. In fact, I've been working on eliminating the need for the bundle for the past few releases (and I'm hoping that it will be removed in Leopard). The xml you included (below) looks fine but here's a few things to know. 1. The Kicker bundle only reads the Kicker.xml file when it's first loaded (i.e. only when configd is first launched). 2. Only one instance of a "kickee" can be running at any given time. In other words, we'll wait for your /var/root/update-network command/ script to exit before processing another notification. 3. The exit status of the "kickee" script/executable determines whether it gets exec'd again. Any non-zero exit status will result in the "kickee" being disabled.
His point 3 was pretty much my problem in a nutshell. The Apple-supplied enable-network Kicker script has an "exit 1" at the end of it because it is only meant to be executed once. At some point in my earlier experimentations with this situation, I must have copied this "exit 1" to the end of my update-network script, because there it was, and that was the problem. Changing it to an "exit 0" made everything work smooth as peaches.
So the answer to my previous musings about whether or not the people who threw together these userspace daemons were cool enough is pretty much answered. Allan Nathanson rules -- his code is simple, the feature that hung me up is the sort of functionality you expect from a Unix-mindset program, and to top it off he answers his email. If there were a Kicker(8) manpage, I'm sure I could have done this whole project in less than an hour and had success on the first try, instead of leaving this as a lingering problem to solve a year later. Sure, they gave me source, but reading "The return code determines whether or not Kicker will ever execute this command again" in a man page is a lot easier than hunting for the "if (!ok) { cleanupKicker(target); }" at the end of booterExit() in kicker.c.
So, Apple, why don't you document these things? You document everything else -- the API that Kicker uses to talk to configd, for example, is totally documented. Why not any of the utilities and plugins?