[SeaBIOS] [PATCH] Boot from multiple USB drives as well as an HDD

Kevin O'Connor kevin at koconnor.net
Fri Jun 8 02:19:38 CEST 2012


On Thu, Jun 07, 2012 at 01:58:06PM -0600, Steve Goodrich wrote:
> This change adds support for multiple USB mass storage devices in the boot
> sequence.  Previously, only one HDD device (which included both USB and SATA
> drives) was allowed in the boot sequence; USB drives were treated as HDDs.
> This code allows USB drives to be treated separately from SATA drives.  Only
> one HDD is allowed to boot (0x80) as has always been the case.  However,
> multiple USB drives can be tried in the order they are selected in the
> Bootlist.

I don't understand how this works.  The problem with HD booting from
anything other than 0x80 is that boot loaders don't know which hard
drive to boot from, so they always try drive 0x80.  Since USB images
use the same boot loaders as hard drives, I don't see how your patch
works.

[...]
> @@ -655,11 +674,15 @@ do_boot(int seq_nr)
>          break;
>      case IPL_TYPE_HARDDISK:
>          printf("Booting from Hard Disk...\n");
> -        boot_disk(0x80, 1);
> +        boot_disk(EXTSTART_HD, 1);
>          break;
>      case IPL_TYPE_CDROM:
>          boot_cdrom((void*)ie->vector);
>          break;

In the above, CDROMs can boot from any drive because the CD booting
spec (El-Torito) clearly states the boot loader must use the drive
specified in the dl register.

> +    case IPL_TYPE_USB:
> +        printf("Booting from USB drive...\n");
> +        boot_disk(EXTSTART_USB + USB_Drive_Number++, 1);
> +        break;

This will set the 'dl' register to something (eg, 0xc0), but we can't
be sure the boot loader will honor it.  So, as far as I understand,
this wont work.  What images did you test with?

-Kevin



More information about the SeaBIOS mailing list