[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] PATCH: Add QEMU BIOS menu for choosing boot device

If more than one boot device has been selected, the currently selected
number displayed in the menu is wrong.
The tiny patch I am attaching makes sure that only the first boot device
is considered.
The patch has to be applied on top of the original patch.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>

> The attached patch implements a mini BIOS menu for choosing a
> non-default boot device. When a guest starts it'll display 
>    'Press F10 to select boot device'
> And wait 3 seconds, before continuing with the normal boot device. If
> they press the F10 key, a menu is shown allowing a choice between
> floppy, harddisk, cdrom and network (PXE).
> I can't take credit for this originally - Jeremy Katz wrote it for KVM,
> I merely re-diffed the patch to work against Xen's QEMU/BIOS code tree.
> It has been tested in Fedora successfully against 3.1.x and 3.2.x
>    Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
>    CC: Jeremy Katz <katzj@xxxxxxxxxx>

diff -r 4b278d3fc565 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c  Wed Jan 02 15:06:13 2008 +0000
+++ b/tools/firmware/rombios/rombios.c  Wed Jan 02 15:07:22 2008 +0000
@@ -2146,6 +2146,7 @@ int bootmenu(selected)
     max = read_word(IPL_SEG, IPL_COUNT_OFFSET);
     for(;;) {
+        if (selected > max || selected < 1) selected = 1;
         bios_printf(BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO, "\n\n\n\n\n\n\n");
         bios_printf(BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO, "          Select 
boot device\n\n");
@@ -2223,7 +2224,7 @@ void interactive_bootkey()
         case 0x58:
         case 0x44:
-            scan = bootmenu(inb_cmos(0x3d));
+            scan = bootmenu(inb_cmos(0x3d) & 0x0f);
             scan = 0;
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.