From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: PATCH: Add QEMU BIOS menu for choosing boot device Date: Wed, 02 Jan 2008 15:22:08 +0000 Message-ID: <477BAC20.3090808@citrix.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000402000303060507030804" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel@lists.xensource.com Cc: katzj@redhat.com, keir.fraser@citrix.com, berrange@redhat.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000402000303060507030804 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 > 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 > CC: Jeremy Katz > --------------000402000303060507030804 Content-Type: text/x-patch; name="xen-qemu-bootmenu-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-qemu-bootmenu-fix.patch" 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; clearscreen(); 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: break; case 0x44: - scan = bootmenu(inb_cmos(0x3d)); + scan = bootmenu(inb_cmos(0x3d) & 0x0f); break; default: scan = 0; --------------000402000303060507030804 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000402000303060507030804--