Page 1 of 1
a20 required?
Posted: Wed Feb 28, 2007 4:58 am
by os64dev
I am wondering if it is required to enable the a20 address line when switching to long mode, i have tested with the a20 address line disabled and it seems to work but i am not sure it will work on all the x64 architectures. Anybody know for sure?
My OS bootsector loads the bootloader and switches from realmode to longmode(64-bit) without switching to protected mode first. The boot loader will be executing below the 1 MiB, so it does not require the a20 to be set, preparing the PC for the kernel and enabling the a20 address line so the kernel can use the memory above 1 MiB and clear the memory below 1 MiB.
Posted: Wed Feb 28, 2007 10:00 am
by Dex
I have also entered long mode, on differant 64bit PC, without enabling A20 line, without a problem, these have only been simple "hello world" test progs to test going to long mode.
Posted: Wed Feb 28, 2007 7:25 pm
by Tyler
I am pretty sure (please check though) that i saw somewhere that all EM64T intels have the A20 Mask disabled by default. It may have been an intel chipset thing though so anyway i would still check to be sure.
Posted: Wed Feb 28, 2007 7:43 pm
by Brendan
Hi,
Tyler wrote:I am pretty sure (please check though) that i saw somewhere that all EM64T intels have the A20 Mask disabled by default. It may have been an intel chipset thing though so anyway i would still check to be sure.
I would expect this depends on the BIOS rather than the chipset - just because the chipset disables A20 mask by default doesn't mean the BIOS leaves it disabled (and if the chipset enables the A20 mask by default the BIOS could disable it).
As for the original question, I have no idea - my real mode boot code is generic (same code used for all 80486 and later CPUs regardless of which kernel will be used) and always checks if A20 is enabled or not and tries to enable A20 if it's not already. This is relatively easy to do, even if the OS is 64-bit only.
Cheers,
Brendan
Posted: Wed Feb 28, 2007 10:36 pm
by os64dev
Brendan wrote:As for the original question, I have no idea - my real mode boot code is generic (same code used for all 80486 and later CPUs regardless of which kernel will be used) and always checks if A20 is enabled or not and tries to enable A20 if it's not already. This is relatively easy to do, even if the OS is 64-bit only.
I have already written the a20 enabler, which tries 5 different methods and after each try checks whether the a20 was successfully enabled or not. I was curious if it was really needed at such an early stage, if i can remove it then my bootsector needs only 512 bytes instead of 1024. If i enable the a20 when in 64-bit then i only have 4 methods (BIOS is not available) and i can write it in C/C++ which for me is a plus