mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
810f49b56a
commit
d0652aa8ac
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue