Flight Computer CompactFlash "disk" Notes
We're using SanDisk CompactFlash cards as the hard disk for the Flight Computer (FC) and the Launch Tower Computer (LTC). They're just like IDE drives... but apparently more finicky.
Debian "Testing" Installation Notes
- See the FlightComputerSoftware2002 for notes on how to build a fresh Debian system on the CF card.
Hooking up and running CF cards on a PC
A few notes:
- As far as we can tell, the CF cards act exactly like IDE drives and thus require no specific drivers.
- HOWEVER, their timing requirements may be more stringent than regular IDE disks. When running CF cards on a 1.2GHz PIII, low level programs like dd didn't work very well: we got "hdc: lost interrupt" and freezes when running low level programs like dd. See below for more info. Thus, YOU MIGHT NEED A SLOW COMPUTER. Like a 486, or in our case, a 75MHz Pentium. The reason is that we used a 1.2GHz PIII and the timing was all screwed up - we got "HDC: Lost Interrupt" all the time. Switching to the 75MHz Pentium solved the problem. We hypothesize it's a IDE timing issue, which we think may be related to PCI bus speed.
- On both the FC and LTC, after an initial bootup, the console redirects to the serial port (ttyS0) at 9600bps, 8N1. It may take 10 seconds for the thing to boot up and start spitting out messages, so don't panic if it takes that long. NOTE FOR THE WISE: if you boot a PC with the CF card 'just to test it', then don't forget it will appear to freeze after the boot message since the console is, as we mentioned earlier, being redirected to the serial port. DON'T just shutdown - connect another computer to the serial port, login to the computer, and 'halt' it.
Use the TAPR board with the 0.1" pin header on it, and plug it in with a ribbon cable just like an IDE drive. Note that you'll need the power connector from your floppy drive to power up the board. We always made the board 'hdc' by putting the PC's CD and main disk on the primary IDE interface, and the CF card alone on the secondary interface.
When you boot, make sure Linux recognizes the drive - look at the boot log to verify it ('dmesg | less'). Note that your BIOS doesn't necessarily need to recognize it in order for linux to understand it. In our case, we never had an issue recognizing except for the one time we forgot to power it up. Whoops.
Partitioning and Formatting CF Cards
Ok, so you have a CF card and you want to make it into a disk. Hook it up as above, and boot to linux. Note that 'x' below means the drive letter, e.g. hdx1 = hdc1 for us.
- Partion the card: run
fdisk /dev/hdx
and add one partition, make it active (bootable), and make it a type '83' ("Linux"). - Format the card as ext2: run
mke2fs /dev/hdx1
Copying over files
First, get files from the existing card or from the CVS image/tar file. To copy from a CF card:
- Mount the drive:
mount -t ext2 /dev/hdx1 /mnt
- To copy from a CF card to your hard disk, just use
cp -a /mnt/* /mnt/.* /destination
Note the '.*' is necessary to pick up all hidden files ('.xxx' files) in that root directory. - If you want to get a zipped TAR file, then do
tar -czf filename.tar.gz /mnt
Note: cp
doesn't copy device files correctly. It may be more appropriate to use:
cd /mnt; tar cf - . | (cd /destination; tar xfp -)
--Main.JamesPerkins
To copy to a CF card:
- Mount it.
- use
cp -a /destination/* /destination/.* /mnt/
- untaring it:
tar -xzf filename.tar.gz /mnt
Making the CF card bootable
You'll need a lilo which has a version => 22.1 (we used 22.5.4) otherwise you'll get a "failure: Map segment too big" error. And note there are some subtleties to this process, since you're marking the CF card, currently /dev/hdx1, to be bootable as /dev/hda1 during a boot up.
Here is the lilo configuration file we used assuming that the CF card is /dev/hdc1
mounted at /mnt/disk
:
lba32
disk=/dev/hdc
bios=0x80
boot=/dev/hdc
root=/dev/hda1
# compact
install=/mnt/disk/boot/boot.b
map=/mnt/disk/boot/map
# 3-second delay
delay=30
vga=normal
default=linux
image=/mnt/disk/vmlinuz
label=linux
read-only
append="console=ttyS0"
# restricted
image=/mnt/disk/vmlinuz.old
label=old
read-only
append="console=ttyS0"
# optional
# restricted
and then run lilo -v -s /dev/null -C lilo.conf
to make the CF card bootable.
Note that there's a better way to do this - go Tim go.