Page 31 - DCAP408_WEB_PROGRAMMING
P. 31
Unit 2: Windows Memory Management
The translation from logical to physical address is performed by the processor. A 32 bit logical Notes
address is separated into three parts as displayed below. The processor loads the physical address
of the page directory base amassed in CR3. It then utilizes the upper 10 bits from the logical
address as an index in the Page directory. This provides the processor a page directory entry
(PDE) which refers to a Page Table. The next 10 bits are used as an index in the page table. By
means of these 10 bits, it obtains a page table entry (or PTE) which points to a 4KB physical page.
Did u know? The lowest 12 bits are utilized to address the individual bytes on a page.
Self Assessment
Fill in the blanks:
5. The ........................ separates the physical address space (or physical memory) in 4 KB
pages.
6. The first dimension of X86 processor is called ........................ and second dimension is
called Page Table.
7. We can generate 1 Page directory with 1024 entries, each of which refers to a ........................ .
8. Every ........................ is 4 bytes in size and refers to a Page Table.
9. When a process is formed, every entry in Page Directory includes ........................ of a Page
Table.
10. ........................ entries enclose physical address of 4KB page assigned to the process.
11. An ........................ entry includes some particular bits to mark it invalid and these entries
are called Invalid PTEs.
2.3 Memory Protection
Windows offers memory protection by means of the virtual memory hardware. The
accomplishment of this protection differs with the processor.
Example: Code pages in the address space of a process can be marked read-only and
protected from alteration by user-mode threads.
Windows give memory protection to all the processes in order that one process can’t utilize
other process’s memory. This makes sure smooth operation of multiple processes concurrently.
Windows make sure this protection by doing following:
It only puts the physical address of assigned memory in PTE for a process. This makes sure
that the process’s obtains an access violation if it attempts to access an address which is not
allocated.
A rouge process may attempt to adjust its page tables so that it can access the physical
memory belonging to another process. Windows defend this sort of attacks by accumulating
page tables in kernel address space. Remember from our previous discussion that out of
the 4GB logical address space specified to a process, 2GB is given to user mode and 2GB is
reserved for windows kernel.
LOVELY PROFESSIONAL UNIVERSITY 25