* [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19
@ 2011-01-31 13:11 Gleb Natapov
2011-01-31 16:33 ` Alexander Graf
2011-03-22 6:05 ` Aurelien Jarno
0 siblings, 2 replies; 3+ messages in thread
From: Gleb Natapov @ 2011-01-31 13:11 UTC (permalink / raw)
To: qemu-devel
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>
---
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.
v1->v2:
- change PRODUCT to BOOT_ROM_PRODUCT
- move pnp header from OPTION_ROM_START to BOOT_ROM_START
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index c109363..748c831 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -22,6 +22,8 @@
#include "optionrom.h"
+#define BOOT_ROM_PRODUCT "Linux loader"
+
BOOT_ROM_START
run_linuxboot:
diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
index 9131837..cc5ca1b 100644
--- a/pc-bios/optionrom/multiboot.S
+++ b/pc-bios/optionrom/multiboot.S
@@ -20,6 +20,8 @@
#include "optionrom.h"
+#define BOOT_ROM_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..aa783de 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -97,22 +97,28 @@
#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;
@@ -122,5 +128,9 @@
_end:
#define BOOT_ROM_END \
+ _manufacturer:; \
+ .asciz "QEMU"; \
+ _product:; \
+ .asciz BOOT_ROM_PRODUCT; \
OPTION_ROM_END
--
Gleb.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19
2011-01-31 13:11 [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19 Gleb Natapov
@ 2011-01-31 16:33 ` Alexander Graf
2011-03-22 6:05 ` Aurelien Jarno
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2011-01-31 16:33 UTC (permalink / raw)
To: Gleb Natapov; +Cc: qemu-devel
On 31.01.2011, at 14:11, 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.
No idea about the bev standard, but the rest looks good :)
Acked-by: Alexander Graf <agraf@suse.de>
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19
2011-01-31 13:11 [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19 Gleb Natapov
2011-01-31 16:33 ` Alexander Graf
@ 2011-03-22 6:05 ` Aurelien Jarno
1 sibling, 0 replies; 3+ messages in thread
From: Aurelien Jarno @ 2011-03-22 6:05 UTC (permalink / raw)
To: Gleb Natapov; +Cc: qemu-devel
On Mon, Jan 31, 2011 at 03:11:01PM +0200, 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 <gleb@redhat.com>
> ---
>
> 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.
>
> v1->v2:
> - change PRODUCT to BOOT_ROM_PRODUCT
> - move pnp header from OPTION_ROM_START to BOOT_ROM_START
Thanks, applied.
> diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
> index c109363..748c831 100644
> --- a/pc-bios/optionrom/linuxboot.S
> +++ b/pc-bios/optionrom/linuxboot.S
> @@ -22,6 +22,8 @@
>
> #include "optionrom.h"
>
> +#define BOOT_ROM_PRODUCT "Linux loader"
> +
> BOOT_ROM_START
>
> run_linuxboot:
> diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
> index 9131837..cc5ca1b 100644
> --- a/pc-bios/optionrom/multiboot.S
> +++ b/pc-bios/optionrom/multiboot.S
> @@ -20,6 +20,8 @@
>
> #include "optionrom.h"
>
> +#define BOOT_ROM_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..aa783de 100644
> --- a/pc-bios/optionrom/optionrom.h
> +++ b/pc-bios/optionrom/optionrom.h
> @@ -97,22 +97,28 @@
>
> #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;
> @@ -122,5 +128,9 @@
> _end:
>
> #define BOOT_ROM_END \
> + _manufacturer:; \
> + .asciz "QEMU"; \
> + _product:; \
> + .asciz BOOT_ROM_PRODUCT; \
> OPTION_ROM_END
>
> --
> Gleb.
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-22 6:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 13:11 [Qemu-devel] [PATCHv2] fix linuxboot.bin and multiboot.bin to not hijack int19 Gleb Natapov
2011-01-31 16:33 ` Alexander Graf
2011-03-22 6:05 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).