From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NARF7-0003BB-3T for qemu-devel@nongnu.org; Tue, 17 Nov 2009 11:49:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NARF2-00030Z-3p for qemu-devel@nongnu.org; Tue, 17 Nov 2009 11:49:24 -0500 Received: from [199.232.76.173] (port=38487 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NARF1-00030Q-Vp for qemu-devel@nongnu.org; Tue, 17 Nov 2009 11:49:20 -0500 Received: from cantor.suse.de ([195.135.220.2]:46960 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NARF1-0002i1-Iz for qemu-devel@nongnu.org; Tue, 17 Nov 2009 11:49:19 -0500 From: Alexander Graf Date: Tue, 17 Nov 2009 17:49:16 +0100 Message-Id: <1258476556-32472-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Make -kernel for linux work with bochsbios List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org While trying to run -kernel with -bios pc-bios/pcbios.bin, I realized that I was actually writing data to %es, but only set up %ds to a 32-bit segment we want to write to. So at the end of the day the data hasn't actually been copied. Oops. So here's a fix to set ES instead of DS, which makes -kernel work with BOCHS bios again (and actually makes the code do the correct thing)! Signed-off-by: Alexander Graf --- pc-bios/optionrom/linuxboot.S | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S index 08c1ca6..ecd9cf2 100644 --- a/pc-bios/optionrom/linuxboot.S +++ b/pc-bios/optionrom/linuxboot.S @@ -102,11 +102,11 @@ copy_kernel: mov $1, %eax mov %eax, %cr0 - /* So we can set DS to a 32-bit segment */ + /* So we can set ES to a 32-bit segment */ mov $0x10, %eax - mov %eax, %ds + mov %eax, %es - /* We're now running in 16-bit CS, but 32-bit DS! */ + /* We're now running in 16-bit CS, but 32-bit ES! */ /* Load kernel and initrd */ read_fw_blob(FW_CFG_KERNEL) @@ -118,9 +118,9 @@ copy_kernel: mov $0, %eax mov %eax, %cr0 - /* DS = CS */ + /* ES = CS */ mov %cs, %ax - mov %ax, %ds + mov %ax, %es jmp boot_kernel -- 1.6.0.2