Addressing after enabling A20...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Alexander

Addressing after enabling A20...

Post 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?
bkilgore

Re:Addressing after enabling A20...

Post 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.
mystran

Re:Addressing after enabling A20...

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Addressing after enabling A20...

Post 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.)
Post Reply