mirror of https://github.com/xqemu/xqemu.git
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>
This commit is contained in:
parent
d46272c774
commit
36ecd7c016
|
@ -79,24 +79,20 @@ copy_kernel:
|
||||||
mode, so let's get into 32 bit mode, write the kernel and jump
|
mode, so let's get into 32 bit mode, write the kernel and jump
|
||||||
back again. */
|
back again. */
|
||||||
|
|
||||||
/* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */
|
/* Reserve space on the stack for our GDT descriptor. */
|
||||||
mov %ss, %eax
|
mov %esp, %ebp
|
||||||
shl $4, %eax
|
sub $16, %esp
|
||||||
add %esp, %eax
|
|
||||||
sub $0x10, %eax
|
|
||||||
shr $4, %eax
|
|
||||||
|
|
||||||
/* Now create the GDT descriptor */
|
/* Now create the GDT descriptor */
|
||||||
|
movw $((3 * 8) - 1), -16(%bp)
|
||||||
mov %cs, %eax
|
mov %cs, %eax
|
||||||
shl $4, %eax
|
shl $4, %eax
|
||||||
movw $((3 * 8) - 1), %bx
|
addl $gdt, %ebx
|
||||||
movw %bx, %gs:0
|
movl %ebx, -14(%bp)
|
||||||
movl $gdt, %ebx
|
|
||||||
add %eax, %ebx
|
|
||||||
movl %ebx, %gs:2
|
|
||||||
|
|
||||||
/* And load the GDT */
|
/* And load the GDT */
|
||||||
data32 lgdt %gs:0
|
data32 lgdt -16(%bp)
|
||||||
|
mov %ebp, %esp
|
||||||
|
|
||||||
/* Get us to protected mode now */
|
/* Get us to protected mode now */
|
||||||
mov $1, %eax
|
mov $1, %eax
|
||||||
|
|
Loading…
Reference in New Issue