blob: 808dc74cf45d8f3febdee3c876ba5e16d022ca7b [file] [log] [blame]
swissChili825d46b2021-02-21 10:14:16 -08001.\" Kernel paging docs, largely as a reference for myself.
2.TH paging 9 "18 February 2021" "1" "Paging"
3.SH NAME
4Paging - kernel memory paging overview
5.SH SYNOPSIS
6Paging allows the kernel to map arbitrary virtual memory addresses to
7locations in physical memory.
8.SH DESCRIPTION
9On x86 each page is fixed at 4kb. Mapping each 4kb page for the
10entire memory takes a lot of space, so instead,
11.B
12page directories
13.NB
14and
15.B
16page tables
17.NB
18are used. The kernel stores one or more page directories, each of
19which contains 1024 pointers to page tables (which may be null), each
20of which in turn contains 1024
21.B
22page table entries
23.NB
24
25Each page table entry contains the upper 20 bits of the physical
26memory location it maps to
27.B
28(frame).
29.NB
30It also contains several flags describing if the page is readable or
31writable in user mode, as well as flags set by the CPU: such as if the
32page has been accessed or modified.
33.SH SEE ALSO
swissChilidc25b2b2021-02-23 17:07:13 -080034src/paging.c, src/paging.h, Intel manual volume 4, Figure 4-4.