fix linuxboot.bin and multiboot.bin to not hijack int19
authorGleb Natapov <gleb@redhat.com>
Mon, 31 Jan 2011 13:11:01 +0000 (15:11 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 22 Mar 2011 06:00:58 +0000 (07:00 +0100)
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 <gleb@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc-bios/optionrom/linuxboot.S
pc-bios/optionrom/multiboot.S
pc-bios/optionrom/optionrom.h

index c10936344dd887106cd28e24357cd9055d43a759..748c831160983dd711284f7af33803b6d0f07e07 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "optionrom.h"
 
+#define BOOT_ROM_PRODUCT "Linux loader"
+
 BOOT_ROM_START
 
 run_linuxboot:
index 913183739cee764cec43ad24f6ae77fe2fb97d65..cc5ca1b7d178254afef18ce324942f155bbaac24 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "optionrom.h"
 
+#define BOOT_ROM_PRODUCT "multiboot loader"
+
 #define MULTIBOOT_MAGIC                0x2badb002
 
 #define GS_PROT_JUMP           0
index fbdd48a021352042586618118f742e9213acfd69..aa783deed10ecacb39ecae2d1bd2b2f6dcadde13 100644 (file)
 
 #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:;                                    \
+       .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;           \
+    _bev:;                                             \
        /* DS = CS */                                   \
        movw            %cs, %ax;                       \
        movw            %ax, %ds;
     _end:
 
 #define BOOT_ROM_END                                   \
+    _manufacturer:;                                    \
+       .asciz "QEMU";                                  \
+    _product:;                                         \
+       .asciz BOOT_ROM_PRODUCT;                        \
        OPTION_ROM_END