Page 1 of 1

Addressing after enabling A20...

Posted: Tue Jul 29, 2003 2:22 pm
by Alexander
Hi.

As far as I know the 186 processor makes physical addresses by multiplying the segment address with 16 and add the offset. So we can access 1 MByte of memory.

Many sources on the net say that the 286 processor can access up to 16 MBytes of memory. But the address FFFFh:FFFFh would result in 10FFEFh.

May it be that after enabling the A20 gate the way the processor makes physical addresses changes (i.e. to phys addr = segment * 10000h + offset), so that accessing 16 MBytes is possible?

Re:Addressing after enabling A20...

Posted: Tue Jul 29, 2003 2:38 pm
by bkilgore
Enabling the A20 line doesn't change the way addresses are computed, it just allows you to access more memory before a wrap-around takes place. Normally, accessing 10000h and higher would result in a wrap-around back to 0, so 10000h is the same as 0.

Enabling the A20 prevents this from happening, allowing you to reference the actual memory at 10001h.

However, to truly take advantage of all of this extra memory, you need to go into protected mode, where you can access the full 4gb address space. Otherwise, you can only access the first 10FFEFh bytes, as you noted.

Re:Addressing after enabling A20...

Posted: Wed Jul 30, 2003 5:29 am
by mystran
286 has a protected mode like 386, which allows it to access that 16 MB of memory. The mode is 16-bits though IIRC, so you still can't address it with one linear address.

Anyhow.. I never bothered to look up any information of this mode, so I can't really help you other than tell that such a mode exists.

Re:Addressing after enabling A20...

Posted: Wed Jul 30, 2003 5:34 am
by Pype.Clicker
@mystran: true. What is actually availble from 286 pmode is a system where you can have up to 16382 segments of up to 64Kb, which will be based anywhere in the 16MB addressable physical memory. Addresses are formed with descriptor[selector].base + offset, and the last 2 bytes of the 80386 descriptors aren't used (so the base is limited to 24 bits and the limit to 16 bits, without "granularity=4K" bit.)