From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45185 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkPFU-0006BH-3y for qemu-devel@nongnu.org; Tue, 01 Feb 2011 18:03:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkPFS-0008UC-2Q for qemu-devel@nongnu.org; Tue, 01 Feb 2011 18:02:59 -0500 Received: from mail-iw0-f173.google.com ([209.85.214.173]:64690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkPFR-0008U5-UT for qemu-devel@nongnu.org; Tue, 01 Feb 2011 18:02:58 -0500 Received: by iwc10 with SMTP id 10so477235iwc.4 for ; Tue, 01 Feb 2011 15:02:57 -0800 (PST) Message-ID: <4D48911F.2060802@codemonkey.ws> Date: Tue, 01 Feb 2011 17:02:55 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] fix linuxboot.bin and multiboot.bin to not hijack int19 References: <20110131090247.GT14750@redhat.com> In-Reply-To: <20110131090247.GT14750@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On 01/31/2011 03:02 AM, Gleb Natapov wrote: > Currently linuxboot.bin and multiboot.bin option roms override int19 > vector to intercept boot process. No sane option rom should do that. > Provide bev entry instead that will be called by BIOS if option rom > is selected for booting. > > Signed-off-by: Gleb Natapov > --- > > Note that this patch should be applied after qemu will upgrade to Seabios > that supports boot order. Otherwise there will be change in behavior > since option rom will not be selected for booting by default. > I don't think there's a SeaBIOS release yet that includes the boot order support. Regards, Anthony Liguori > diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S > index c109363..79b3ae8 100644 > --- a/pc-bios/optionrom/linuxboot.S > +++ b/pc-bios/optionrom/linuxboot.S > @@ -22,6 +22,8 @@ > > #include "optionrom.h" > > +#define PRODUCT "Linux loader" > + > BOOT_ROM_START > > run_linuxboot: > diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S > index 9131837..069c4e8 100644 > --- a/pc-bios/optionrom/multiboot.S > +++ b/pc-bios/optionrom/multiboot.S > @@ -20,6 +20,8 @@ > > #include "optionrom.h" > > +#define PRODUCT "multiboot loader" > + > #define MULTIBOOT_MAGIC 0x2badb002 > > #define GS_PROT_JUMP 0 > diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h > index fbdd48a..95dbdda 100644 > --- a/pc-bios/optionrom/optionrom.h > +++ b/pc-bios/optionrom/optionrom.h > @@ -93,31 +93,41 @@ > .global _start; \ > _start:; \ > .short 0xaa55; \ > - .byte (_end - _start) / 512; > + .byte (_end - _start) / 512; \ > + lret; \ > + .org 0x18; \ > + .short 0; \ > + .short _pnph; \ > + _pnph: \ > + .ascii "$PnP"; \ > + .byte 0x01; \ > + .byte ( _pnph_len / 16 ); \ > + .short 0x0000; \ > + .byte 0x00; \ > + .byte 0x00; \ > + .long 0x00000000; \ > + .short _manufacturer; \ > + .short _product; \ > + .long 0x00000000; \ > + .short 0x0000; \ > + .short 0x0000; \ > + .short _bev; \ > + .short 0x0000; \ > + .short 0x0000; \ > + .equ _pnph_len, . - _pnph; > > #define BOOT_ROM_START \ > OPTION_ROM_START \ > - push %eax; \ > - push %ds; \ > - \ > - /* setup ds so we can access the IVT */ \ > - xor %ax, %ax; \ > - mov %ax, %ds; \ > - \ > - /* install our int 19 handler */ \ > - movw $int19_handler, (0x19*4); \ > - mov %cs, (0x19*4+2); \ > - \ > - pop %ds; \ > - pop %eax; \ > - lret; \ > - \ > - int19_handler:; \ > + _bev:; \ > /* DS = CS */ \ > movw %cs, %ax; \ > movw %ax, %ds; > > #define OPTION_ROM_END \ > + _manufacturer:; \ > + .asciz "QEMU"; \ > + _product:; \ > + .asciz PRODUCT; \ > .align 512, 0; \ > _end: > > -- > Gleb. > >