bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Installing GRUB to flash bootdisk...


From: Eric Peterson
Subject: Installing GRUB to flash bootdisk...
Date: Thu, 28 Jun 2001 15:07:32 -0700

I'm trying to load GRUB onto a flash boot disk (being treated by the
BIOS as a floppy drive).  Although I can successfully burn a Linux
bzImage to the flash (with a minor modification to give it a DOS-like
BPB) and boot it, doing similar things with GRUB has me stumped.  

Here's the basic procedure I'm using:

    mke2fs /dev/fd0                 # Build the fs
    mount /dev/fd0 /mnt/floppy
    cp bzImage /mnt/floppy          # my kernel

    mkdir /mnt/floppy/boot/grub
    cp /boot/grub/* /mnt/floppy/boot/grub   # Bring in GRUB stuff
    
    grub --batch <<EOF
    device (fd0) /dev/fd0   # Not sure if this is necessary
    root (fd0)
    install (fd0)/boot/grub/stage1 (fd0) (fd0)/boot/grub/e2fs_stage1_5 
(fd0)/boot/grub/stage2
    quit
    EOF

    umount /dev/fd0

    dd if=/dev/fd0 of=grub.img bs=64k   # copy off the fd image

    Now I run a hex editor and patch in a BPB (to fake my BIOS into
    thinking this is a floppy, as I did with my bzImage above):

    image
    offset      value   size    use
    -----       -----   ----    ---
    0x0b        512     word    bytes per sector
    0x0d        1       byte    sectors per cluster
    0x0e        1       word    reserved sectors
    0x10        0       byte    num FATs
    0x11        0       word    max dir entries in root
    0x13        2880    word    total sectors
    0x15        0xf0    byte    media descriptor
    0x16        9       word    sectors per FAT
    0x18        18      word    sectors per track
    0x1a        2       word    num heads


    I can dd the above image back to the floppy and GRUB boots fine on a
    PC.  Burning onto my Flash-floppy drive has problems though, it
    boots with:

        Boot GRUB Loading stage1_5..

        GRUB loading, please wait...

    And it hangs. 

    I've tried it with versions 0.5.94 as well as 0.5.96.1 with more or
    less the same results.  Also, it seems that documentation on the
    stage1_5 is a bit scarce, I'm trying to figure out how it figures
    out where stage2 is located, I suspect that I've done something to
    cause it to jump into never-never land...

    Thanks in advance for reading through this diatribe...

Regards,
Eric
    
-- 
Every decent man is ashamed of the government he lives under.  -- H.L.
Mencken 

Eric Peterson WB6PYK (805)370-3046 mailto:address@hidden
    http://www.troikanetworks.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]