projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11cc662
)
Restore segment limits in handle_1589 code.
author
Kevin O'Connor
<kevin@koconnor.net>
Mon, 15 Mar 2010 23:58:55 +0000
(19:58 -0400)
committer
Kevin O'Connor
<kevin@koconnor.net>
Mon, 15 Mar 2010 23:58:55 +0000
(19:58 -0400)
Before transitioning back to real mode, the segment registers should
be reloaded so that the hidden register limits are updated.
src/system.c
patch
|
blob
|
history
diff --git
a/src/system.c
b/src/system.c
index f3031af12e721a597e73be654ec2d185ace79f89..898c3ccc9f6c86b52af3ea6b11455e533a872254 100644
(file)
--- 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"