¶Linux and me
I mentioned in my last post that I was downloading Mandrake Linux. The reason why I'm doing so is that I want to check out the issues with VirtualDub's DirectX display code and recent releases of WINE. Users are reporting full-screen blackouts, which indicates to me that the DirectDrawClipper is hosed. Some of the bug reports on other DirectDraw-capable programs imply that this is a WINE problem, but WINE has exposed bugs in my code before so I'm willing to find out. I downloaded Fedora Core 3 yesterday, but found out that it doesn't run properly under Virtual PC 2004; after I installed it and rebooted, every process launched by init basically died and got suspended for cycling, so I couldn't do anything.
It's been a loooong time since I last used Linux. The first time I used it, I had installed Slackware 3.0. Slackware is basically the hardcore Linux installation; it was broken apart into floppies, used .tar.gz for its package format, and had a relatively simple (and clean) startup configuration. The installation was a bit rough though because you had to carefully choose the right boot/root floppies -- which took forever to write because RAWRITE 1.2 did a sector at a time. Then during the install, you had to hold down the down arrow key for five minutes while waiting for the installer to scroll all the way down to US/Pacific for the timezone (they later moved US/Pacific up to the top in a later release) and select a subset of disk set A that didn't install too much junk but could still boot. Then you realize that disk set A doesn't have the man pages.
Ah yes, I remember Linux like it was yesterday....
Avery's Linux story, a.k.a. Why Windows Programmers Should Never Be Allowed Around Linux Systems:
I made a number of mistakes in my earlier Linux installations. The first mistake was believing the installer when it said that 1 inode per 1024 bytes is a good idea if you have a lot of small files. Inodes are basically directory entries; you need one per file or directory. Unlike NTFS, though, Linux's ext2fs doesn't allow you to temporarily reuse inode space for files, so any space reserved for inodes is unusable for data. 1 inode per 1K is insane and wastes a ridiculous amount of space. I later reformatted my drive with 1 inode per 16K and still had way too many inodes. I also allocated separate 512MB partitions for /usr and /var, until I realized that most install scripts treat /usr as /junk and that it should be given a lot more of the space unless you're running a news server.
My second mistake was to try to move a bunch of files to the current directory by typing "mv ~/stuff/*"; this works fine in DOS/Windows with the "move" command. It does something else on Linux.
I quickly figured out that ESC :q! is a better way to exit vi than Ctrl+Z followed by kill -9, the "pico" screen editor is in disk set N, and when the terminal gets kicked into graphics mode, there are five more terminals available before it's time to reboot. Also, always check that a tar archive actually contains a subdirectory within it before extracting it.
The third mistake I made was to compile a new kernel, move it to /vmlinuz, and reboot without re-running LILO. Hey, why'd the dots stop during the boot?
The fourth mistake I made was accidentally deleting the C runtime library (libc.so.5) while logged in as root. Unlike Windows, Linux allows you to delete a file that is in use; the file is unlinked but remains allocated until unused, so you can delete libc.so.5 even though every program on the hard disk needs it. Whoops, I shouldn't have done that; better restore it from the install media. Hmm, I can't change cd because cd needs libc. In fact, I can't run anything. Maybe I should reboot with the rescue disk. Umm, Ctrl+Alt+Del doesn't work because shutdown can't run. Maybe I should sync the disk and hard reset the machine. Okay, I can't run sync either. I guess I'll be running fsck then after I fix the system.
The fifth mistake I made was to try to run X. I was doing OK with XF86Config up until it asked me what RAMDAC chip I had on my video card, for which I had no idea. After that ran I tried launching X Windows by running X11/bin/X, which only gave me a X mouse cursor on top of a pattern. Eventually I discovered startx and chose fvwm95-2 as my window manager, turning X into a bad imitation of Windows 95 and making it suitable for scaring other Linux users. After examining a few programs that used the Xaw library for widgets, I concluded that the "Xaw" stood for "Xawful." (It's actually the Athena widget set.)
I eventually learned Linux well enough to create and maintain cablemodel NATing router for a LAN, long before the convenient firewall+router boxes became common. I secured the box primarily by making it really boring and running nothing on it. Since then, Linux has gotten a lot nicer; Fedora Core 3 has a nice GUI installer that puts Linux installation in the same ballpark of ease as Windows. I was amused when anaconda spit out a bunch of errors to the console before launching X, though. It turned out to be a bad DVD burn, which I rectified by mounting the original in Daemon Tools. I love Virtual PC. We'll see after I finish downloading and installing Mandrake Linux whether I'll be able to log in this time.
Occasionally I get asked whether I'll ever do a Linux port of VirtualDub. Honestly, at this point, the answer is probably no. The framework parts of the codebase have already been rewritten to be portable or easy to port; the video/audio handling and the UI are the parts that are tough, and I have no experience with the A/V or UI libraries on Linux; indeed, I have no experience writing any sizeable code on that platform. The biggest problem, though, is that I simply don't have the time. If anyone wants to try it I'd be glad to explain what I can and look into ways of changing the codebase to be more portable, but whoever tries needs to be willing to put some serious time into porting a codebase that is 5.8MB in size. It's a lot more fun, in general, to write something new than just use someone else's code. Ironically, this is actually why I'm still working on VirtualDub.