notes on javascript, linux, and more


Damn Small Linux on a USB-ZIP for Via C3 / Epia Motherboard

The VIA C3 is an x86 compatible chip used in a a bunch of popular and cheap motherboards. It isn't fully instruction-set compatible with the newer intel chips, though, so a lot of the minor and mundane optimizations people use with their compiler will produce binaries that crash when run on the VIA C3. So, I had trouble finding a linux distribution that would actually run. Debian seemed to work, but a lot of the packages in the apt repositories did not.
Eventually, I just wanted to make a little network appliance with the board, but I had trouble getting it to boot from any distributions I installed to a USB flash drive. It turns out that there are some issues booting these motherboards with USB-HDD media. USB-ZIP mode was said to work, though, which basically puts everything on partition 4 and does some strange stuff with the cylinder information. Sounds ok.

I decided to go with Damn Small Linux (4.2.5 in my case) with syslinux as the boot loader, using a FAT filesystem, of course.

So, first thing was to correctly format my Flash drive. From the syslinux/usbboot documentation:

The script "mkdiskimage" which is supplied with the syslinux
distribution can be used to initialize USB keys in a Zip-like fashion.
To do that, calculate the correct number of cylinders (31 in the
example above), and, if your USB key is /dev/sda (CHECK THE KERNEL

mkdiskimage -4 /dev/sd[X] 0 64 32

(The 0 means automatically determine the size of the device, and -4
means mimic a zipdisk by using partition 4.)

After that finished up, I ran:

syslinux /dev/sdb4

to install the bootloader. then it was a simple matter of getting the latest from one of damn small linux's mirrors, and unzipping its contents onto the mounted /dev/sdb4 partition. unmount, stick the USB-ZIP drive i just made into the Via computer, and bang. damn small linux.

About Me

My photo
chicago, il, United States
I'm a software engineer by profession.