From 20b9dd75c8525003bd53243f52766dde9daace46 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 21 May 2015 16:40:24 +0200 Subject: add a 16-bit data segment Otherwise the real mode data segments keep G=D=1. Signed-off-by: Paolo Bonzini --- linuxboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linuxboot.c') 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;" -- cgit v1.1