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.
a20 required?
a20 required?
Author of COBOS
Hi,
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
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).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.
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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
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 plusBrendan 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.
Author of COBOS