VOGONS


First post, by karimmokhlis90

User metadata
Rank Newbie
Rank
Newbie

Is the memory map something that must come initially from the motherboard or chipset manufacturers?
Like, is it physical wiring that, for example, makes the RAM always mapped to a range like 0x40000 to 0x7FFFF?
So any RAM you install cannot appear outside that range; it can only respond to addresses between 0x40000 and 0x7FFFF.
And, for example, the BIOS is also physically wired to only respond to addresses from 0x04000 to 0x05FFF.
So, all these are physical addresses that are set by the motherboard's design.

And there are other address ranges that are not reserved for any device by default, like from 0xE0000 to 0xFFFFF.
These ranges are left for any device (like graphics card, sound card, network card, or even embedded devices),
and the BIOS or the operating system will assign addresses from these available ranges to new devices.
But they can't go outside those predefined ranges because this limitation comes from the motherboard's design.

Is what I said correct or not?
I just want someone to confirm if what I said is right or wrong.

Reply 1 of 5, by Matth79

User metadata
Rank Oldbie
Rank
Oldbie

The base memory map dates back to the original IBM PC, that set the standard which has been a boat anchor ever since, things could be done differently, but then it would not be PC compatible. These days, it is still there, but can be worked around, APIC mode to get past the AT interrupt limitations, graphics cards using high memory ranges - which started way back with "linear frame buffer"

Reply 2 of 5, by karimmokhlis90

User metadata
Rank Newbie
Rank
Newbie
Matth79 wrote on Yesterday, 12:44:

The base memory map dates back to the original IBM PC, that set the standard which has been a boat anchor ever since, things could be done differently, but then it would not be PC compatible. These days, it is still there, but can be worked around, APIC mode to get past the AT interrupt limitations, graphics cards using high memory ranges - which started way back with "linear frame buffer"

so what i said is right?

Reply 3 of 5, by mkarcher

User metadata
Rank l33t
Rank
l33t

On the original PC mainboard (built in 1981), the mainboard claimed 0xF0000..0xFFFFF for ROMs on the mainbaord, although that address space was not fully occupied. Out of this 64K, 8K were used by the BIOS, and IIRC 40K were used by IBM BASIC. Also, the mainboard claimed RAM starting at 0x00000, and ending at 0x03FFF (16K), 0x07FFF (32K), 0x0BFFF (48K) or 0x0FFFF (64K). All other addresses were not treated specially in any way and were sent to the 8-bit expansion slots (which later were named "8-bit ISA" slots).

If you wanted to have more than 64K of RAM (the maximum you could install in the mainboard), you would install an ISA card that had extra RAM on it (typically up to 256K per card), and configure that card to respond to the required address. You could even install multiple memory cards, but as the original PC mainbaord has just 5 slots, and RAM was still very expensive per kilobyte, multiple memory cards were not that common. Anyway, a possible configuration was to have the mainboard serve 0x00000 to 0x0FFFF, a memory card responding to 0x10000 to 0x2FFFF and another one responding to 0x30000 to 0x4FFFF. Also, you typically had an MDA card responding to 0xB0000..0xB0FFF and/or a CGA card responding to 0xB8000..0xBBFFF. Possibly, the IBM graphics cards responded to bigger ranges with aliases of their memory.

In an XT, if you had a hard disk controller installed, the BIOS of that controller typically responded to addresses 0xC8000..0xC9FFF for its BIOS.

On more modern mainboards (around 486-Pentium III), the system bus slots (no matter whether ISA, VL or PCI) are slower than mainboard-installed memory, and the mainboard manages all RAM, not just "the base 64K" by itself. There is a range between 0xA0000 and 0xDFFFF in which the mainboard usually does not respond to memory accesses. The area for the BIOS ROM got expanded from 0xF0000..0xFFFFF to 0xE0000..0xFFFFF.

Reply 4 of 5, by superfury

User metadata
Rank l33t++
Rank
l33t++

Some stuff is also specified by the CPU, however.
Like starting execution at FFFF0h (80(1)86) or FFFFF0h (80286) or FFFFFFF0h (80386). It can be specified for non-BSP processors only, using a SIPI. And the IVT living at address 0 for all x86 CPUs (changeable on 80286 and up, but defaulting there too on CPU reset).

To my knowledge, a SIPI doesn't apply to the BSP, which is always running, or halted? Executing an INIT command on it won't set it to waiting-for-SIPI state. It will instead immediately start running (except when in SMM mode, where it's delayed until it exits) at the reset vector.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 5, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie

On something like a 256K XT board with four banks onboard full of 64Kx1 chips, the memory map can indeed be hardwired like that: if either A19 or A18 is 1, the board is locked out from accessing the onboard DRAM (only an ISA card can respond); the values of A17 and A16 determine which of the four banks are used, A8-A15 would be the row, and A0-A7 would be the column.

On later boards, it's necessarily more flexible. For example, shadow RAM: F0000-FFFFF (among other ranges) can be programmatically be changed to either go to the BIOS ROM chip or to RAM, at runtime. That is determined by the chipset.

Another issue is memory relocation. Often, the DRAM at C0000 and F0000 is locked in place. It's either inaccessible (accesses go to ISA cards for C0000 or to ROM for F0000), read-write, or read-only, depending on chipset register bits. That leaves the RAM at A0000, B0000, D0000, and E0000. Sometimes that 256K can be "relocated" to the top of memory, so if your system has 4MB, the map is 640K base, 64K at C0000, 64K at F0000, 3MB of "normal" extended memory, plus another 256K stub of extended memory beyond that at the top of memory. This is how you get oddball amounts of memory in AMIBIOS like 3968K, because AMIBIOS adjusts the reported amount for the loss of shadow RAM and the gain of relocated memory. This flexibility requires that the memory map be handled in the chipset/memory controller and not a hardwiring to the SIMMs.

The memory relocation feature is lost in later chipsets, possibly because that 256K is needed for System Management (power management and things like USB to AT & PS/2 peripheral emulation) mode.

Chipset datasheets will often tell you how the possibility of overlapping onboard DRAM and memory on a VLB or ISA card is handled, often closely related to the "non-cacheable region" feature.