Please excuse my ignorance.
Suppose you run an i386 in protected mode with a virtual memory manager kernel such as Linux.
Suppose further that the unlikely condition that the ram is massively fragmented to the point of having 4K block used, 4K block free, 4K block used...etc
If a programs allocates 8K of memory and writes to all of it, how does the CPU know to skip over the used block? I did not think the CPU had a concept of nonlinear memory and I did not know there was a mechanism to intercept memory access other then page faults. How are virtual memory managers implemented?
Virtual memory managers - How do they work?
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: Virtual memory managers - How do they work?
Yes, the CPU designer knows that, and therefore paging.smeezekitty wrote:I did not think the CPU had a concept of nonlinear memory
When paging is enabled, the machine (mostly) operate on linear address (aka logical address space),
an MMU translate that linear address into physical address using page table
For simplicity, we define:
Code: Select all
PhysicalAddress = MMU(LinearAddress);
In this case physical memory addressed by 0 to 8192 is non-continuous.
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: Virtual memory managers - How do they work?
Ahhh... I see a forgot about the Memory Management Unit
I cannot seem to find technical docs on the programming information and general specs.
I cannot seem to find technical docs on the programming information and general specs.
Re: Virtual memory managers - How do they work?
Check Intel manuals volume 3 (System Programming). They have full description on how address is translated in different modes.