aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/system.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/system.c b/src/system.c
index f3031af..898c3cc 100644
--- a/src/system.c
+++ b/src/system.c
@@ -143,6 +143,11 @@ handle_1587(struct bregs *regs)
" xorw %%di, %%di\n"
" rep movsw\n"
+ // Restore DS and ES segment limits to 0xffff
+ " movw $(5<<3), %%ax\n" // 5th descriptor in table (SS)
+ " movw %%ax, %%ds\n"
+ " movw %%ax, %%es\n"
+
// Disable protected mode
" movl %%cr0, %%eax\n"
" andl $~" __stringify(CR0_PE) ", %%eax\n"