Click here to Skip to main content
15,901,284 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 2:47
ForNow6-Mar-08 2:47 
GeneralRe: Windows Memory mangement Pin
JudyL_MD6-Mar-08 2:56
JudyL_MD6-Mar-08 2:56 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 6:09
ForNow6-Mar-08 6:09 
GeneralRe: Windows Memory mangement Pin
Luc Pattyn6-Mar-08 6:54
sitebuilderLuc Pattyn6-Mar-08 6:54 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 13:13
ForNow6-Mar-08 13:13 
GeneralRe: Windows Memory mangement Pin
Randor 7-Mar-08 5:54
professional Randor 7-Mar-08 5:54 
GeneralRe: Windows Memory mangement Pin
Luc Pattyn7-Mar-08 6:23
sitebuilderLuc Pattyn7-Mar-08 6:23 
GeneralRe: Windows Memory mangement Pin
Mike Dimmick7-Mar-08 15:56
Mike Dimmick7-Mar-08 15:56 
In normal execution, the processor handles translation from virtual to physical addresses completely automatically. The processor has a Translation Look-aside Buffer (TLB) which performs this operation. This is often described as an array of mappings that the processor 'searches' in one cycle, but is really a circuit in which the virtual address goes in the top and the physical address pops out of the bottom, if present.

If the required mapping is not in the TLB, the processor searches the page table. The control register CR3 points to the base of the page directory for the process. The Page Directory consists of Page Directory Entries which point to Page Tables. The Page Table Entries point to physical memory. If a valid Page Table Entry is found, the TLB is automatically updated and execution continues; otherwise, a Page Fault exception is raised to the OS which either fixes up the TLB directly and continues, fixes up the page table and continues (this might be the case where the data is already in RAM), reads in the code or data from disk (Windows is demand-paged, it doesn't read code from executables until it's actually called), or generates an Access Violation software exception.

Each process has its own Page Directory. When the OS switches from one thread to another, if the new thread is from a different process, it reloads the CR3 register with the address of the page directory for the new process. That automatically clears the TLB. (Page Table Entries can be marked Global; those are not cleared from the TLB.) Windows keeps the page directory base address information for each process in a data structure about that process.

The page table entry can be marked valid or invalid. A Valid page table entry is handled by the processor. If marked invalid (bit 0 = 0), the OS can (and does) store anything it likes in the other 31 bits. (To simplify things I'm talking about how 32-bit Windows worked on most machines before XP SP2!)

In some cases, particularly when memory has just been allocated, the PTE might not yet contain the necessary information. In addition to the page tables, Windows also stores information about all the virtual addresses that a process has allocated in a tree structure of Virtual Address Descriptors. It tracks what physical memory location belongs to which page table entry through the Page Frame Number Database, to update page tables appropriately when it has to reuse physical memory locations for something else.


DoEvents: Generating unexpected recursion since 1991

GeneralRe: Windows Memory mangement Pin
ForNow8-Mar-08 14:51
ForNow8-Mar-08 14:51 
GeneralRe: Windows Memory mangement Pin
Mike Dimmick9-Mar-08 3:26
Mike Dimmick9-Mar-08 3:26 
GeneralRe: Windows Memory mangement Pin
ForNow9-Mar-08 7:50
ForNow9-Mar-08 7:50 
QuestionDevice Firmware Upgrade (DFU) Pin
Roger Stoltz4-Mar-08 22:39
Roger Stoltz4-Mar-08 22:39 
GeneralSystem Hang while using pen drive Pin
yogesh_kumar_agarwal4-Mar-08 20:18
yogesh_kumar_agarwal4-Mar-08 20:18 
GeneralRe: System Hang while using pen drive Pin
M.Nouri10-Mar-08 4:13
M.Nouri10-Mar-08 4:13 
QuestionBuild a DLL with DDK Pin
Member 41248731-Mar-08 3:41
Member 41248731-Mar-08 3:41 
GeneralRe: Build a DLL with DDK Pin
JudyL_MD3-Mar-08 2:23
JudyL_MD3-Mar-08 2:23 
GeneralRe: Build a DLL with DDK Pin
Member 41248733-Mar-08 8:14
Member 41248733-Mar-08 8:14 
GeneralRe: Build a DLL with DDK Pin
JudyL_MD3-Mar-08 8:43
JudyL_MD3-Mar-08 8:43 
GeneralRe: Build a DLL with DDK Pin
Member 412487322-Mar-08 0:18
Member 412487322-Mar-08 0:18 
GeneralRe: Build a DLL with DDK Pin
JudyL_MD24-Mar-08 4:05
JudyL_MD24-Mar-08 4:05 
GeneralRe: Build a DLL with DDK Pin
Member 412487324-Mar-08 4:43
Member 412487324-Mar-08 4:43 
GeneralRe: Build a DLL with DDK Pin
JudyL_MD24-Mar-08 5:18
JudyL_MD24-Mar-08 5:18 
Generalrobotics..... Pin
kanza azhar29-Feb-08 6:24
kanza azhar29-Feb-08 6:24 
GeneralRe: robotics..... Pin
Paul Conrad7-Mar-08 14:29
professionalPaul Conrad7-Mar-08 14:29 
AnswerRe: robotics..... Pin
M.Nouri10-Mar-08 4:22
M.Nouri10-Mar-08 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.