Disk On Chip
From HotDec
Contents |
Introduction
The Disk On Chip on the SBC is basically a flash drive, with some extra hardware that will allow some code on it to exicute in place. This allow the disk on chip to provide a BIOS extention to durring the booting phase of the SBC. To make the DOC work with grub we need to replace the normal BIOS extentions the DOC with a grub first stage bootloader.
More Information
The Ch9 of "Building Embedded Linux Systems" has useful information of grub and diskonchip. The book should be availble free online (safari online) to computer on the university network
Loading the grub bootloader onto the DOC
Unfortunatly the tools needed to flash the new grub boot loader, only run in DOS. To be able to use them we have FreeDOS on a harddrive. Connect the harddrive to the SBC and boot. If the SBC doesn't allow booting off the harddrive when the DOC is disabled, disable the DOC by pulling off its enable jumper and then put it back on once running in FreeDOS. FreeDOS should have a directory called TFFSTLS contain the DOS tools provided by Msys for formating the DOC. If this is not the case you can get a new set of tools from Msys and copy them to FreeDOS. You will also need to have the grub firmware image (grubfirm) that will be used to flash the DOC.
C> cd tffstls C> DFORMAT /win:d800 /bdkf0:grubfirm
Creating Linux Filesystem
The DFORMAT utility will create an empty DOS partition of the DOC. To put on a linux partition:
- boot into linux off another drive
- use fdisk to delete DOS paritiion and create linux one in its place
fdisk /dev/nftla
- use mkfs.ext2 to format linux partition
mkfs.ext2 /dev/nftla1 -b 1024 -c -c
Patching Grub for DOC
Original Documentation
GRUB - FOR DOC DEVICES To use grub on a diskonchip you will need patch it to work with diskonchip. The Ch9 of "Building Embedded Linux Systems" has useful information of grub and diskonchip.
First get the grub source code:
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/cvsroot/grub co grub
Now get the mtd code cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs login (password: anoncvs) cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs co mtd
Although there are a patches for grub in mnt/patches, they are somewhat out of date.
There are some minor differences in the newest version of grub that need to be updated
manually. I have made a new patch that should work.
I made a new patch Use the newest version of the patches for grub apply the patch to grub by first moving to the grub source code directory and patching,
cd grub patch -p1 < grub-doc-2006-2-6.patch
after patching grub run:
aclocal && automake && autoconf ./configure --enable-diskonchip-2000 --enable-ext2fs --disable-ffs --disable-xfs \ --disable-jfs --disable-vstafs --disable-reiserfs --disable-minix --enable-fat \ --enable-diskonchip-ctrlbypass make
Among other things this should provide you with a SPL (secondary program loader) image in
grub/stage1/grub_firmware
This file will be setup to replace the Msys provided SPL, you will need to copy the file to the FreeDOS partition (you may want to give it a shorter (<8 chars) name). Then reboot into FreeDoc and use the Msys DFORMAT utility to write the grub_firmware as the SPL.
DFORMAT /win:d800 /bdkf0:grub_firmware
This will install the grub bootloader on the DOC, it will also format the DOC to have a single DOS partition
./configure --enable-diskonchip-2000 --enable-ext2fs --disable-ffs --disable-xfs --disable-jfs --disable-vstafs --disable-reiserfs --disable-minix --enable-fat --enable-diskonchip-ctrlbypass
Now boot into linux and format the DOC with an ext2 filesystem
mkfs.ext2 -b 1024 -c -c
