PXE boot FreeDOS with MEMDISK to flash a GIGABYTE BIOS
Having recently sorting through some of the junk that I have been accumulating over the past several years, I decided that I would reincarnate a three-years dormant 1GHz AMD Athlon, which has been almost stripped bare for parts, into a silent running MythTV frontend. After loading the board with a whole 256Mb of RAM, replacing the graphics card with an old NVIDIA GeForce2 MX400, replacing the existing network card with a PXE-capable 3COM 905C Fast EtherLink XL PCI NIC, and salvaging a 40Gb Seagate ST340823A HDD, I was ready to begin.
The task: Install Ubuntu using the Netboot installation image via PXE boot; a process that is usually straightforward and is adequately described in several guides such as this, http://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install
The problem: The installer was hanging when attempting to read the partitions on the ST340823A HDD, with the IDE bus being repeatedly reset until it finally gave up. This was no surprise as the CMOS setup utility was freezing whenever I performed an IDE Auto Configuration from within BIOS configuration system, however if it was set to auto detect the drive on boot then things would proceed normally. Hence I assumed (correctly, as it happens) that my current GA-5AA F3 BIOS was restricted to a ~30GB IDE HDD size limit.
New task: Flash a legacy GIGABYTE BIOS on a machine with no external drives and with no MS-DOS boot disks or images to hand; a process that is less simple and not well documented.
GIGABYTE supply an updated BIOS version F7b(Beta) for the board. This comes in the form of a self-extracting executable that can be downloaded from http://www.giga-byte.co.uk/Support/Motherboard/BIOS_Model.aspx?ProductID=1439
The Linux file utility identifies this as an "MS-DOS executable PE for MS Windows (GUI) Intel 80386 32-bit, UPX compressed, RAR self-extracting archive" from which I figured that I could extract the contents using the rar:
$ rar x motherboard_bios_ga-5aa_f7b\(beta\).exe
<...snip...>
Extracting autoexec.bat OK
Extracting flash830.exe OK
Extracting GA-5AA.F7b OK
All OK
The autoexec.bat indicates that you can flash your BIOS from MS-DOS as simply as A:\FLASH830 GA-5AA.F7b
So how do you boot into MS-DOS in order to do this? Cheat! Enter FreeDOS - an open source MS-DOS compatible operating system, which is claimed as being what most motherboard manufacturers now use in the development of their BIOSes. The project provides a raw image of a minimal boot floppy that is available from the file archive at http://www.freedos.org/freedos/files/ called fdboot.img. This needs to be amended to include the flash830.exe and GA-5AA.F7b files which can be done easily from within Linux.
mount -t vfat -o loop fdboot.img /mnt/floppy
cp flash830.exe GA-5AA.F7b /mnt/floppy
umount /mnt/floppy
Now all that is required is to boot this image and run the flash commands. MEMDISK, part of the SYSLINUX suite, provides support for booting legacy operating systems and this will work over PXELINUX, http://syslinux.zytor.com
Instructions for configuring PXELINUX are available in several places, but in summary the process involves configuring a DHCP server, configuring a TFTP server, and then copying the necessary boot images and creating the configuration files in the TFTP root.
The required pxelinux.cfg pragma for booting a FreeDOS boot disk image is as follows:
label dos
kernel memdisk
append initrd=fdboot.img
With all of this configured the PC netbooted into FreeDOS from where the flash utility was invoked as A:\FLASH830 GA-5AA.F7b. After reporting success I rebooted the PC and reassuringly the BIOS screen reported the BIOS version as being GA-5AA F7b. And most importantly, the IDE Auto Configuration feature now detected the drive correctly, without freezing!
So I had another go at installing Ubuntu using the Netboot installer... and unfortunately it hung in exactly the same place! Whilst the BIOS update had certainly resolved a particular size limit issue, it had unfortunately not solved the issue with this hard disk.
A bit of Googling revealed that the failure is due to a firmware bug in the Seagate ST340823A model that incorrectly reports the total number of addressable sectors rather than the last addressable sector (zero-based) when queried with the "stroke" feature enabled, http://bugzilla.kernel.org/show_bug.cgi?id=8816
When the Ubuntu partitioner examines the drive it attempts to read the final sector, as reported by the hard disk, which is non-existent and so causes the kernel to throw a fit, repeatedly retrying the read between forced IDE bus resets, until the channel gives up completely.
Unfortunately Seagate do not appear to have released an updated firmware for this drive so it looks like I will miss another opportunity to put FreeDOS to good use ;-)
The task: Install Ubuntu using the Netboot installation image via PXE boot; a process that is usually straightforward and is adequately described in several guides such as this, http://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install
The problem: The installer was hanging when attempting to read the partitions on the ST340823A HDD, with the IDE bus being repeatedly reset until it finally gave up. This was no surprise as the CMOS setup utility was freezing whenever I performed an IDE Auto Configuration from within BIOS configuration system, however if it was set to auto detect the drive on boot then things would proceed normally. Hence I assumed (correctly, as it happens) that my current GA-5AA F3 BIOS was restricted to a ~30GB IDE HDD size limit.
New task: Flash a legacy GIGABYTE BIOS on a machine with no external drives and with no MS-DOS boot disks or images to hand; a process that is less simple and not well documented.
GIGABYTE supply an updated BIOS version F7b(Beta) for the board. This comes in the form of a self-extracting executable that can be downloaded from http://www.giga-byte.co.uk/Support/Motherboard/BIOS_Model.aspx?ProductID=1439
The Linux file utility identifies this as an "MS-DOS executable PE for MS Windows (GUI) Intel 80386 32-bit, UPX compressed, RAR self-extracting archive" from which I figured that I could extract the contents using the rar:
$ rar x motherboard_bios_ga-5aa_f7b\(beta\).exe
<...snip...>
Extracting autoexec.bat OK
Extracting flash830.exe OK
Extracting GA-5AA.F7b OK
All OK
The autoexec.bat indicates that you can flash your BIOS from MS-DOS as simply as A:\FLASH830 GA-5AA.F7b
So how do you boot into MS-DOS in order to do this? Cheat! Enter FreeDOS - an open source MS-DOS compatible operating system, which is claimed as being what most motherboard manufacturers now use in the development of their BIOSes. The project provides a raw image of a minimal boot floppy that is available from the file archive at http://www.freedos.org/freedos/files/ called fdboot.img. This needs to be amended to include the flash830.exe and GA-5AA.F7b files which can be done easily from within Linux.
mount -t vfat -o loop fdboot.img /mnt/floppy
cp flash830.exe GA-5AA.F7b /mnt/floppy
umount /mnt/floppy
Now all that is required is to boot this image and run the flash commands. MEMDISK, part of the SYSLINUX suite, provides support for booting legacy operating systems and this will work over PXELINUX, http://syslinux.zytor.com
Instructions for configuring PXELINUX are available in several places, but in summary the process involves configuring a DHCP server, configuring a TFTP server, and then copying the necessary boot images and creating the configuration files in the TFTP root.
The required pxelinux.cfg pragma for booting a FreeDOS boot disk image is as follows:
label dos
kernel memdisk
append initrd=fdboot.img
With all of this configured the PC netbooted into FreeDOS from where the flash utility was invoked as A:\FLASH830 GA-5AA.F7b. After reporting success I rebooted the PC and reassuringly the BIOS screen reported the BIOS version as being GA-5AA F7b. And most importantly, the IDE Auto Configuration feature now detected the drive correctly, without freezing!
So I had another go at installing Ubuntu using the Netboot installer... and unfortunately it hung in exactly the same place! Whilst the BIOS update had certainly resolved a particular size limit issue, it had unfortunately not solved the issue with this hard disk.
A bit of Googling revealed that the failure is due to a firmware bug in the Seagate ST340823A model that incorrectly reports the total number of addressable sectors rather than the last addressable sector (zero-based) when queried with the "stroke" feature enabled, http://bugzilla.kernel.org/show_bug.cgi?id=8816
When the Ubuntu partitioner examines the drive it attempts to read the final sector, as reported by the hard disk, which is non-existent and so causes the kernel to throw a fit, repeatedly retrying the read between forced IDE bus resets, until the channel gives up completely.
Unfortunately Seagate do not appear to have released an updated firmware for this drive so it looks like I will miss another opportunity to put FreeDOS to good use ;-)
3 Comments:
Thanks for the post!!! This shed some light on another method, that doesn't require PXE booting. Simply use GRUB. Copy the fdboot.img and memdisk file into /boot, and then update GRUB with an entry like this:
title BIOS FLASH GIGABYTE
kernel /boot/memdisk
initrd /boot/fdboot.img
Reboot, and there ya go.
That worked for me as well with one exception. I had to add "floppy" after memdisk:
title BIOS FLASH GIGABYTE
kernel /boot/memdisk floppy
initrd /boot/fdboot.img
Hi Terry,
Thanks for posting this, I've seen it linked from a couple other guides after I originally found it through Google and it was extremely helpful (and encouraging). Sadly even though I got PXE to load FreeDOS working, apparently my motherboard (dual core dual CPU registered ECC DDR) does not play nicely with FreeDOS. I tried burning the FreeDOS CD as a test to see if it was my PXE and apparently it was not, FreeDOS just doesn't like my board. I ended up plugging in a floppy drive *shudder* and had to go through 3-4 disks to find a good one that would format with the BIOS flashing image from www.bootdisk.com and load up the flashing utility from Tyan properly.
Post a Comment
<< Home