Results 1 to 4 of 4

Thread: HOWTO Update your BIOS using Ubuntu, Grub2, memdisk and Freedos

  1. #1
    Join Date
    Dec 2006
    Beans
    88
    Distro
    Ubuntu

    Lightbulb HOWTO Update your BIOS using Ubuntu, Grub2, memdisk and Freedos

    hello folks...

    I always had trouble upgrading the BIOS on my BOXDG45FC motherboard. Most of the Howto's onlne use the 1.44MB floppy disk images however the intel bios is about 13M

    -rw-r--r-- 1 root root 13M 2010-07-12 09:14 Downloads/IDG4510H.86A.0131/ID0131P.BIO

    So here is what you can do after you setup your Ubuntu(or any linux) system.

    1. Install the required tools...
    Code:
    apt-get update
    apt-get install syslinux qemu
    2. Download the prerequisites...
    Code:
    wget 'http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdbasecd.iso'
    3. Prepare grub2 to use memdisk
    Code:
    sudo cp -rfp /usr/lib/syslinux/memdisk to /boot
    sudo mkdir /boot/images
    4. Create the following file
    Code:
    root@pc:~# ls -l /etc/grub.d/50_memdisk 
    -rwxr-xr-x 1 root root 661 2010-08-04 09:01 /etc/grub.d/50_memdisk
    root@pc:~# cat /etc/grub.d/50_memdisk 
    #!/bin/sh
    
    set -e
    
    IMAGES=/boot/images
    . /usr/lib/grub/grub-mkconfig_lib
    if test -e /boot/memdisk ; then
      MEMDISKPATH=$( make_system_path_relative_to_its_root "/boot/memdisk" )
      echo "Found memdisk: $MEMDISKPATH" >&2
      find $IMAGES -name "*.img" | sort | 
      while read image ; do
          IMAGEPATH=$( make_system_path_relative_to_its_root "$image" )
          echo "Found floppy image: $IMAGEPATH" >&2
          cat << EOF
    menuentry "Bootable floppy: $(basename $IMAGEPATH | sed s/.img//)" {
    EOF
          prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
          cat << EOF
            linux16 $MEMDISKPATH bigraw
            initrd16 $IMAGEPATH
    }
    EOF
      done
    fi
    5. Create a empty image file for freedos
    Code:
    dd if=/dev/zero of=/boot/images/fdos-250m-hdd.img bs=1M count=250
    (note the extension of the file is .img as this is the way it is coded in the 50_memdisk. you can choose a smaller size, I just happened to choose 250MB)
    6. Install freedos to this image
    Code:
    qemu -hda /boot/fdos-250m-hdd.img -cdrom /path/to/fdbasecd.iso -boot d
    Follow the freedos prompts to format the disk, then install the OS on the formatted disk (which is 250MB in this case) You can refer the instructions in the 2nd acknowledgment link below..

    To exit out of freedos use
    Code:
    FDAPM POWEROFF
    7. Copy the BIOS utilities into the DOS Image...
    Code:
    root@pc:~#sudo -s
    root@pc:~# sfdisk -l -uS /boot/images/fdos-250-hdd.img 
    Disk /boot/images/fdos-250-hdd.img: cannot get geometry
    
    Disk /boot/images/fdos-250-hdd.img: 31 cylinders, 255 heads, 63 sectors/track
    Warning: The partition table looks like it was made
      for C/H/S=*/16/63 (instead of 31/255/63).
    For this listing I'll assume that geometry.
    Units = sectors of 512 bytes, counting from 0
    
       Device Boot    Start       End   #sectors  Id  System
    /boot/images/fdos-250-hdd.img1   *        63    511055     510993   e  W95 FAT16 (LBA)
    /boot/images/fdos-250-hdd.img2             0         -          0   0  Empty
    /boot/images/fdos-250-hdd.img3             0         -          0   0  Empty
    /boot/images/fdos-250-hdd.img4             0         -          0   0  Empty
    root@pc:~# bc
    bc 1.06.95
    Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
    This is free software with ABSOLUTELY NO WARRANTY.
    For details type `warranty'. 
    512*63
    32256
    quit
    root@pc:~# mount -o loop,offset=32256 /boot/images/fdos-250-hdd.img /mnt/
    root@pc:~# mkdir -p /mnt/INTEL
    root@pc:~# cp -rfp ~/Downloads/IDG4510H.86A.0131/ID0131P.BIO  ~/Downloads/IDG4510H.86A.0131/IFLASH2.EXE /mnt/INTEL
    root@pc:~# md5sum ~/Downloads/IDG4510H.86A.0131/ID0131P.BIO   ~/Downloads/IDG4510H.86A.0131/IFLASH2.EXE /mnt/INTEL/* | sort 
    root@pc:~# sync; cd /
    root@pc:~# umount -f /mnt
    8. Update grub to use this image
    Code:
    update-grub2
    This should create a menu entry in grub to boot from this new disk image...

    Thats it...

    reboot the system and select the freedos boot option which was created... this will get you into a freedos environment which has over 250MB of space where you can store all your bios files and update as you feel like...

    No need to fiddle with USB pens or sticks...

    Hope his helps...

    Ghat

    Acknowledgments:

    1. http://machine-cycle.blogspot.com/20...grub2-and.html
    2. http://manual.sidux.com/en/bios-freedos-en.htm

    Appendix
    1. To find out the details of the current bios on you machine use the following command
    Code:
    root@pc:~# dmidecode --type bios
    # dmidecode 2.9
    SMBIOS 2.4 present.
    
    Handle 0x0000, DMI type 0, 24 bytes
    BIOS Information
            Vendor: Intel Corp.
            Version: IDG4510H.86A.0131.2010.0712.0906
            Release Date: 07/12/2010
            Address: 0xF0000
            Runtime Size: 64 kB
            ROM Size: 1024 kB
            Characteristics:
                    PCI is supported
                    BIOS is upgradeable
                    BIOS shadowing is allowed
                    ESCD support is available
                    Boot from CD is supported
                    Selectable boot is supported
                    BIOS ROM is socketed
                    EDD is supported
                    5.25"/1.2 MB floppy services are supported (int 13h)
                    3.5"/720 KB floppy services are supported (int 13h)
                    3.5"/2.88 MB floppy services are supported (int 13h)
                    Print screen service is supported (int 5h)
                    8042 keyboard services are supported (int 9h)
                    Serial services are supported (int 14h)
                    Printer services are supported (int 17h)
                    CGA/mono video services are supported (int 10h)
                    ACPI is supported
                    LS-120 boot is supported
                    ATAPI Zip drive boot is supported
                    BIOS boot specification is supported
                    Targeted content distribution is supported
    
    Handle 0x0029, DMI type 13, 22 bytes
    BIOS Language Information
            Installable Languages: 1
                    en|US|iso8859-1
            Currently Installed Language: en|US|iso8859-1
    
    root@pc:~#
    Last edited by ghat; August 4th, 2010 at 07:42 PM.
    : Phenom II X4 940BE : M4A785M : 8GB:SS-TJ08-E :: desk
    : E3-1240v2 : X9SCM-iiF : 16G:Antec-902v3 :: server
    : E6550 : DG45FC : 4GB:Apex MI-008 :: htpc

  2. #2
    Join Date
    Jan 2008
    Location
    Pretoria, South Africa
    Beans
    5
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO Update your BIOS using Ubuntu, Grub2, memdisk and Freedos

    Hi there
    This all seems very legit and a great idea, just note a couple of mistypes. I have posted the correct lines below(correct me if Im wrong):
    step6:
    qemu -hda /boot/images/fdos-250m-hdd.img -cdrom /path/to/fdbasecd.iso -boot d

    step7:
    the line
    root@pc:~# fdisk -lus /boot/images/fdos-250-hdd.img
    root@pc:~# mount -o loop,offset=32256 /boot/images/fdos-250m-hdd.img /mnt/

    I have followed these instructions and my grub still does not see any DOS operating systems to boot from. Have you done this personally and it worked for you?Also, I noted that the first link you gave (http://machine-cycle.blogspot.com/20...grub2-and.html) edited the "/etc/grub.d/40_custom" file instead of the 50_memtest. Any reason for this?
    Last edited by Slywire; November 14th, 2010 at 09:27 PM.

  3. #3
    Join Date
    Dec 2006
    Beans
    88
    Distro
    Ubuntu

    Red face Re: HOWTO Update your BIOS using Ubuntu, Grub2, memdisk and Freedos

    Quote Originally Posted by Slywire View Post
    Hi there
    This all seems very legit and a great idea, just note a couple of mistypes. I have posted the correct lines below(correct me if Im wrong):
    step6:
    qemu -hda /boot/images/fdos-250m-hdd.img -cdrom /path/to/fdbasecd.iso -boot d

    step7:
    the line
    root@pc:~# fdisk -lus /boot/images/fdos-250-hdd.img
    root@pc:~# mount -o loop,offset=32256 /boot/images/fdos-250m-hdd.img /mnt/

    I have followed these instructions and my grub still does not see any DOS operating systems to boot from. Have you done this personally and it worked for you?Also, I noted that the first link you gave (http://machine-cycle.blogspot.com/20...grub2-and.html) edited the "/etc/grub.d/40_custom" file instead of the 50_memtest. Any reason for this?
    Yes I have used this, but its possible there are some typos...

    Well my sever went down for other reasons, and I have to do this procedure again, so I will correct any mistakes in the coming few weeks.

    G
    : Phenom II X4 940BE : M4A785M : 8GB:SS-TJ08-E :: desk
    : E3-1240v2 : X9SCM-iiF : 16G:Antec-902v3 :: server
    : E6550 : DG45FC : 4GB:Apex MI-008 :: htpc

  4. #4
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 17.10 Artful Aardvark

    Re: HOWTO Update your BIOS using Ubuntu, Grub2, memdisk and Freedos

    Closed, necromancy.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •