BIOS-Modification

General

Most of the popular PC BIOSes are modular. They contain beside the core BIOS routines a lot of additional code. There might be CPU code, fullscreen and EPA logos, virus protection, hardware drivers etc. added to the image. The BIOS is located in a flash rom chip. The sizes of the chips differ and range from 128kByte for simple BIOSes up to 512kByte for the big ones. The chips store the data serially, so you will find sizes of 1Mbit up to 4Mbit devices.

Mainboard vendors do not order the whole BIOS from AMI, AWARD, ... They get the core BIOS and add the drivers needed. If you have a board with VGA and LAN on-board, you will find at least an additional VGA BIOS within the chips. Often a PXE boot loader is added to. You will need that code for diskless booting. The code is chip specific and cannot added generally. The lan-on-mainboard is abbreviated lom, so you might find on your mainboard CD such types of files (i.e. with the ASUS pundit such CD is shipped). Unfortunately the PXE code is not added to the BIOS by the manufacturer sometimes. Or the driver for your on-board RAID chipset is buggy but the rest of BIOS is OK. Then you want to try to modify your BIOS to get things working. (You can try to contact the manufacturer, but that is often a daunting task :-)))

If you analyse your bios with a hex editor you will find several bios components packed together. Most of them are lha-compressed to reduce footprint. There is an boot loader often on the end, which is responsible to start with the machine and unpack the other components to RAM.

Tools

There are tools on the net, at least for AWARD (cbrom, modbin) and AMI (amibcp) bioses. These tools change with the development of the various BIOSes. Probably the best maintained package of BIOS tools is by "bnobtc". Check it for the most recent/ best matching versions of tools.

The Pundit trap

You will find the ASUS pundit as an nearly optimal machine for diskless linux computing (concepts see on LDC.GOE.NEThere ...)! Unfortunately the vendor puts the bcm4400.lom (the lan-on-mainboard PXE boot code file) onto the accompaigning CD but not into the bios itself. There would be plenty of empty space in it, if you remove the second copy of the VGA bios put to the chip (I removed the second identical image and the machine worked properly still on). Up to now I was not able to alter the BIOS image that way to have PXE included. Unfortunately WoL does not work too :-(

BIOS modification on an end?

The need for the classical BIOS is diminishing - M$ biulds a PC without it -> the X-Box. Other vendors are discussing it to drop the concept of BIOS in favour of better solutions (i.e. boot loaders as known from classical workstations). For linux you would'nt need much of the BIOS functionality too - it just prevents a fast startup of the machine :-))

I'm not following the BIOS scene as closely as before - I just try to choose a proper box vendor (with PXE and WoL enabled) and avoid the ASUS stuff :-))

Successful tested with the following boards

The following text and tests are much older, but might be interesting for some people, so I left it here ...

DISCLAIMER: For all the things discribed below, its at your own risk!! You may damage your hardware, unable to boot your mainboard etc. !!

For diskless XTerminals or diskless XStations its often useful to "burn" your bootcode into flashrom of the mainboard. So you can avoid having a EPROM burner and UV lamp in place. On the other side you need only software tools (awdflash.exe and cbrom.exe or cbrom6.exe) available on the net.

As described I experimented with the cbrom.exe utility from AWARD to manipulate the bios. With some mainboards I succeeded to add the netboot or etherboot code to bios so it would executed after the main boot process. But remember: You should add the question for boot locally! If you add the wrong code you may be unable to boot from disk or floppy! The additional code will be compressed by cbrom into the flash and then decompressed and copied into special ram location by the bios.

You need for this operation enough space to add the code. But you could often delete other parts of bios to get room for your stuff.

Success with:

Slot 1:

  • gigabyte bxc6 (2Mbit flashrom, enough space in flash, intel bx)
  • gigabyte lx2 (dual, 2Mbit flashrom, enough space in flash, intel lx)
  • yakumo (QDI P2MEX, intel ex, 1Mbit flash, but with some code removed - OK)
  • chaintech (6ESA2, intel ex, same like yakumo)
  • abit BP6 (2Mbit flashrom, enough space, intel bx, dual celeron) !! Here even the "cbrom /pci" option worked well! It added my code as PCI[B] after the code for the additional IDE (HPT366) adaptor. !!
  • aopen (mx3wl, intel 810, new AWARD bios, 4Mbit flash). Worked with "cbrom6" and "/pci" option.
  • aopen (mx3l, intel lx, relatively new AWARD bios, 2Mbit flash). Worked with "cbrom" and "/pci" option.
  • aopen (mx3w(pro), intel i810, relatively new AWARD bios, 4Mbit flash). Worked with "cbrom" and "/pci" option.
  • Socket A:

  • gigabyte 7fxpe, standard AMI bios
  • Socket 7:

  • PCChips 585LMR (Via-Chipset, 100Mhz, Sound, Davicom 10/100Mbit, graphic on board, 2Mbit Flash, enough space, but no etherboot driver for davicom 9102 chip, worked well with rtl8139)
  • PCChips M577 (ALI-Chipset, 100Mhz, Sound on board)
  • NMC Via-Chipset, relatively new AWARD
  • Failed with:

    Slot 1:

  • ASUS P2L-N (NLX, intel-lx, ATI graphic, sound on board, 2Mbit flash, enough space)
  • Socket 7:

  • older yakumo (Y586VX, intel vx, 1Mbit flash)
  • Socket 478:

  • all newer P4 boards from ASUS (Pundit, P4PE, P4-800, ...)

  • It seems to me that newer boards/biosses work more often then older ones the way I intended. I used cbrom in version 1.30C up to version 2.15 (the latest one on the net!?) In most cases I had to use the "cbrom bios.bin /isa rtl8139.rom D000:0" option instead of the "cbrom bios.bin /pci rtl8139.rom" option (exception: ABIT BP6). The latter one was used with the novell boot code provided in the bios with the all in one board with Davicom 9102 ethernet chip on board. I was told that the difference between /ISA and /PCI is, that ISA code is executed anyway, but PCI only when the correct combination of PCI and vendor ID is present at the bus.

    Somebody told me, that AWARD sets a compile time option to implement the feature for modifing bios. So it depends on this option if it might work or not.

    Newer mainboards that have an AWARD-BIOS can use etherboot without seperate EPROMS and therefore without the necessity of having a EPROM-programmer[?]. In order to do this, you need two software tools (or alternatives to them, check the aforementioned bnobtc page): awdflash.exe, which should be included in your mainboard package, and cbrom.exe, which is an OEM-tool that allows modifications of the BIOS. awdflash.exe reads and writes the flashrom content, whereas cbrom.exe is used to analyze the content of the AWARD BIOS image. cbrom.exe can also add code to the BIOS image or remove components. This way you can easily integrate etherboot into your mainboards without even opening the PC's case. There are some other flash tools but functionality is the same.

    After the BIOS image has been saved (e.g. as bios.bin), or in case the current version of the BIOS has been copied from the board manufacturer's website, 'cbrom bios.bin /d' shows how much space is left on the image for your code.

    As the flashrom holds the compressed BIOS, cbrom will also compress the code when adding it to the BIOS. Therefore, 8 to 20 kbyte of free memory is needed, depending on the network adapter's driver. In case not enough memory is left, unneeded BIOS components can be removed from the BIOS image to regain space: the manufacturer's logo or the Symbios/NCR SCSI-code are note needed for diskless systems. 'cbrom bios.bin /[pci|ncr|logo|isa] release' will remove those unnessary components.

    The command line "cbrom bios.bin /[pci|isa] bootimg.rom [D000:0]" adds the compiled etherboot code to the bios. bootimg.rom is the code we would use to burn onto EEPROMs in other cases. Depending on your network card, either the pci or isa options have to be used. With ISA cards you have to tell cbrom to which RAM location the code will be extracted at boot time. Attention: Compile the etherboot with the -DASK_BOOT or -DEMERGENCYDISKBOOT option to be able to access a disk. The code added by cbrom will be executed before the computer seeks for a boot disk or floppy.

    Recent AMI Bios

    For AMI BIOS exists a tool too: amibcp.exe. It is menudriven and has the same features like cbrom.exe. Most of newer AMI-Biosses are patchable the way described with AWARD biosses.

    Other BIOS vendors:


    It is no great fun to look or ask for tools for the other BIOS vendors.

    At Dell they told me a lot of "blahblah" when I asked for it. In the end when they decided it is rediculous to deny it, they told me it is all closed and intellectual property etc. ...

    Asking Phoenix was in vain too ...

    If anybody got hold of such a tool for phoenix, intel ... biosses it would be cool if he could name it to me!

    If it doesn't work:

    1) The bios version may be too old to be modified with cbrom or amibcp
    2) Check if the EPROM option is enabled on the network adaptor. Use the manufacturer tools to check the settings. Size doesn't matter much but should be as big as the image is. At least for the RTL8139 based adaptors the EPROM should be enabled to let etherboot work properly.

    3) Check the bios settings: With some boards and versions of AWARD bios it is possible to prevent net booting, even with EPROM or code patched to the bios, because of "boot from network" option disabled.
    4) Check the bios image with hex editor to make sure the desired image was added. Search for "55:AA" at the beginning of a line. It's the marking for additional bios codes. Use diff for simple testing. The original bios image and the patched on should differ :-)
    5) Check PCI and vendor id's of your lan card: If they dont match etherboot will not be run ... (see the fine etherboot manuals about it: Some manufacturer may use a popular chip like rtl8139 but dont use the common id for it.)

    How to recover boards flashed with the wrong code

    DISCLAIMER: For all the things discribed below, its at your own risk!! You may damage your hardware, unable to boot your mainboard etc. !!

    1) boot it with a dos floppy containing the bios flash tool
    2) write the content of your motherboard bios to a file
    3) remove !!carefully!! the bios chip (its the chip in a socket (labelled with AMI or AWARD, ...) without switching the power off
    4) insert the bios chip from your other board (same type, which was flashed with the wrong code)
    5) run the flash utility again and flash the bios file to the inserted chip
    6) If you have another chip (of a broken board -> same size in kByte!!) you may do 5) again to have a backup
    7) now you can reboot and the machine should come up again

    Sometimes this procedure may work with different boards but with bios chips of the same size (You have to remove the label of the bios chip to check it's factory label for the size information. Many bios flash tools may show you the size either ....) In this case you have to replace the newly written chip with the board original one or step 7) shouldn't work.

    Text von Dirk v. Suchodoletz (dirk AT goe DOT net)

    Last Change on 21.11.2005 at 14:35 (webmaster AT goe DOT net).