Facilitation of BIOS flash upgrades. [update-grub]

Paul Sladen ubuntu at paul.sladen.org
Fri Jan 21 18:51:49 CST 2005


On Fri, 21 Jan 2005, Colin Watson wrote:
> On Fri, Jan 21, 2005 at 03:11:25PM +1100, Shimon wrote:
> > i still do not understand why it is windows/dos based

Writing to Flash is time critical operation.  This is the reason DOS is
preferred, thinking of DOS as a boot-loader ('No OS') is probably better.  
The aim here is to get yourself loaded and have exclusive control of the
machine, knowing that you aren't going to get swapped out, task-switched,
CPU migrated or superceded by an incoming firewire interupt when the kernel
wants to take over.

> It would be good if enough documentation were available so that somebody
> else could write a working flash tool, though.

There are some tools.  Uniflash is a DOS-based program (written in Pascal
IIRC) with an impressive list of supported flash parts:

  http://www.uniflash.org/hardware.htm

As for under Linux, these need to be written as kernel drivers because of
the issues mentioned above.  There are the kernel 'MTD' (Memory Technology
Devices aka Flash) drivers and a separate module called '/dev/bios'.  I've
had success with '/dev/bios' which is now part of the OpenBIOS codebase.  

Here's an overview of what I found last year:

  http://www.paul.sladen.org/thinkpad-r31/wifi-card-pci-ids.html#flashing

Whilst 'dosemu' may be suitable in getting /ready/ for a flash (unpacking
etc), it's not suitable for doing the actual flash and even with some direct
hardware access, 'dosemu' would still be sitting on top of the Linux Kernel.

I really like the idea of providing a small FreeDOS partition installed by
default, the biggest challenge I can see is getting people to create the
small spare 32MB partition during install.  The second hardest part is that
usually the BIOS updates come as a Windows '.exe' that wants to create a
self-bootable floppy disk *for your* (when all you want is just the files!).

There seem to be alot of sites out there hosting BIOS collections, so it
maybe worth 'somebody' hosting an interesting site with all the
bios-image-images nice extracted and the files packages as '.deb's to
installed in the 'right' location.

The idea I /really/ like here is getting FreeDOS to run out of an 'ramdisk'
(disk-image)---as you would for a PXE network boot.  This would allow for a
completely drop-in solution needing no extra partitions and no extra
preperation.  Potentially, you could do something like:

  sudo apt-get install freedos bioses/thinkpad-1uewtu23
  sudo apt-get update-freedosfs
  sudo reboot
  (select 'FreeDOS' from Grub menu)

Which would take care of rebuilding a FAT image and then 'boot' FreeDOS from
the just-generated FAT image (with all the files/programs you've just
unpacked) upon restarting the machine.

Does anyone fancy playing to investigate how to get FreeDOS to boot with
grub from a ramdisk?  'memdisk' might be a good starting point for somebody
wanting to research this for Ubuntu!

  http://syslinux.zytor.com/memdisk.php

Although this page has an interesting comment that because of the way it is
faking the hard/floppy-disk, they might need to be enabled.

  http://blog.jwiz.org/archives/000713.html

'tdsk' also seems to be a ramdisk driver for FreeDOS and 'ltools' some ext2
read/writing commands---but nothing I've found so far like the dosemu
'lredir' setups that 'mounts' a normal filesystem.  Happy Hacking.

	-Paul
-- 
Is there no safe way to travel?  London, GB





More information about the ubuntu-devel mailing list