All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fix linuxboot.bin and multiboot.bin to not hijack int19
Date: Mon, 31 Jan 2011 13:50:17 +0200	[thread overview]
Message-ID: <20110131115017.GX14750@redhat.com> (raw)
In-Reply-To: <74F5EE10-5F10-4533-A980-68A7B8F00991@suse.de>

On Mon, Jan 31, 2011 at 12:41:46PM +0100, Alexander Graf wrote:
> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> The idea behind the OPTION_ROM and BOOT_ROM split was to have a generic header that can be used as template for random option roms or boot roms alike. Your patch munges those two use-cases together by providing bev logic in the generic option rom part.
> 
> Please split it out into the BOOT_ROM macro, or - if necessary - create a new macro.
> 
> 
Like this?

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..2d4f40e 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -97,27 +97,37 @@
 
 #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;
 
 #define OPTION_ROM_END					\
+    _manufacturer:;					\
+        .asciz "QEMU";					\
+    _product:;						\
+        .asciz PRODUCT;					\
     .align 512, 0;					\
     _end:
 
--
			Gleb.

  reply	other threads:[~2011-01-31 11:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31  9:02 [Qemu-devel] [PATCH] fix linuxboot.bin and multiboot.bin to not hijack int19 Gleb Natapov
2011-01-31 11:41 ` Alexander Graf
2011-01-31 11:50   ` Gleb Natapov [this message]
2011-01-31 11:53     ` Alexander Graf
2011-02-01 23:02 ` Anthony Liguori
2011-02-02  5:06   ` Gleb Natapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110131115017.GX14750@redhat.com \
    --to=gleb@redhat.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.