Saturday, November 13, 2004

Linux

I first installed Linux on my machine in my freshman year as an undergraduate in 1995 -- a Slackware release, I forget what version. I dual-booted my system with Windows 3.1. One of the women who lived on the same floor as me in the dorms helped me set it up; I think she assumed I knew more about UNIX and such than I really did at the time, probably because my main means of meeting people in those first few weeks was to help them fix their computer problems and set up their network connections -- that and helping to move furniture. She didn't need the network help, though I might have helped her move furniture at some point; I'm sure I've forgotten things after nearly a decade. Naetheless, we became acquainted, and got along with each other reasonably well, and I wanted to give Linux a try.

I spent a very frustrating time trying to get things to work before I gave up, reformatted, and spent some time with a pure Windows-based system again. That summer, I gave it another try. One Friday evening, I sat down with my machine and a set of RedHat CDs, and set to work. By midnight, I had managed to spectacularly botch the drive set up -- the partition table was corrupt, the master boot record was no better, and any data my filesystems might once have contained was hopelessly lost. I also had neglected to eat dinner -- I did that a lot, to no lasting harm but to the dismay of my friends -- and the combination of tiredness and low blood sugar left me even more disgruntled than I might otherwise have been. But I perservered, and after spending most of the next day reinstalling and figuring out how to get the OS to play nicely with my network hardware and how to get X11 to play nicely with my graphics card, I was very happy to once again have a working system. At that point, I'd also had to use the Alpha clusters for a year for all my computing assignments, and so knew enough about manuevering in a UNIX environment that I had a starting point for learning more.

I've used Linux as my primary operating system since that time, though I did -- and still do -- use Windows some of the time, for games, or for viewing Office documents that people sent me, or for programs I wrote for my job. Both operating systems have come a long way. Plug-and-Play support has become ubiquitous, which has made life easier in most respects (remember diagnosing interrupt conflicts?); there are no longer so many network cards built with conflicting and backward interfaces; and driver support for new and old hardware is better in both systems. Windows 95 was tremendously more stable than Windows 3.1 -- it's remarkable what cooperative multitasking will do -- and, despite some... um... quirks when it first came out, Windows 2000 and the other successors have become still more stable. On the Linux side, stability was never such a concern. But for a long time, configuring a Linux system was a chore, and though my primary tasks were editing, compiling code, preparing mathematical documents, and web-surfing -- tasks for which the application base in even the early distributions did well enough -- there were lots of areas in which the application base was primitive or non-existent.

Despite getting to be quite comfortable with Linux and spending lots of time on systems programming tasks, I never quite got around to meddling with the Linux kernel. I wrote a kernel for my undergraduate operating systems class, of course, and there's nothing quite like spending hours debugging a kernel-space locking error to leave you impressed by how tedious kernel code can be. I've written code on platforms that were arguably even more obtuse -- a little embedded system called the HandyBoard in my robotics class, and an early tablet computer called the DataBoard for a job at the end of high school -- but somehow they didn't leave me with the same sense of disgruntlement as that one locking error (probably because it didn't take very long to reboot those machines). My later experience with parallel computers has had much the same feel: I can write code at this level, and I know how to diagnose and fix locking errors, but I also know it to be a pain that I'd rather not deal with. In the cases where I've written system-level code for Linux -- as in a cryptographic file system with metadata signatures that I co-wrote in my first year of graduate school -- I've been fortunate enough to push most of the work into user-space daemons which don't take down the entire system when they crash during debugging.

On this, though, Winnie is braver than I am -- perhaps because she already spends a fair amount of time working with embedded systems code. So when I went to visit her and to give a hand with the system she was using for a three-week intensive course on Linux device driver programming, I didn't really expect to be able to provide much more than encouragement. But while the standard Linux distributions have come a long way, they have not come so far that it's entirely trivial to get a working system which can boot with either a 2.4 or 2.6 kernel, which works with a very recent-model webcam, which is entirely unphased by the presence of two network cards (well, 1.5 -- one is on the motherboard and isn't a separate card), and which will gracefully start the X windows graphical interface system despite a somewhat quirky graphics card. Now multiply the difficulty by two machines (when you're debugging kernel modules, this is very useful -- one machine runs the kernel, and the other machine runs the debugger).

And so I spent yesterday doing something it seems I hardly ever do any more: helping a friend work through the quirks in a non-standard installation. And by evening, we had things worked out. Both systems worked fine, one with both a 2.6 kernel and a 2.4 kernel. All the bits of hardware were recognized, even to the web cam. And so, even though I wasn't very helpful when it came to the kernel module that Winnie had to write for the homework assignment -- the most I did was point out a place where something needed to be statically allocated rather than stack allocated -- I was very satisfied by what I'd done with the day. Even if what I'd done had nothing to do with the sort of modeling tasks and numerical computations on which I usually spend my days.

Besides, I got to share some egg nuggets (a type of Chinese sweet, perhaps distantly related to waffles), and I had milk tea with tapioca balls. And I finished reading Royal Assassin on the train ride home. And now I've had a break to think about something completely different for a while, and I have a couple days in front of me which I can spend thinking about -- really intently thinking about -- some of the mathematical ideas that I've meant to flesh out for a while. Is it any wonder I'm in such a good mood?