Paging: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
No edit summary
(Added a little structure.)
Line 3: Line 3:


==Overview==
==Overview==
Paging is a memory scheme that breaks up memory in groups of pages that are constantly swapped between hard disk and computer. This allows for one to appear as though they have more memory than they actually do.
Todo


==MMU==
==Advantages\Disadvantages==
Paging is achieved through the use of the [[MMU]]. This section will discuss specifics of the unit for the x86 architecture. (Page tables, etc.)
Probably the most useful application of virtual addresses is ''memory protection''. In a memory-protected environment, every process (executable) gets its own address space. To the executable, it looks like it is running alone on the system, no-one else there but the kernel. The bargain is that a misbehaved, malicious, or buggy executable cannot damage / corrupt other processes in the system. If the executable fails, the rest of the system keeps running instead of meeting the Guru Meditation, Blue Screen of Death, or whatever your system tells you when the system gets borked.


==Enabling==
==Enabling==
Enabling paging is actually very simple. All that is needed is to load CR3 with the address of the page directory and to set the paging bit of CR0.

mov eax, [page_directory]
mov cr3, eax
mov eax, cr0
or eax, 0x80000000
mov cr0, eax

==Usage==
Todo

==Page Faults==
A page fault is an exception caused when a process is seeking to access an area of virtual memory that is not mapped to any physical memory.

===Handling===
Todo
Todo



Revision as of 15:35, 12 July 2007

This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.
This page is a stub.
You can help the wiki by accurately adding more contents to it.

Overview

Paging is a memory scheme that breaks up memory in groups of pages that are constantly swapped between hard disk and computer. This allows for one to appear as though they have more memory than they actually do.

MMU

Paging is achieved through the use of the MMU. This section will discuss specifics of the unit for the x86 architecture. (Page tables, etc.)

Enabling

Enabling paging is actually very simple. All that is needed is to load CR3 with the address of the page directory and to set the paging bit of CR0.

mov eax, [page_directory]
mov cr3, eax

mov eax, cr0
or eax, 0x80000000
mov cr0, eax

Usage

Todo

Page Faults

A page fault is an exception caused when a process is seeking to access an area of virtual memory that is not mapped to any physical memory.

Handling

Todo