A20 Line: Difference between revisions

[unchecked revision][unchecked revision]
No edit summary
Line 16:
Before enabling the A20 with any of the methods described below it better to test whether the A20 address line is already enabled by the [[BIOS]]. This can be achieved by comparing, at boot time in real mode, the bootsector identifier (0xAA55) located at address 0000:7DFE with the value 1 MiB higher which is at address FFFF:7E0E. When the two values are different it means that the A20 is already enabled otherwise if the values are identical it must be ruled out that this is not by mere chance. Therefore the bootsector identifier needs to be changed, for instance by rotating it left by 8 bits, and again compared to the 16 bits word at FFFF:7E0E. When they are still the same then the A20 address line is disabled otherwise it is enabled. Don't forget to restore the original bootsector identifier.
 
The following code performs a check (not like described above -- more directly):
<pre>
; The following code is public domain licenced
5

edits