summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix/libprefix.S
diff options
context:
space:
mode:
authorMichael Brown2010-04-19 22:53:36 +0200
committerMichael Brown2010-04-20 00:43:48 +0200
commitcb430568096410e148645a018268be3d5d5464d2 (patch)
tree634d03174b4cce4688b135a55d87f4881652ad6b /src/arch/i386/prefix/libprefix.S
parent[romprefix] Remove .hrom prefix (diff)
downloadipxe-cb430568096410e148645a018268be3d5d5464d2.tar.gz
ipxe-cb430568096410e148645a018268be3d5d5464d2.tar.xz
ipxe-cb430568096410e148645a018268be3d5d5464d2.zip
[prefix] Use flat real mode instead of real mode
When returning to real mode, set 4GB segment limits instead of 64kB limits. This change improves our chances of successfully returning to a PMM-capable BIOS aftering entering iPXE during POST; the BIOS will have set up flat real mode before calling our initialisation point, and may be disconcerted if we then return in genuine real mode. This change is unlikely to break anything, since any code that might potentially access beyond 64kB must use addr32 prefixes to do so; if this is the case then it is almost certainly code written to expect flat real mode anyway. Note that it is not possible to restore the real-mode segment limits to their original values, since it is not possible to know which protected-mode segment descriptor was originally used to initialise the limit portion of the segment register. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/prefix/libprefix.S')
-rw-r--r--src/arch/i386/prefix/libprefix.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index 9e6ba6f0..ecef56d8 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -263,14 +263,14 @@ gdt:
gdt_limit: .word gdt_length - 1
gdt_base: .long 0
.word 0 /* padding */
-pm_cs: /* 16-bit protected-mode code segment */
+pm_cs: /* 16-bit protected-mode flat code segment */
.equ PM_CS, pm_cs - gdt
.word 0xffff, 0
- .byte 0, 0x9b, 0x00, 0
-pm_ss: /* 16-bit protected-mode stack segment */
+ .byte 0, 0x9b, 0x8f, 0
+pm_ss: /* 16-bit protected-mode flat stack segment */
.equ PM_SS, pm_ss - gdt
.word 0xffff, 0
- .byte 0, 0x93, 0x00, 0
+ .byte 0, 0x93, 0x8f, 0
pm_ds: /* 32-bit protected-mode flat data segment */
.equ PM_DS, pm_ds - gdt
.word 0xffff, 0