aboutsummaryrefslogtreecommitdiff
path: root/linuxboot.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-05-21 16:40:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-05-21 16:42:22 +0200
commit20b9dd75c8525003bd53243f52766dde9daace46 (patch)
tree246c74ad4f66ce3ca7156aed9c04c03fadfaac29 /linuxboot.c
parent42e45cad86416e5ca78c3f07711d1ae71827748c (diff)
downloadqboot-20b9dd75c8525003bd53243f52766dde9daace46.zip
qboot-20b9dd75c8525003bd53243f52766dde9daace46.tar.gz
qboot-20b9dd75c8525003bd53243f52766dde9daace46.tar.bz2
add a 16-bit data segment
Otherwise the real mode data segments keep G=D=1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'linuxboot.c')
-rw-r--r--linuxboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linuxboot.c b/linuxboot.c
index cc64811..9671fd7 100644
--- a/linuxboot.c
+++ b/linuxboot.c
@@ -130,7 +130,9 @@ void boot_bzimage(struct linuxboot_args *args)
*/
asm("pm16_boot_linux:"
".code16;"
- "mov $0, %eax; mov %eax, %cr0;"
+ "mov $0x20, %ax; mov %ax, %ds; mov %ax, %es;"
+ "mov %ax, %fs; mov %ax, %gs; mov %ax, %ss;"
+ "xor %eax, %eax; mov %eax, %cr0;"
"ljmpl $0xf000, $(1f - 0xf0000); 1:"
"mov %bx, %ds; mov %bx, %es;"
"mov %bx, %fs; mov %bx, %gs; mov %bx, %ss;"