Accessing physical memory behind the 'holes'?
Accessing physical memory behind the 'holes'?
Is there any way to access the physical memory corresponding to the addresses that are 'holes' according to the BIOS (perhaps because there are devices mapped there or whatever)?
Or is that memory always empty, from when the computer is turned on to when it is turned off?
Or is that memory always empty, from when the computer is turned on to when it is turned off?
Re: Accessing physical memory behind the 'holes'?
There is no usable memory in the hole. It can be faulty ram that is disabled, or for any reason the BIOS don't feel like you using it.
Re: Accessing physical memory behind the 'holes'?
Devices can be remapped but BIOS areas are reserved, don't mess with them.
Memory-mapped I/O is the common method to access devices on the x86 architecture so it's unlikely you can get rid of memory gaps...
...or maybe I'm missing something. I'm not very expert, sorry.
Some useful info in the wiki:
http://wiki.osdev.org/Memory_Map_%28x86%29
Memory-mapped I/O is the common method to access devices on the x86 architecture so it's unlikely you can get rid of memory gaps...
...or maybe I'm missing something. I'm not very expert, sorry.
Some useful info in the wiki:
http://wiki.osdev.org/Memory_Map_%28x86%29
Re: Accessing physical memory behind the 'holes'?
Hi,
There is one case - for most modern chipsets/motherboards, the area reserved for legacy ROMs (e.g. from 0x000C0000 to 0x000EFFFF) is actually RAM. The BIOS copies "ROM images" from PCI devices into this area and then tells the memory controller to treat this area as "read only". With some special (chipset/motherboard specific) ninja hacks (and some MTRR changes), you can reclaim this RAM and gain an extra 192 KiB of RAM to play with.
Cheers,
Brendan
There is one case - for most modern chipsets/motherboards, the area reserved for legacy ROMs (e.g. from 0x000C0000 to 0x000EFFFF) is actually RAM. The BIOS copies "ROM images" from PCI devices into this area and then tells the memory controller to treat this area as "read only". With some special (chipset/motherboard specific) ninja hacks (and some MTRR changes), you can reclaim this RAM and gain an extra 192 KiB of RAM to play with.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Accessing physical memory behind the 'holes'?
> extra 192 KiB of RAM
MMIO uses much more space than 192k. For example, you have 4G of RAM and framebuffer is mapped somewhere in these 4G.
6.25 or 12.5% (for rather typical 256/512M framebuffers) of memory will be lost.
Afair, one can program MTRRs to specify whether bus access will go to MMIO or RAM, am I right?
MMIO uses much more space than 192k. For example, you have 4G of RAM and framebuffer is mapped somewhere in these 4G.
6.25 or 12.5% (for rather typical 256/512M framebuffers) of memory will be lost.
Afair, one can program MTRRs to specify whether bus access will go to MMIO or RAM, am I right?
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Accessing physical memory behind the 'holes'?
Nowadays, you have 256TiB of virtual address space, so 256/512MiB is 9.5 * 10^-5% or 19 * 10^-5% - it doesn't really matter (I don't count physical RAM here, which is normally about 6GiB and more nowadays).Nable wrote:> extra 192 KiB of RAM
MMIO uses much more space than 192k. For example, you have 4G of RAM and framebuffer is mapped somewhere in these 4G.
6.25 or 12.5% (for rather typical 256/512M framebuffers) of memory will be lost.
Afair, one can program MTRRs to specify whether bus access will go to MMIO or RAM, am I right?
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: Accessing physical memory behind the 'holes'?
My laptop has 4GB RAM installed and it has a memory hole from 0xC0000000 to 0xFFFFFFFF. However, that does not mean that 1GB of my physical RAM is inaccessible - it is simply mapped to 0x100000000 to 0x13FFFFFFF. So there really is no physical memory hidden behind that hole.
The situation may be differrent for legacy memory holes in the area 0xA0000 to 0xFFFFF.
The situation may be differrent for legacy memory holes in the area 0xA0000 to 0xFFFFF.
Re: Accessing physical memory behind the 'holes'?
I'm more curious on 15m-16m memory hole on legacy machine, do that memory get remapped or just get wasted?
Re: Accessing physical memory behind the 'holes'?
Hi,
Unless you know the details for a specific motherboard/chipset you can't really know if the RAM gets remapped or not; and if the RAM isn't remapped you'd need a lot more details to determine if anything can be done about it anyway. For example, if a computer does have this hole, and if you had enough information to write chipset specific code to disable the hole, you'd still have to determine if there are any ISA devices using the hole before you could safely disable it. Of course ISA sucks - you'd have to manually probe for every ISA card ever created that could be using the hole just to determine if any are present.
Cheers,
Brendan
I'd assume there's old motherboards (e.g. intended for 8 MiB of RAM or less) that don't remap anything in that hole when more memory is present. I'd assume there's slightly newer motherboards (e.g. intended for 16 MiB or more RAM) where RAM in that area is remapped elsewhere and others that don't. I'd also assume there's even newer motherboards (probably everything made in the last 15 years) where 1 MiB of RAM wasn't considered worth worrying about anymore. I'd also assume there's recent motherboards that don't even support the hole (as it's not used unless there's ISA devices, and ISA is "obsolete enough" now).bluemoon wrote:I'm more curious on 15m-16m memory hole on legacy machine, do that memory get remapped or just get wasted?
Unless you know the details for a specific motherboard/chipset you can't really know if the RAM gets remapped or not; and if the RAM isn't remapped you'd need a lot more details to determine if anything can be done about it anyway. For example, if a computer does have this hole, and if you had enough information to write chipset specific code to disable the hole, you'd still have to determine if there are any ISA devices using the hole before you could safely disable it. Of course ISA sucks - you'd have to manually probe for every ISA card ever created that could be using the hole just to determine if any are present.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Accessing physical memory behind the 'holes'?
Hmmm... but e.g. System Management Mode can definitely use RAM behind the Video RAM address range (http://fawlty.cs.usfca.edu/~cruse/cs630f06/duflot.pdf), so that's what made me wonder if you could somehow hack around for other addresses as well.bluemoon wrote:There is no usable memory in the hole. It can be faulty ram that is disabled, or for any reason the BIOS don't feel like you using it.
Re: Accessing physical memory behind the 'holes'?
Brendan wrote:Unless you know the details for a specific motherboard/chipset you can't really know if the RAM gets remapped or not; and if the RAM isn't remapped you'd need a lot more details to determine if anything can be done about it anyway. For example, if a computer does have this hole, and if you had enough information to write chipset specific code to disable the hole, you'd still have to determine if there are any ISA devices using the hole before you could safely disable it. Of course ISA sucks - you'd have to manually probe for every ISA card ever created that could be using the hole just to determine if any are present.bluemoon wrote:I'm more curious on 15m-16m memory hole on legacy machine, do that memory get remapped or just get wasted?
That's interesting, cool!