summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-24 15:38:50 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2009-12-24 12:49:16 -0200
commit7705cf04d6acaebdfe2387310c0c05d2b95e5a4c (patch)
tree2e116952c7bbd9cb37e756e9744ed0d7a0fd6abd
parentDon't load options roms intended to be loaded by the bios in qemu (diff)
downloadqemu-kvm-7705cf04d6acaebdfe2387310c0c05d2b95e5a4c.tar.gz
qemu-kvm-7705cf04d6acaebdfe2387310c0c05d2b95e5a4c.tar.bz2
qemu-kvm-7705cf04d6acaebdfe2387310c0c05d2b95e5a4c.zip
linuxboot: fix gdt address calculation
The gdt address calculation in linuxboot.bin is broken in two ways: first it loads %cs into %eax, but that instruction leaves the high bits of %eax undefined and we did not clear them. Secondly, we completely ignore the incorrect %eax, and use the undefined %ebx instead. With these issues fixed, linuxboot works again. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--pc-bios/optionrom/linuxboot.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index c4c9109b6..8aebe51ee 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -86,9 +86,10 @@ copy_kernel:
/* Now create the GDT descriptor */
movw $((3 * 8) - 1), -16(%bp)
mov %cs, %eax
+ movzwl %ax, %eax
shl $4, %eax
- addl $gdt, %ebx
- movl %ebx, -14(%bp)
+ addl $gdt, %eax
+ movl %eax, -14(%bp)
/* And load the GDT */
data32 lgdt -16(%bp)