]> git.proxmox.com Git - qemu.git/commitdiff
Make -kernel for linux work with bochsbios
authorAlexander Graf <agraf@suse.de>
Tue, 17 Nov 2009 16:49:16 +0000 (17:49 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 21:25:58 +0000 (15:25 -0600)
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 <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc-bios/optionrom/linuxboot.S

index b3c90e33ceee35b5eb8a3b8e155d1e25e2cba279..7f3b1b26941fa3871c8ea8c7b029ecaab76469b1 100644 (file)
@@ -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