]> git.proxmox.com Git - qemu.git/commitdiff
Fix thinko in linuxboot.S
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 13 Dec 2009 10:36:40 +0000 (11:36 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 18 Dec 2009 17:26:26 +0000 (11:26 -0600)
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>
pc-bios/optionrom/linuxboot.S

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