This is an old revision of the document!
====== Adding gPXE to BIOSes ====== === Add gPXE to the BIOS of the Jetway J7F2WE family of motherboards (replacing the Intel UNDI PXE code) === Jeff Campbell, Turks & Caicos Islands, February 27, 2008 ** Note: This is completely without warranty. It worked for me. It may not work for you. It may wreck your system. If you don't know what you're doing, don't do it. You have no recourse but to blame yourself and sit in the dark rocking in the fetal position if this fails.** The "[[http://www.ioss.com.tw/web/English/RD1BIOSSavior.html|RD1 BIOS Savior]]" from [[http://www.ioss.com.tw/|IOSS]] is a US$30 device that plugs into the motherboard BIOS ROM socket and allows manual switching between two BIOS chips. This allows you to boot from one BIOS ROM, then switch to a second BIOS ROM chip for trial flashing. If the new BIOS fails, you can switch back to the first, unmodified BIOS ROM, and try again (info from [[http://en.wikipedia.org/wiki/LinuxBIOS|Coreboot]]). I am currently using a large number of J7F2WE based motherboards for a computing cluster. The machines have no local storage at all, just a 1 GHz Via C7 processor and 1 GB of RAM. The on-board NIC on the motherboard is based on the VIa Rhine II chipset. My machines also have three more NICs per box, but they don't factor in to getting gPXE loaded. gPXE replaces the Intel PXE code included for the on-board NIC. These instructions are based on my experience with an Award 6.0 based BIOS. === Make a DOS bootable USB drive === We're going to be working with BIOS flashing utilities that run under DOS. Before you continue you should make a DOS bootable USB key (and ensure you can get it to boot on your system). We'll put various utilities and ROM files on it during this how-to. You can follow my [[make_usb_drive|instructions]] (assuming you have access to a MS Windows machine) to make one. === Grab the latest BIOS for your board === You should be able to find the latest BIOS on the manufacturers website. In my case I'm using A14 of the Jetway BIOS, which I found on the [[http://www.jetwaycomputer.com/VIA2.html|Jetway home page]]. I also grabbed the AWFLASH 8.80 utility, which we'll need to backup the existing BIOS and reflash the new gPXE enhanced BIOS. Put these on your new DOS bootable USB key. === Grab the CBROM utility === This is the magic tool that makes it possible. CBROM comes in various flavours, you can read more about it [[biosmodule|here]] * CBROM 1.xx is for Award BIOS 4.5 series only * CBROM 6.xx is for Award BIOS 6.0 series only * CBROM 2.xx is for Award BIOS 4.5 and 6.0 series I grabbed CBROM 6.xx from: http://www.biosmods.com/download/award/cbrom606.zip Unzip it and put it on your USB DOS boot disk. === Identify your NIC chipset === (I learned how to do this [[romburning|here]].) Boot your system in to linux and then run: lspci Scan the output for your onbaord NIC, mine showed up as: # lspci ... 00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78) To build a gPXE ROM via Rom-o-matic, we need to know the vendor and chipset id's. Using the infromation from above, lets interogate the PCI device: # lspci -n -s 00:12.0 ... 00:12.0 0200: 1106:3065 (rev 78) Make a note of the vendor and device IDs (1106 and 3065 respectively in the above example). === It's ROM-o-matic time, baby! === Now that you know your vendor and device ID, cruise on over to [[http://rom-o-matic.net/|ROM-o-matic]] This is a wonderful tool that will build the ROM you are going to add to the BIOS. We want to use the [[http://rom.etherboot.org/rom/|gPXE generator]]. At the time of writing it was at version 0.9.3. Click on the Image Generator. At step one, we need to choose the NIC/ROM type, which is what we needed the vendor and device information for. In my case I went down to the bottom to Via and found the entry: via-rhine:pci_1106_3065 -- [1106,3065] This is the NIC driver for my card. If you get this wrong, or if your NIC is not currently supported, you will not be able to sucessfully network boot. Most mainstream NICs or those in the market for a while are supported. If yours is not listed, join the IRC channel and ask, someone may be able to help. At step two, you want to choose "Binary ROM Image (.rom)" which is what we'll need to add to our BIOS file. At step three, if you want, you can customize the options that get rolled in to your ROM. I looked, but liked the defaults so I left them alone. Step four - hit the button, download the ROM to your USB key. === Now let's get our hands dirty === Boot the target machine with your USB DOS boot disk (DO NOT try and do it from a window within your existing OS - that may cause problems). You should have the awdflash utility, the latest bios for your system and your gpxe ROM file, as well as the CBROM utility on your USB key. If you don't, do not pass go, do not collect $100, go back to the start of this document and re-read the section about the fetal position. Use the awdflash utility to save your current BIOS (if its different than the latest one). You can use awdflash.exe /? to see a list of options and details on how to save it. Or don't save it, thats up to you. Just don't come crying to me. Next let's use CBROM to take a peek at your BIOS and see what PXE loader is in there. CBROM606.EXE J7F2WA14.BIN /D (where J7F2WA14.BIN is the filename of the BIOS you have on your USB key, either from downloading it or using AWDFLASH to save it) Which gives the following output: G:\>CBROM606.EXE J7F2WA14.BIN /D CBROM V6.06 (C)Award Software 1999 All Rights Reserved. <file> ******** J7F2WA14.BIN BIOS component ******** No. Item-Name Original-Size Compressed-Size Original-File-Name ================================================================================ 0. System BIOS 20000h(128.00K)11D13h(71.27K)J7F2WA14.BIN 1. XGROUP CODE 0EBE0h(58.97K)09EF1h(39.74K)awardext.rom 2. ACPI table 0671Eh(25.78K)02254h(8.58K)ACPITBL.BIN 3. YGROUP ROM 0AB00h(42.75K)04C16h(19.02K)awardeyt.rom 4. Other(4029:0000) 04CE0h(19.22K)02251h(8.58K)_EN_CODE.BIN 5. Other(40B5:0000) 01DE0h(7.47K)00C54h(3.08K)_ITEM.BIN 6. VGA ROM[1] 10000h(64.00K)0A48Bh(41.14K)E14JTWAY.ROM 7. PCI driver[A] 10000h(64.00K)07BECh(30.98K)237R497.ROM 8. PCI driver[B] 0D800h(54.00K)0821Ch(32.53K)PXERPL.LOM Total compress code space = 5A000h(360.00K) Total compressed code size = 3FBA6h(254.91K) Remain compress code space = 1A45Ah(105.09K) ** Micro Code Information ** Update ID CPUID | Update ID CPUID | Update ID CPUID | Update ID CPUID ------------------+--------------------+--------------------+------------------- SLOT2 2E 0F29| G:\> </file> Line 8 is what we are interested in. If you look in the far right column you can see the filename "PXERPL.LOM" which gives us a hint this is the PXE bootloader code. === Add the gPXE ROM === To make life easier, and to ensure I didn't tube my main BIOS file, I created a copy with an easier to type name, in my case I called my copy of J7F2WA14.BIN called gpxe14.bin Then I tried inserting the gpxe.rom in to it with the following command: CBROM606.EXE gpxe14.bin /pci gpxe-3065.rom /err (where gpxe-3065.rom is the name of the file rom-o-matic generated for you) The system should churn away for a while, then show a percentage complete. Go get a drink or something, don't be too anxious. After a while you will get your prompt back. I then used this command to confirm it appeared to be loaded in to the file: <file> CBROM606.EXE gpxe14.bin /D Sure enough it now said: G:\>CBROM606.EXE gpxe14.bin /D CBROM V6.06 (C)Award Software 1999 All Rights Reserved. ******** gpxe14.bin BIOS component ******** No. Item-Name Original-Size Compressed-Size Original-File-Name ================================================================================ 0. System BIOS 20000h(128.00K)11D13h(71.27K)J7F2WA14.BIN 1. XGROUP CODE 0EBE0h(58.97K)09EF1h(39.74K)awardext.rom 2. ACPI table 0671Eh(25.78K)02254h(8.58K)ACPITBL.BIN 3. YGROUP ROM 0AB00h(42.75K)04C16h(19.02K)awardeyt.rom 4. Other(4029:0000) 04CE0h(19.22K)02251h(8.58K)_EN_CODE.BIN 5. Other(40B5:0000) 01DE0h(7.47K)00C54h(3.08K)_ITEM.BIN 6. VGA ROM[1] 10000h(64.00K)0A48Bh(41.14K)E14JTWAY.ROM 7. PCI driver[A] 10000h(64.00K)07BECh(30.98K)237R497.ROM 8. PCI driver[A] 0AC00h(43.00K)0AA1Ch(42.53K)GPXE-3~1.ROM Total compress code space = 5A000h(360.00K) Total compressed code size = 423A6h(264.91K) Remain compress code space = 17C5Ah(95.09K) ** Micro Code Information ** Update ID CPUID | Update ID CPUID | Update ID CPUID | Update ID CPUID ------------------+--------------------+--------------------+------------------- SLOT2 2E 0F29| G:\> </file> Note line 8! So it appeared to load. Now it was time to flash the new updated BIOS file in to the machine. === Flash your new gPXE enhanced BIOS in to the eeprom === Up until this point, we've been playing with files on the USB key, but haven't touched your actual BIOS for writing. Now we will. I used the AWDFLASH utility, following the instructions from the Jetway site, and flashed it with: AWDFLASH.EXE /cd/cp/ch/wb/qi gpxe14.bin I followed the on screen prompts and then rebooted when done, entering the BIOS menu via the DEL key. I ensured that PXE booting was enabled under the Integrated Periperhals. Much to my delight, instead of the Intel PXE driver, up came the gPXE bootloader. Tah-dah. You now have gPXE on your box.