Reply to comment

How to create dosboot image for grub for updating bios

I always having the issues during updating bios under linux/ubuntu.

All bios updaters developed by vendors for processing under DOS/Windows, but very small amount of them have thoughts about linux users.
I have written article about using flashrom application for updating bios in ubuntu/linux(in ukrainian), but it is not universal and has limited support of devices.

Here I want to share ability to have boot image item in grub with freedos installed for making possible boot into and update bios for Your mobo.

So here is what you can do after you setup your Ubuntu system.

apt-get update
apt-get install syslinux

Download latest freedos iso image from original website

Do prepare grub2 bootloader for using memory disk

sudo cp -rfp /usr/lib/syslinux/memdisk to /boot
sudo mkdir /boot/images

Create file /etc/grub.d/55_memdisk

set -e
. /usr/lib/grub/grub-mkconfig_lib
if test -e /boot/memdisk ; then
  MEMDISKPATH=$( make_system_path_relative_to_its_root "/boot/memdisk" )
  echo "Memdisk found at: $MEMDISKPATH" >&2
  find $IMAGES -name "*.img" | sort |
  while read image ; do
      IMAGEPATH=$( make_system_path_relative_to_its_root "$image" )
      echo "Floppy image found at: $IMAGEPATH" >&2
      cat << EOF
menuentry "Bootable floppy image: $(basename $IMAGEPATH | sed s/.img//)" {
      prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
      cat << EOF
        linux16 $MEMDISKPATH bigraw
        initrd16 $IMAGEPATH

Install VirtualBox and create VM for dos with disk size ~300M. The same procedure, but using outdated qemu
Use downloaded freedos iso as bootable image for created VM. Do install it inside VM.
After installation, shut down VM and convert disk image to raw format

VBoxManage clonehd freedos.vhdk freedos.img –format raw
cp freedos.img /boot/images/

Copy the BIOS utilities for Your modo into the created FreeDOS Image

sudo -s
sfdisk -l -uS /boot/images/freedos.img

You should get result with a line

Device Boot Start End #sectors Id System
/boot/images/freedos.img * 63 650000 650000 e W95 FAT16 (LBA)

If You'll see 63 as Start, You have to be able to mount it with offset 63*512=32256
So do that

mkdir /mnt/freedos
mount -o loop,offset=32256 /boot/images/freedos.img /mnt/freedos
mkdir /mnt/freedos/bios
cp -rv ALL_FILES_WITH_BIOS_AND_FLASHER /mnt/freedos/bios
cd ~
umount -f /mnt/freedos

Now You have to update Your grub2 boot list with a command


After all You may reboot to freedos and make standard procedure for BIOS update.

Trackback URL for this post:



The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <img> <center> <b> <i> <u><h1><h2><h3><h4><h5><h6><strike><q><abbr><tr><td><table><br><p><div><span><embed><object>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
Enter the characters shown in the image.

Syndicate content

Propeople Expert


Rambler's Top100

Error. Page cannot be displayed. Please contact your service provider for more details. (15)