GNU GRUB 0.90 DiskOnChip patch
ilatypov at superbt.com
Fri Oct 26 21:57:04 EDT 2001
I modified the latest available GRUB DiskOnChip patch,
grub-0.5.97-doc.patch, to make it read partitions off the file systems on
the DiskOnChip 2000.
To embed the GRUb boot loader,
a) Apply the patch to grub-0.90:
patch -p1 -i ../grub-0.90-doc-patch.txt
b) Remove the configure script and re-create it:
rm -f configure
c) Compile the GRUB:
d) Copy the stage2/pre_stage2 file to ~/mtd/grub/ and run make there:
cp -a stage2/pre_stage2 ~/mtd/grub
# check that Makefile contains "STAGE2FILE := pre_stage2"
e) Go to you development system, copy ~/mtd/grub/grub_firmware there and
embed it (I assume that the size of DOC2000 is 8M):
./mtd_erase /dev/mtd0 0 8388608 # the size of the chip
./nftl_format /dev/mtd0 98304 # the start of the NFTL part
# (we leave 12 8K units for the GRUB loader)
mount /dev/nftla1 /mnt
mkdir -p /mnt/boot/grub
cp -a /boot/vmlinuz /mnt/boot/
cat > /boot/grub/menu.lst <<"EOF"
terminal --timeout=2 serial console
title=Linux with serial console
kernel /boot/vmlinuz root=/dev/nftla1 console=ttyS0,115200
title=Linux with video card and keyboard
kernel /boot/vmlinuz root=/dev/nftla1
./doc_loadbios /dev/mtd0 grub_firmware
Note that in less than 10% of all reboots I am getting the read error
resulting in error 16 (corrupted file sytem) or CRC errors during the
kernel uncompression. Your improvements are welcome.
I understand that the NAND/DiskOnChip handling in GRUB is a bleak copy of
the kernel's MTD drivers. This is why LinuxBIOS or the mtd/boot
bootloaders should be superior to this GRUB DiskOnChip patch. The only
advantage of this patch is easy kernel and configuration file updates,
since GRUB understands most file systems.
Do I understand correctly that stage 1 of the GRUB will simply read the
rest part of the boot loader off the DiskOnChip without relying on the
nftl_rawread() function? In this case the better way to re-use GRUB
without duplicating NFTL functions would be embedding the compressed
kernel image with the boot loader.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the linux-mtd