etherboot

Richard Smith rsmith at bitworks.com
Tue May 13 12:22:00 CEST 2003


Serafino Sorrenti wrote:

> Hello,
> now i download etherboot 5.1.8, i need more information to use this! 
> 

This is perhaps a little late but from my FAQ/HOWTO.

How do I make LB use etherboot IDE?

    First you need to go get etherboot and compile it.  You either get
    the developement branch with IDE support or the stable branch which
    need a patch to work.

    Now modify the etherboot config file so that its compatible with
    LB. Specifically the ./src/Config file and the
    arch/<your arch>/Config file

    For Ver 5.1.8

    The options you need to make sure are set are:

    -DELF_IMAGE -DLINUXBIOS -DCONFIG_TSC_CURRTICKS -DCONFIG_PCI_DIRECT

    there are other options that are helpful like -DCONSOLE_SERIAL -
    DCOMCONSOLE=xxx

    The option(s) you need to make sure it NOT set are:

    -DPCBIOS

    Then compile etherboot.  You want to compile with a specific make
    command so that it generates the elfimage for LB to load.  This is
    done by taggin the .zelf on to your normal makefile command.

    For example to make the polling IDE loader elf image you need:

	make bin/ide_disk.zelf
	
	For Ver 5.0.x:
	
	<Someone needs to fill in the info for the earlier version>
	
    Now modify your linuxbios config file to include:

    option USE_ELF_BOOT=1
    option PAYLOAD_SIZE=<size of you etherboot payload>
    payload /path/to/your/etherboot/driver

    A quick note about PAYLOAD_SIZE.  This parameter does not specifiy
    the exact size of the image but rather its fed to the bs=<size>
    option of 'dd'.  This along with the 'sync' option causes dd to
    only output files that are a mutiple of the bs= size.  So if you
    specify bs=32768 but your input filesize is 40000 you will end up
    with a output file thats 65536.  So far I have just kept
    PAYLOAD_SIZE at 32768 and then go back and adjust ROM_SIZE such
    that the final image size is the size of my ROM part.

    You also need an input stream for the elfboot code to read from so
    you must set one (or more?) of the following options.

    USE_GENERIC_ROM=1

    <What are all the other stream options?>

    Now you need to create an elf kernel for the ether boot code to
    find. Go fetch the mkelfimage command at

    ftp://ftp.lnxi.com/pub/src/mkelfImage/

    Generally the latest one is better.  Note that there are several
    older versions of binutils that are broken and mkelfimage will
    expose those bugs. Insure that you are running a recient copy of
    binutils.  The following shows the version output from a known
    working bintuils.

     # as --version
     GNU assembler 2.13.90.0.10 20021010 Debian GNU/Linux
	
     Now compile mkelfimage.  Which should be as easy as ./configure,
     make, make install
	
     You can now create a elf kernel.
	
     Change to the directory where the image file for you kernel is.
     Normally this is somewhere in the kernel tree.  In my case this
     is arch/i386/boot and the kernel image is bzImage.
	
     By defaut mkelfimage is installed in /usr/local/sbin so
     you would do
	
     /usr/local/sbin/mkelfimage bzImage elfimage
	
     Now you have your kernel elfized in the file 'elfimage'
	
     mkelfimage support several options for adding commandlines and
     initrd's to the kernel image type 'mkelfimage' without any
     arguments for the details.
	
    Ok final setp. Locate the kernel on the IDE device.  Etherboot
    currently searchs the first 8k of disk space for the elf header.
    So you have to locate the start of that kernel within that space.

    If you don't care about having a proper partition table on your
    disk then you can just splat the kernel at the front of the disk.

    For the rest of the examples lets assume your disk is mounted in
    your *developement* machine as /dev/hde

    The following will write the kernel at the beginning of the IDE
    device.

    # cat elfimage > /dev/hde

    This works well if you don't need the IDE device for anything other
    than booting.

    If you want a filesystem on the device as well then you are going
    to have to protect the partition table as well.

    Currently the hack for accomplishing this is

    dd if=elfimage of=/dev/hde bs=4096 seek=1

    This will skip over the partition table and write the data in the
    area where the first partition would normally be.  So you have to
    create a disk with at least 2 partitions.  /dev/hde1 should be
    large enough to hold your kernel plus any initrd you may want.  You
    can then put your filesystem on /dev/hde2

    Note. It appears that in some setups dd may whine about /dev/hde
    being an "Invalid argument" but it appears to write the data to the
    disk anyway. Somebody mentioned that it was a "buffer size"
    mismatch with dd and ext3 but nothing definitive was ever posted.
    If you receive this and solve the issue please report it.

-- 
Richard A. Smith
rsmith at bitworks.com





More information about the coreboot mailing list