memory hole question

her34

Senior member
Dec 4, 2004
581
1
81
in trying to understand the memory hole and why memory is mapped from 4gb downward instead of just starting at zero (thread about 4gb in videocard forum if you care), it was explained that this is artifact of history dating back to ibm 16bit cpu's.

the point was made that moving the i/o hole when transitioning to 32bit in past or 64bit now would break software compatibility and so things like dos wouldn't run on a modern pc if that were to happen.




but that lead to a follow up question which is essentially this:

why does moving the i/o mapping break software?




i don't understand this because that makes it seem like absolute addresses/references are used. i would have thought that any hardware i/o gets assigned an address as needed, then whenever that hardware is called for the program/driver/os asks the directory (i guess that would be mmu in this case) for the address of the hardware.

sort of like in windows when you open applications, windows assigns ram to apps as you open them. it's not like photoshop has dedicated address from 500mb-600mb, firefox has 600mb-650mb, etc. right? it's dynamically assigned as needed. so if software is mapped this way, why isn't hardware (at boot hardware is queried and mmu assigns addresses as needed into directory, then rest of addresses is given to OS to use).

i imagine something like this:
on first boot it checks if pci1 is occupied, videocard is there so it asks how much is memory is needed, then assign 0mb-256mb. moves on to pci2 which has soundcard, assigns 256mb-284mb, skips pci slots that are empty, etc, etc. then complete directory/table is stored in mobo rom and used by OS. on subsequent boots, if no hardware has changed, the same directory is used to speed up boot process
 

Peter

Elite Member
Oct 15, 1999
9,640
1
0
Haven't you read my "history lesson" answer to this your question in this thread?

http://forums.anandtech.com/me...AR_FORUMVIEWTMP=Linear

Please do, it'll shed a light.

On top of what I posted there: Neither hardware nor software magically gathers new capabilities just because other stuff did. If a PCI device was designed to live in 32-bit space, then that's how it is, neither BIOS nor OS can map it to above-4G space. Same for the other (busmaster DMA) direction - if a PCI device cannot physically drive 64-bit addresses onto the bus, then it can't reach into application RAM above 4G, period. Short of a device redesign, you can't make it.

Same for software - if you give a 32-bit application five gigs of data buffer, then it won't be able to handle it. If it's been well written, it may after a recompile run for 64-bit target mode - but history says, some assembly required.

About learning the hard way about these things, go ask Creative ;)