diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-24 15:38:50 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-08 09:58:41 -0600 |
commit | a482f16058d1502189593b86447af222d6d58c9a (patch) | |
tree | 157fa2fc7a9f34a28c0f7405b700303be521d215 /pc-bios | |
parent | 9a4115073b7398434e02d3c09e17b4314d790e1f (diff) | |
download | qemu-a482f16058d1502189593b86447af222d6d58c9a.tar.gz qemu-a482f16058d1502189593b86447af222d6d58c9a.tar.bz2 qemu-a482f16058d1502189593b86447af222d6d58c9a.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: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'pc-bios')
-rw-r--r-- | pc-bios/optionrom/linuxboot.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S index c4c9109b67..8aebe51ee5 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) |