Page 1 of 1
A20
Posted: Tue May 23, 2006 5:10 pm
by Ryu
Okay, after a day of hair pulling, usual coffee slurping, and debugging the unbugged, I realised that somehow in protected mode I was getting address wrap around effects, and at the time it never occurred to me that this was the A20, which I thought entering 32bit protected mode would enable this line automatically. So for you people who don't know, I hope to save you that whole day of utterly nonsense I went through. >:(
I am wondering now, should the BIOS INT 15, AX=2401 be sufficient (pentiums and up) or should I have this long messy code of trying to enable A20 line using keyboard controller and etc.
Re:A20
Posted: Tue May 23, 2006 5:21 pm
by paulbarker
In theory the BIOS function should be sufficient, but A20 gates are generally a nightmare. I would try about 4 of the most common methods (starting with the BIOS call) in a loop of 3 re-tries. If this fails, I would print a message to the screen and give up.
An alternative approach is to just do the BIOS call, comment the code well and test the A20 gate once it has been (in theory) set. If any user tells you about problems, then add alternative methods.
Re:A20
Posted: Tue May 23, 2006 5:23 pm
by blip
I implemented most if not everything
from here. On my testbed laptop I found that if there are multiple sources, they are ORed together and the result is then ANDed with A20. Later confirmed this behavior with a document I read. Funny thing since after a warm boot HIMEM found it couldn't disable A20 because it didn't try every source. It's not that bad to implement really since you only have to write the code once.
Re:A20
Posted: Tue May 23, 2006 5:35 pm
by Ryu
Okay I guess its not a good time to take the easy way out, I'll use that page as a guide. Thanks for your replies.
Re:A20
Posted: Tue May 23, 2006 8:31 pm
by Brendan
Hi,
You might find my "enable A20" code useful:
http://bcos.hopto.org/latest/sys/i386/b ... tea20.html
It's "well commented", and works on everything I've tried it on...
Cheers,
Brendan
Re:A20
Posted: Wed May 24, 2006 7:19 am
by Ryu
Ah thanks Brendan, I was using yours last night which summed it up quite nicely. I've also found out that, on my machine and its fairly not that old does not support the BIOS service to enable A20 line, which I found that really odd, so these steps are pretty necessary.
Re:A20
Posted: Wed May 24, 2006 8:04 am
by crackers
Since we're on this topic... about one or two months ago I was fighting with A20 and go to conclusion that A20 is sometimes enabled. For example on Bochs it's enabled, but on VMware it's not. I've checked it on my real computer (AMD) and was little schocked because A20 was enabled. My guess is that some BIOSes enable it before calling bootloader and some not.
Re:A20
Posted: Wed May 24, 2006 8:39 am
by Pype.Clicker
crackers wrote:
My guess is that some BIOSes enable it before calling bootloader and some not.
Exactly. Some even have an option in the BIOS control menu saying "Enable A20 Gate ?"
Re:A20
Posted: Wed May 24, 2006 11:09 am
by mystran
Some of them might also have some other option that essentially does the same but is named something more "userfriendly".