From 24707f10f3ad0f26bc7144e3a2f3371ba9c377f3 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Wed, 2 May 2018 19:52:51 +0300 Subject: [PATCH] fixed int86 not setting segment registers --- Makefile | 4 ++-- src/boot/boot2.s | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 23c8eaf..fb282f3 100644 --- a/Makefile +++ b/Makefile @@ -71,11 +71,11 @@ $(elf).sym: $(elf) .PHONY: run run: $(bin) - qemu-system-i386 -fda floppy.img -serial file:serial.log + qemu-system-i386 -fda floppy.img -serial file:serial.log -vga std .PHONY: debug debug: $(bin) $(elf).sym - qemu-system-i386 -fda floppy.img -serial file:serial.log -s -S + qemu-system-i386 -fda floppy.img -serial file:serial.log -vga std -s -S .PHONY: sym sym: $(elf).sym diff --git a/src/boot/boot2.s b/src/boot/boot2.s index 7470aef..f2aab01 100644 --- a/src/boot/boot2.s +++ b/src/boot/boot2.s @@ -803,6 +803,10 @@ int86: mov %ebp, saved_ebp mov 12(%ebp), %esp popal + popfw + pop %es + pop %ds + # ignore fs and gs for now, don't think I'm going to need them mov saved_esp, %esp # call 16bit interrupt @@ -810,7 +814,9 @@ int_op: int $0 mov saved_ebp, %ebp mov 12(%ebp), %esp - add $34, %esp + add $38, %esp + push %ds + push %es pushfw pushal mov saved_esp, %esp -- 1.7.10.4