Booting GRUB on the DiskOnChip 2000 and Millennium

Mark Meade

Revision History
Revision 0.408 Feb 2003

Objectives

These instructions describe how to use GNU Grub and the Linux Memory Technology Device (MTD) code to make a fully GPL-compliant, bootable M-Systems DiskOnChip 2000 or Millennium.

The following procedure was done on a desktop PC, using an 8MB DiskOnChip Millennium and the M-Sys PCI Evaluation card. A DOS partition was used to run the M-Sys utilities. This procedure was also verified with a 32MB DoC 2000.

Section #1: Kernel with latest MTD code

2. Get the latest MTD sources

  1. Reboot into Linux, and get the latest MTD sources from infradead.org:

    mkdir grub-doc
    cd grub-doc
    cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs login (password = anoncvs)
    cvs -z3	-d :pserver:anoncvs@cvs.infradead.org:/home/cvs	co mtd

    Alternatively, there are daily CVS snapshots available as .tar.bz2 files at ftp.uk.linux.org.

    Patch a kernel, select the various DiskOnChip MTD options as specified above, and build a new kernel. Reboot.

4. Build GRUB

  1. IMPORTANT: The GRUB code currently requires automake version 1.5 and autoconf version 2.53. On some systems, this can be specified by exporting WANT_AUTOMAKE_1_5=1 and WANT_AUTOCONF_2_5=1.

    aclocal	&& automake --add-missing && autoconf

    If there are any error messages here, they are probably due to version incompatibilities with automake and/or autoconf.

  2. Configure GRUB with the following options (for example):

    ./configure --enable-diskonchip-mil \
    	    --enable-diskonchip-biosnetboot \
    	    --enable-diskonchip-ctrlbypass \
    	    --enable-ext2fs \
    	    --disable-ffs --disable-xfs	--disable-jfs --disable-vstafs \
    	    --disable-reiserfs --disable-minix --disable-fat

    If you have a DoC 2000, use --enable-diskonchip-2000 instead of --enable-diskonchip-mil. README_DiskOnChip in the grub directory has more information regarding the ./configure options, and also some details on the DoC booting process.

    Selecting --enable-diskonchip-biosnetboot causes the GRUB/DoC code to hook INT 18H, which is historically known as the "BASIC interrupt" or "Diskless Boot Interrupt". Using this option with the DoC on a PC is useful because you change easily change the boot sequence back to the hard drive when needed. Selecting this option in many BIOSes usually involves changing the first boot device to "NETWORK".

    If the BIOS does not have a NETWORK boot option, disable the "biosnetboot" option. Instead of using INT 18H, the GRUB/DoC code will hook the INT 19H (bootstrap) handler. On my PC, taking over the bootstrap handler overrides any boot sequence options in the BIOS setup. The downside of using INT 19H is that a misconfigured DoC can render your machine unbootable. For this reason, the --enable-diskonchip-ctrlbypass option is highly recommended until you are sure that the DoC boots correctly. When the CTRL key is held during booting, this option will bypass the DoC entirely by restoring the original bootstrap handler.

    This is obviously preferable to the other option -- physically removing the DoC (or eval-board) to get the PC to boot from the hard drive again. In that case, it is necessary to "hotplug" the DoC *after* the PC has booted, into a powered up eval board.

  3. Now that all the DoC options are set, simply type:

    make

    If the build is successful, there should be a file named grub_firmware in the /stage1 directory.

Section #2: Unmodified 2.4.18 Kernel

Thanks to...

Thanks to Ilguiz Latypov for reviewing these instructions, and for answering many questions related to GRUB on the DiskOnChip.

Karim Yaghmour added the "ctrl-key bypass" feature -- I'm sure this has already saved many people lots of grief and aggravation.

David Woodhouse created the original DoC/GRUB patch.