]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[libflat] Test A20 gate without switching to flat real mode
authorMichael Brown <mcb30@ipxe.org>
Fri, 3 Dec 2010 04:44:10 +0000 (04:44 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 3 Dec 2010 05:41:09 +0000 (05:41 +0000)
commit87723a0f11425fce10743cb31e0365a8eade4891
treebb1798b0abe0cc8cca7e83bff963ed45080f82ff
parentf14a5045d70fb0f46e8dec9bb2fe847407b0a278
[libflat] Test A20 gate without switching to flat real mode

Use the real-mode address ffff:0010 to access the linear address
0x100000, and so test whether or not the A20 gate is enabled without
requiring a switch into flat real mode (or some other addressing
mode).

This speeds up CPU mode transitions, and also avoids breaking the NBP
from IBM's Tivoli Provisioning Manager for Operating System
Deployment.  This NBP makes some calls to iPXE in VM86 mode rather
than true real mode and does not correctly emulate our transition into
flat real mode.

Interestingly, Tivoli's VMM *does* allow us to switch into protected
mode (though it patches our GDT so that we execute in ring 1 rather
than ring 0).  However, paging is still disabled and we have a 4GB
segment limit.  Being in ring 1 does not, therefore, restrict us in
any meaningful way; this has been verified by deliberately writing
garbage over Tivoli's own GDT (at address 0x02201010) during a
nominally VM86-mode PXE API call.  It's unclear precisely what
protection this VMM is supposed to be offering.

Suggested-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/transitions/libflat.S