GNU GRUB 0.90 DiskOnChip patch

Ilguiz Latypov ilatypov at
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:
     cd 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:
     ./configure --enable-diskonchip

  d) Copy the stage2/pre_stage2 file to ~/mtd/grub/ and run make there:
     cp -a stage2/pre_stage2 ~/mtd/grub
     cd ~/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):
     umount /dev/nftla*

     ./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)

     fdisk /dev/nftla

     mke2fs /dev/nftla1
     mount /dev/nftla1 /mnt
     mkdir -p /mnt/boot/grub
     cp -a /boot/vmlinuz /mnt/boot/
     cat > /boot/grub/menu.lst <<"EOF"
serial --speed=115200
terminal --timeout=2 serial console

title=Linux with serial console
root (dc0,0)
kernel /boot/vmlinuz root=/dev/nftla1 console=ttyS0,115200

title=Linux with video card and keyboard
root (dc0,0)
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...
Name: grub-0.90-doc-patch.txt

More information about the linux-mtd mailing list