[SeaBIOS] [PATCH] create separate IPL entry for each CD/DVD

Kevin O'Connor kevin at koconnor.net
Tue Dec 7 01:53:27 CET 2010


On Mon, Dec 06, 2010 at 03:41:05PM +0200, Gleb Natapov wrote:
> Current code creates only one IPL entry of type IPL_TYPE_CDROM even if
> there are more then one CDROM drive present. If CDROM that the entry
> refers to is not bootable there is no way to retry boot from another
> CDROM. Fix this by creating IPL entry for each CDROM drive found. First
> CDROM will always be placed in IPL entry 3 for backwards compatibility.
[...]
> +    /* put first cdrom into ipl 3 for compatability with qemu */
> +    struct ipl_entry_s *ie = &IPL.bev[2];
> +    if (IPL.bevcount >= ARRAY_SIZE(IPL.bev) && ie->vector)
> +        return;

That's pretty ugly - though I don't have a better suggestion.

[...]
> @@ -399,9 +417,14 @@ boot_cdrom(struct ipl_entry_s *ie)
>  {
>      if (! CONFIG_CDROM_BOOT)
>          return;
> -    int status = cdrom_boot(ie->subchoice);
> +
> +    if (!ie->vector)
> +        return;
> +
> +    struct drive_s *drive_g = GLOBALFLAT2GLOBAL((void*)ie->vector);

FYI - this code is always run in 32bit mode, so you don't need
GLOBALFLAT2GLOBAL().

The patch looks okay to me.
-Kevin



More information about the SeaBIOS mailing list