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.
A20
Re:A20
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.
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
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
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
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
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.
Re:A20
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.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:A20
Exactly. Some even have an option in the BIOS control menu saying "Enable A20 Gate ?"crackers wrote: My guess is that some BIOSes enable it before calling bootloader and some not.