summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2009-12-13 11:36:40 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:20 -0600
commit00e8277b8323797e6b10325d7d0a297c0fab22f5 (patch)
treedf7f16fb8fd85648bcf1b053a79e5e75be3cf108 /pc-bios
parenttarget-i386: Fix evaluation of DR7 register (diff)
downloadqemu-kvm-00e8277b8323797e6b10325d7d0a297c0fab22f5.tar.gz
qemu-kvm-00e8277b8323797e6b10325d7d0a297c0fab22f5.tar.bz2
qemu-kvm-00e8277b8323797e6b10325d7d0a297c0fab22f5.zip
Fix thinko in linuxboot.S
The %gs segment that was used was not matching the comments. I just moved the GDT descriptor on the stack instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 36ecd7c016f682437941a54193251cbf918bef0d)
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/optionrom/linuxboot.S20
1 files changed, 8 insertions, 12 deletions
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index 7f3b1b269..c4c9109b6 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -79,24 +79,20 @@ copy_kernel:
mode, so let's get into 32 bit mode, write the kernel and jump
back again. */
- /* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */
- mov %ss, %eax
- shl $4, %eax
- add %esp, %eax
- sub $0x10, %eax
- shr $4, %eax
+ /* Reserve space on the stack for our GDT descriptor. */
+ mov %esp, %ebp
+ sub $16, %esp
/* Now create the GDT descriptor */
+ movw $((3 * 8) - 1), -16(%bp)
mov %cs, %eax
shl $4, %eax
- movw $((3 * 8) - 1), %bx
- movw %bx, %gs:0
- movl $gdt, %ebx
- add %eax, %ebx
- movl %ebx, %gs:2
+ addl $gdt, %ebx
+ movl %ebx, -14(%bp)
/* And load the GDT */
- data32 lgdt %gs:0
+ data32 lgdt -16(%bp)
+ mov %ebp, %esp
/* Get us to protected mode now */
mov $1, %eax