January 9, 2003

Modifying your BIOS for fun and profit

I have just done something very perverse, and quite inexplicably it seems to be working.

I have an Amptron Eureka SD-4925A. More accurately, work has one. I’m charged with getting it to boot Linux from the network and run an RDP client (probably rdesktop). I’m told the machine has network booting capabilities. OK, no problem. I take it home and look at it.

It will boot off the network. Unfortunately its boot protocol is something called “Novell RPL.” This is different from “IBM RPL,” especially because IBM RPL is supported in Linux but Novell’s is not. (I think I read something to the effect of “Novell won’t release specs for RPL.”) This does not make me a happy dictator. So now my boss thinks I should give up and boot from floppy or CD-ROM. Floppy is unreliable, though, and I can’t update CD-ROM without physically replacing it.

Somehow I start reading about Etherboot which provides a sort of “boot ROM” for your computer. You can load it off a floppy disk, or… some people seem to be putting it to EEPROM. What’s this? Some people are putting it in Award BIOSes? Hm. Unfortunately I have an AMI BIOS (though the most recent revision for my board at Amptron’s site mysteriously seems to be an Award BIOS). Not many instructions on this.

Now I find an IRC log from #ltsp (LTSP being the Linux Terminal Server Project I believe) mentioning the fact that a person named Dave Anders has some utilities you can use to modify an AMI BIOS. I got on #ltsp and talked to him. He was the one that got me started on the correct path of evil that lead to using a modified BIOS.

WARNING: If you were to follow the instructions I’m spewing forth here, you may render your computer unusable, damaged, or even turn it in to an evil sentient being bent on the domination of the entire human race — starting with you. I am not responsible for broken equipment, damage, loss of data, hair, or erectile dysfunction. The instructions henceforth are what I did. I do not guarantee this will work for you. I’m still fucking shocked it worked for me. I make a lot of assumptions here based on what my system is like. For example, I have a PCI NIC (on-board).

You’ll need a plain DOS boot disk, and probably a second blank floppy to load two utilities and a BIOS image on to. Boot off the floppy and use B: when you’ve booted up. Then when it asks you to insert the floppy for B: (unless you’ve got two floppy drives) insert the disk with the utilities and BIOS image on it.

First, back up your BIOS. I had to use the AMINF332.EXE utility from Amptron’s BIOS page. The newest AMI flash utility wouldn’t work; something about “Chipset/part not available” when I ran it, IIRC. You probably need to do this from a plain DOS boot disk. The command line is something like: AMINF332.EXE /SBACKUP.ROM. This should save your current BIOS to BACKUP.ROM. When I did it the size of my BIOS images were always 262,144 bytes.

At this point, make a copy of BACKUP.ROM to another disk. Make several copies. If you fuck up, you’ll thank yourself.

You’ll need an Etherboot image for your card. The nice people at Etherboot (I think they’re responsible) created http://www.rom-o-matic.net/ to help you create a boot ROM. You want to make a binary image; it’ll have an extension of .lzrom. If you don’t know what kind of Ethernet card you have, like I didn’t, I recommend the following: boot in to Linux. I used a Linuxcare Bootable Business CD-ROM I had lying about, but anything that you can run lspci on should do. Find the device and vendor IDs for your Ethernet card. In my case, for example, lspci showed me an Ethernet controller on 00:12.0 or something like that. Then you can do an lspci -n and find the numbers after “Class XXXX” (where XXXX is four hexadecimal digits). These will be in the format (at least on my machine) of “VVVV:DDDD” where VVVV is the vendor ID and DDDD is the device ID. You can check someplace like the Etherboot list of supported hardware, or a similar source from the latest version available on http://www.rom-o-matic.net/. I find “0×1106,0×3065″, look up in the list, and spot “family via-rhine”. That’s the “NIC/ROM type” I need to use on http://www.rom-o-matic.net/. Save the resulting ROM to your floppy disk.

Now you’ll need to put the utility AMIBCP.EXE on a floppy. Next run AMIBCP.EXE BACKUP.ROM. (You’d better have a copy of BACKUP.ROM elsewhere!) You’ll get a nice menu-driven interface, DOS-style. Select “Edit BIOS Modules”.

Here’s the tricky part. At the bottom right-ish corner it says “Available Memory” (well, actually, it says “Availabel Memory”, but you get the idea) and to the right of that in parenthesis is the number of bytes remaining. You’re going to need enough available memory to insert your Etherboot ROM. To find out how much space it’s going to need, first press the insert key and type in the name of your Etherboot image file. The next screen should be “Change Module Characteristics”. For “Module ID” it should say something like “20h PCI AddOn ROM”. Use the arrow keys to move down to “Compressed” and press the plus key (+) to change that to “yes”. Now look up a couple lines at the value in the parenthesis after “Module Size”. This is how much available memory you’re going to need. For example, in my case I was going to need 14,518 bytes. Press the escape key twice to get back to the “Edit BIOS Modules” screen. Now if you don’t have enough available memory you’ll need to delete some things.

I got lucky with deleting modules. I found another module which was a “PCI AddOn ROM” and had “3065:1106″ listed in the right-most column. I now presume this was the old Novell RPL boot code for the network card. I deleted this and had plenty of space. The only other things I’m somewhat certain can be deleted is something like “OEM Logo” or “EPA / OEM Logo”. I’m not even real sure about this, but Dave Anders was able to do this in his case. I also note that, back from the main menu, I could select “Configure BIOS Options”, then scroll down to the bottom of the list and disable “Display AMI Logo” and “Display OEM Logo”. If you have to delete the OEM logo from the BIOS, you may want to turn off both of these options. I’ll also note that I read somewhere that you should not delete the “Image Display Code” (or “Image Dsiplay Code” as it appears in my BIOS); I don’t know if this is still valid.

Once you have enough space, do what we did before to check the size of the Etherboot ROM: press insert, enter the file name of the Etherboot ROM, change “Compressed” to “yes”. Instead of pressing escape twice to get back to the “Edit BIOS Modules” screen, though, press F10 to save these changes. It may ask you to confirm, which I think requires to press enter to confirm. You should see your new “PCI AddOn ROM” at the bottom of the list. Now press escape to go to the main menu and select “Save BIOS To Disk File”. I just overwrote my BACKUP.ROM because there wasn’t enough disk space to write a new ROM AFAIK.

Once you’re done with that, exit the AMIBCP utility. Now it’s time to flash your ROM file back up to the motherboard. Type AMINF332 YOUR.ROM /A where YOUR.ROM is whatever you saved your ROM as in AMIBCP, above. For example, I saved my ROM back out to BACKUP.ROM, so I’d type AMINF332 BACKUP.ROM /A. This should flash your computer then immediately reboot. When you reboot, enter the CMOS settings; in my case it asked me to go in to setup anyway, because in the process of flashing I guess your settings are erase. I loaded optimal settings and then went in to select boot devices. On my BIOS, a selection called “via-rhine.lz” or some such showed up. I selected this as the third boot device, behind floppy disk and CD-ROM. Save and exit with your BIOS parameters. Let your computer get to the point of trying to boot off the network. You should see something about “Etherboot” come up. Voila!

Just that easy. I’m fucking stunned this worked. All props to Dave Anders, without whom I probably would have given up, and the Etherboot team for making something so bizarre and useful so easy.

More reports on if this really works once I get a bootable image up and such. I can see my DHCP server responding already, but it’s not sending any boot image information out so I don’t expect Etherboot cares about the replies.

Comments (3)

  1. October 4, 2003
    Jiri Cermak said...

    Many thanks, for the pleasure time you give
    me from your fresh brain think.

    With greeting regards.

  2. June 27, 2004
    Joe said...

    I spent a week trying to figure out how to get my RPL boards to boot, and it’s right here. I have a similar board (same ethernet controller), though it’s a Matsonic which has the added fun of NOT being able to use AMIBCP in graphical mode for edits (thus learning the intricacies of the command-line). Not a problem– I could use the GUI to confirm I had made the right changes, and booted up and *bingo* there’s my etherboot ROM, built my image, and had my crunchers up and running.

    Glad you have this info out there.

  3. February 20, 2005
    Rajib Samadder said...

    Hello,
    I like to know can I put full screen logo into ASRock Motherboard P4i45GV motherboard which has AMI BIOS v.3.00 ?
    Rajib