Vista x64 - BIOS - Memory Re-Mapping Question

Only for programmers and BIOS gurus with technical questions.
Post Reply
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

Hey all -

I wanted to ask if anyone knows anything about Vista x64 and the apparent issues that show up when > 4 GB RAM is installed (MS KB #929605).

I was interested in how the Memory Re-Mapping actually works.

Thanks.
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

Just a follow-up clarification.

My question is really asking if the Memory Mapping/Re-Mapping is a BIOS function, or is the BIOS merely acting as a "switch" in this case...allowing the Memory Re-Mapping to occur...or not.

Thanks.
maman
Master Flasher
Posts: 173
Joined: Sun Mar 31, 2002 2:08 pm
Location: Taka Bonerate National Park, Indonesia
Contact:

Hi,
AFAIK it's a combination of chipset support, OS support and BIOS initialization code. You may want to read Intel Chipset datasheet that support such a feature. IIRC, Intel MCH that comes with ICH7 (upwards) support this kind of thing.

Cheers

:wink:
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

Thanks maman.

Would you know if this something that can be compensated for in a device driver?

Will all BIOS re-map to the same location, or will the location move around due to the amount of physical RAM installed?

Why is this re-mapping even necessary?

Thanks.


(Ref: Ask Dan: What's with the 3Gb memory barrier?)
ironhorse99
New visitors - please read the rules.
Posts: 2
Joined: Mon Sep 24, 2007 12:52 pm

Hi:

I've looking at this myself & found this from Microsoft:

Also, take a look @ my recent post concerning this issue.

Regards, Mike


Note - Edited post to remove the contents of the MS KB article...which was already reflected in my initial posting. Also embedded the link to ironhorse99's "recent post". - KW
maman
Master Flasher
Posts: 173
Joined: Sun Mar 31, 2002 2:08 pm
Location: Taka Bonerate National Park, Indonesia
Contact:

KachiWachi wrote:Thanks maman.

Would you know if this something that can be compensated for in a device driver?
I don't think a driver would overcome this problem itself. The first problem is the BARs(Base Address Registers) in the PCI/PCIe devices which uses some of the physical address space below 4GB because some of them are MMIO devices. Remember that most PCI device are technically addressed using 32-bit addressing. The BARs are initialized by the BIOS. So, we need a compliant BIOS first hand. The BIOS should be able to initialize the chipset to remap the "shadowed" physical RAM to area above the 4GB barrier. BIOS resides very_close_to-until-the 4GB limit that's why we need area above 4GB. Once the physical RAM remapped, a driver within the OS is needed to provide the interface between the OS and the physical RAM. The driver is needed to "tell" the OS that it still have "free memory" above the 4GB limit and to map it to the page tables in the OS. This is a rather difficult thing and I'm not sure as to what is the situation with Windows XP SP2 at the moment let alone Vista ;-)

KachiWachi wrote: Will all BIOS re-map to the same location, or will the location move around due to the amount of physical RAM installed?

Why is this re-mapping even necessary?

Thanks.


(Ref: Ask Dan: What's with the 3Gb memory barrier?)
I'm not sure if the BIOS will remap to the same location every time. because there are devices that uses BARs and the BARs of course need some room. Therefore, if you install a new device that "eats" some of the MMIO area, the remapping might change.

The remapping is necessary so that the physical RAM that's "shadowed" by the device that uses MMIO can be "seen" by the OS. Otherwise, it would still be "shadowed" because the memory controller in the chipset wouldn't be able to access the RAM.
Why? because a physical address should be unambiguous. Say, you have a PCI card that consume MMIO at range 2.8GB-3GB; RAM in this area cannot be "seen" by the chipset because every access to that physical address range will be forwarded to the PCI card by the chipset because it's in the PCI card's MMIO range (of course this is assuming there is no remapping). Therefore, if the chipset want to access RAM at that MMIO range, the RAM must be remapped to an area outside of the MMIO range during "system wide physical address initialization" part of the BIOS POST. This range in most case above the 4GB limit.

The main point is the system must have a consistent view of the "system-wide physical address space". Therefore, if an address range is used by two conflicting device, only one of them will be used the other will be "shadowed".

I hope it's clear enough.

Cheers

:wink:
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

Thanks maman for your insight.

Here is the situation that I'm faced with -

On the webcam forum that I post to, some individuals are suggesting that adding a USB hub in front of their web camera will cause it to function as designed (there are 64-bit issues).

Why would inserting an external hub "fix" this problem?

Thanks.
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

I just became aware of this -

KB #941600 - Cumulative update rollup for USB core components in Windows Vista (10/1/2007)

Perhaps this is just a USB problem after all???
maman
Master Flasher
Posts: 173
Joined: Sun Mar 31, 2002 2:08 pm
Location: Taka Bonerate National Park, Indonesia
Contact:

KachiWachi wrote:I just became aware of this -

KB #941600 - Cumulative update rollup for USB core components in Windows Vista (10/1/2007)

Perhaps this is just a USB problem after all???
Well, USB controllers occupy portions of the 4GB physical memory address range. That should cause an issue if it's not handled correctly. The quote below is from Intel ICH8 datasheet Table 102 p.262.
Intel ICH8 Datasheet wrote:
Memory Range: 1 KB anywhere in 4-GB range
Target: USB EHCI Controller #1
Dependency/Comments: Enable via standard PCI mechanism (Device 29, Function 7)


Memory Range: 1 KB anywhere in 4-GB range
Target: USB EHCI Controller #2
Dependency/Comments: Enable via standard PCI mechanism (Device 26, Function 7)
As you can see, if the 1 KB "window" is in the 'wrong place'. The system will be in trouble. The "1 KB anywhere in 4-GB range" actually means the USB controller "function" is relocatable, usually the BIOS initializes where this area will be mapped in the system-wide memory mapping. I think the OS driver should take part in some respect too when it already takes control of the machine. I'm not too well versed in the USB subsystem of windows. But, I think we already see the relationship here :wink:
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

Thanks again maman for your insight.

Any clue as to why the use of an external USB hub "fixes" this?
maman
Master Flasher
Posts: 173
Joined: Sun Mar 31, 2002 2:08 pm
Location: Taka Bonerate National Park, Indonesia
Contact:

KachiWachi wrote:Thanks again maman for your insight.

Any clue as to why the use of an external USB hub "fixes" this?
This is one of the weird things about USB that I don't understand at the moment :? . But perhaps a USB hub is initialized properly by the OS, and your particular device cannot be handled correctly. This is only a very rough guess though :wink:

OT: I found a bug that's really weird back then too, the "services" that runs on the background for my Logitech QuickCam USB would make compiling using MinGW in Windows always failed. Shutting down the services would make the compiling run flawlessly. Until now, I couldn't figure out why.
KachiWachi
The New Guy
Posts: 1451
Joined: Fri Mar 29, 2002 10:32 pm
Location: Pennsylvania, USA

OP's are still reporting compling issues when QuickCam is installed.

Go figure. :roll:

Thanks.
Post Reply