• Please review our updated Terms and Rules here

Anyone know what the 1MB 286/386 clones memory map was?

mattrix

Member
Joined
Sep 15, 2010
Messages
17
I guess the first 640KB was at 0-9FFFF, but where was the other 384KB mapped?

These were around before DOS had HIMEM.SYS etc.

It seems a waste to have RAM at A0000-FFFFF, but I seem to remember that these computers had extensive shadowing, so maybe 0C0000-11FFFF?

Or was this a configurable option?
How was it implemented? I always assumed it was done using hardware gating.
 
Last edited:
The other 384 was placed at the 1MB boundary. At least that's the way it is on my 6MHz Faraday and on my later DTK clones. Note that it's possible, by turning off the A20 masking to get to the first 64K or so while staying in real mode.
 
Thanks Chuck
Am I mis-remembering the shadowing on these computers? IIRC RAM was much faster than ROM in those days.
 
No you're not, it varies. For the most part my 286 machines have done what Chuck suggested - move it to begin at 1Mb.
However I've had one 286 and many 386/486 machines which have the option to steal it for shadowing - normally that's optional though.

The weirdest 1Mb board I own only lets me do 512KB CONV + 512KB XMS or 640KB CONV and wastes the last 384K - and they had the nerve to call it the "Intelligent Personal Computer" - techincally I can understand the challenge of only remapping part of a memory bank but still the competition at the time seemed to manage.
 
Last edited:
And there are some machines (such as some Compaq Deskpros) which maps it below the 16MB boundary starting at 0xFA0000.
 
No you're not, it varies
Thank you, its been so long, my brain hurts ;)
... or 640KB CONV and wastes the last 384K -

Now that you come to mention it, that does ring a bell. At least on later boards with 4MB, -> 640K + 3M.


Ah its coming back (slowly), I seem to recall there were problems with some cards doing I/O in the C0000-DFFFF range.
 
I guess the first 640KB was at 0-9FFFF, but where was the other 384KB mapped?

These were around before DOS had HIMEM.SYS etc.

It seems a waste to have RAM at A0000-FFFFF, but I seem to remember that these computers had extensive shadowing, so maybe 0C0000-11FFFF?

Or was this a configurable option?
How was it implemented? I always assumed it was done using hardware gating.

I think I'm misunderstanding something here: without using the LOADALL instruction (which is used within HIMEM.SYS, if Wikipedia is to be believed), how can a 286/386 access memory above 1 MB while in real mode? Unless you're working in protected mode, at which point I'm guessing the MMU would do translate all the addresses for you and you'd never find out the true memory map XD.
 
It's a little trick (or flaw, depending on how you look at it) of the 80286 address calculation hardware. With the A20 gate (a bit of external logic to the 80286) off, only the lower 20 bits of the address are passed to external memory. When A20 gating is on and A20 is passed through to the bus and memory, then a segment computation will not "wrap" a segment if there's overflow in the segment calculation.

So, if my segment address is FFFF and I want to address 16 bytes into that, the physical address is FFFF0+10 = 100000h. On earlier CPUs, such as the 8088 and 80186, there would be a wrapaound to 00000h. The A20 gate feature creates similar behavior on 80286 systems to enforce compatibility with older code that might make use of the 1MB address space wrap. So you get to address the first 64K, less one paragraph (16 bytes) of the second megabyte of address space.

See: http://en.wikipedia.org/wiki/A20_line
 
I'm sorry, I worded my question poorly- I know about the A20 line/wraparound because OpenWatcom dedicates a whole page on its wiki to why it was a method of backwards compatibility gone horribly wrong: http://www.openwatcom.org/index.php/A20_Line.

My real question is the following: Without having a technical reference manual which gives you this information, how can a programmer figure out the addresses where the remaining 384KB lies without writing their own custom protected mode application? You don't have access to physical addresses or the LDT/GDT (which would give you the physical addresses) within the context of a protected mode operating system such as Windows. I guess the BIOS must have some knowledge of where the addresses lie (I recall that the 286 boots up in real mode but A15 is stuck high until a jmp instruction), or a protected mode operating system/application has to guess and check when it builds the GDT?

Additionally, I imagine using the A20 line and writing and reading a value at 0x100000 (and assuming the remaining memory's contiguous) would work for systems where they place the memory at the 1MB mark, but yuhong mentioned that other systems put it at the 16MB limit/top of the address space,
 
IIRC RAM was much faster than ROM in those days.

ROMs in ISA cards are slow not only because the ISA bus is limited to 8MHz mostly - but most ISA cards with ROMs implement a simple 8-bit ROM which is even slower because it's obviously 8-bit but secondly 8-bit transfers across an ISA interface always run at about 750ns cycle time (unless ZWS is asserted by the card). So on a 12MHz 286 it can access RAM in 16-bits at 12MHz, whereas an ISA card ROM would be in 8-bits at 5MHz roughly - nearly 5x slower.
 
Well, the INT 15H/88H BIOS function is defined to return the amount of contiguous memory starting at 1024K. So that alone tells you if you have a HMA. As for "Big Memory" (not applicable for 80286 obviously), the INT 15H function E801 is used. Obviously, if an EISA machine is used, the location of memory can be determined directly.

Additionally, there are a few special functions for Compaq and Zenith systems--Zenith maintains 256K of "Built in Memory" at FA0000 on some systems and Compaq has calls for disabling ROM shadowing.

Have a look at the source code for HIMEM--that will tell you a lot. One technique it also uses is the BIOS INT 15/87H "move memory" function to probe high memory as a sanity check.
 
Chuck, a little of topic I appreciate, but is there any way for DOS 6 (eg) to use memory above 640KB without a 286?
 
Well, the INT 15H/88H BIOS function is defined to return the amount of contiguous memory starting at 1024K. So that alone tells you if you have a HMA. As for "Big Memory" (not applicable for 80286 obviously), the INT 15H function E801 is used. Obviously, if an EISA machine is used, the location of memory can be determined directly.
Modern systems uses E820h, and before not only there was E801h but there are a number of others. For example, PS/2s had function C9h.
 
Chuck, a little of topic I appreciate, but is there any way for DOS 6 (eg) to use memory above 640KB without a 286?

PC DOS 2000 has some utilities to do just that. There is also the DOSMAX utility that should work fine with DOS 6. Some here have used it after modifying their XT systems to take 4 banks of 64Kx1 DRAM or used a RAM add-in card, as Sergey did.
 
MEMMAKER (built in to MS-DOS 6.x) can be a godsend if you have memory in the 640-1024 range.

...but only if you've got the right hardware. 808x and 80286 systems need not apply:

Microsoft said:
1. Q. How can I free conventional memory on my computer?

A. You can automatically optimize memory use in your computer by
running the MS-DOS 6 MemMaker program. MemMaker works on 80386
or higher computer systems only; it does not work on 80286 or
8088 systems. It works with the MS-DOS HIMEM.SYS and EMM386.EXE
memory-management utilities only; it does not work with third-
party utilities, such as Qemm(TM) and 386MAX(R).
 
Back
Top