How can I remap the physical memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

How can I remap the physical memory

Post by LindusSystem »

I recieve the memory map from my bootloader.I have purposely installed a RAM in slot 0 and slot 2.I want to remap the memory (RAM) so that I can use the Solt 2 RAM as Slot 1 and remove the holes between Slot 0 and 2.

Is there any way for this?
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: How can I remap the physical memory

Post by NickJohnson »

First off, you should be able to handle situations when the free memory is not contiguous. Second, I'm pretty sure that on all reasonable systems, the memory controller will make any sticks of RAM you put in contiguous in the physical address space, regardless of their physical position (assuming the memory controller is okay with you not pairing sticks in the first place.)
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: How can I remap the physical memory

Post by Nable »

Chipset (memory controller, to be precise) maps physical memory to physical addresses. So, you need documentation for all chipsets you want to support. In most cases it's not public.
In recent CPUs memory controller is integrated into CPU so it's easier to obtain its documentation, although this manuals are always huge and rather difficult to understand. So, think twice before deciding to use physical memory remapping.
Really, why do you need it? If you use protected/long mode, the code will use virtual addresses and it's rather easy to map non-contiguos physical memory into contiguos virtual memory region.
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: How can I remap the physical memory

Post by LindusSystem »

When I probed memory, I get holes after the last byte of the RAM at solt 0, I thought that hole is becaz of the RAM Positions.
What are those holes?Am I wrong that it is because of the RAM position?
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: How can I remap the physical memory

Post by Brendan »

Hi,
LindusSystem wrote:I recieve the memory map from my bootloader.I have purposely installed a RAM in slot 0 and slot 2.I want to remap the memory (RAM) so that I can use the Solt 2 RAM as Slot 1 and remove the holes between Slot 0 and 2.

Is there any way for this?
My guess is that the hole you're talking about is the one below 0x100000000 that exists for things like PCI devices, APICs and firmware ROM.

The hole you're trying to get rid of has nothing to do with what RAM is in which slot. You could fill every RAM slot with as much RAM as possible and the hole would still be there.

There's also no easy way to tell how the motherboard maps actual RAM chips into the physical address space. For all you know it could be interleaved, so that the 64 bytes of RAM at 0x00000000 is "slot 0", the next 64 bytes of RAM at 0x00000040 is "slot 2", the next 64 bytes is "slot 0" again, etc.
LindusSystem wrote:When I probed memory, I get holes after the last byte of the RAM at solt 0, I thought that hole is becaz of the RAM Positions.
What are those holes?Am I wrong that it is because of the RAM position?
Why would you probe to begin with? What does the real memory map (as reported by the firmware via. "int 0x15, eax=0xE820") look like? Where is this hole?
LindusSystem wrote:Am I wrong that it is because of the RAM position?
Yes.


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.
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: How can I remap the physical memory

Post by LindusSystem »

Thanks all, I have corrected my mis-undrestanding of the physical memory.Sorry for this post!
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
Post Reply