A20: after or before pmode?
A20: after or before pmode?
Can i enable a20 and remap pic interrupts AFTER switching to pmode without having any problems?
Re:A20: after or before pmode?
thanks! just to make sure. i read somewhere that i could have some problems 

Re:A20: after or before pmode?
Yes. All the A20 does is either force a 0 asthe 21st bit in the address, or leave it be. Thus, with the A20 disabled, you can access even memory addresses (0MB-1MB; 2MB-3MB; 4MB-5MB, etc.).
In fact, you don't even need to enable the A20 (But you'll only have have the 4GB address space).
Chris
In fact, you don't even need to enable the A20 (But you'll only have have the 4GB address space).
Chris
Re:A20: after or before pmode?
So, whats the problem?In fact, you don't even need to enable the A20 (But you'll only have have the 4GB address space).
Re:A20: after or before pmode?
"Only the 4GB address space?" What, enabling A20 gives you access to more than 4GB of memory? 

Re:A20: after or before pmode?

- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:A20: after or before pmode?
gee. that A20 stuff is definitely the oddest stuff in my PC !!
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:A20: after or before pmode?
something that can be tested from anywhere is to check wether 00000000 and 00100000 are identical or not (if you're still in real mode, use 0xffff:0010 to access 00100000
)
cli
mov gs,ZERO_BASED_DATA_SEGMENT
mov eax,[gs:00100000]
mov ebx,[gs:00000000]
cmp eax, ebx
jne A20_Enabled
mov [gs:00100000],12345678
cmp [gs:00000000],12345678
jne A20_Enabled
mov [gs:000000],eax
mov eax,DISABLED
sti
ret
A20_ENABLED:
mov [gs:000000],eax
mov eax,ENABLED
sti
ret

cli
mov gs,ZERO_BASED_DATA_SEGMENT
mov eax,[gs:00100000]
mov ebx,[gs:00000000]
cmp eax, ebx
jne A20_Enabled
mov [gs:00100000],12345678
cmp [gs:00000000],12345678
jne A20_Enabled
mov [gs:000000],eax
mov eax,DISABLED
sti
ret
A20_ENABLED:
mov [gs:000000],eax
mov eax,ENABLED
sti
ret
Re:A20: after or before pmode?
great. thanks, i'll do that.
anyway, i'd still like to know if something like this is available directly from bochs
just curious...
anyway, i'd still like to know if something like this is available directly from bochs

just curious...
Re:A20: after or before pmode?
Heh...I ment only on my previous post.
The reason for the A20 when they "broke" the 1MB limit, they found out that alot of software didn't work. It turns out that alot of system software relied on the fact that the processor would "wrap-around" at the 1MB limit. Thus, they needed a way to turn off and on this wrap-around quirk.
The reason for the A20 when they "broke" the 1MB limit, they found out that alot of software didn't work. It turns out that alot of system software relied on the fact that the processor would "wrap-around" at the 1MB limit. Thus, they needed a way to turn off and on this wrap-around quirk.