Virtual memory

When system is booting, vmskernel.sys is lauched as L4 roottask.
Its pager is sigma0 default pager. Sigma0 is an idempotent pager and roottask mainly handle physical memory. In some circumstances, roottask can map virtual memory when a thread attemps to access to nonexistent memory.

Sigma0 only maps memory for roottask and only once. Thus, roottask, after complete initialization, enters in infinite loop that can dispatch pagefault protocol (sys$pagefault()). Roottask only maps and unmaps physical memory requested by pager.sys.

Main pager (pager.sys) is the first thread launched by roottask. This pager can manage swapfiles and only maps and unmap physical memory requested by all threads pagers as its function vms$pagefault() is able to send to requestor a physical free page. If there is no more physical memory, this pager can write an old page in swapfile.

When system is initialized (vmskernel.sys, pager.sys, init.exe), all address spaces contain a pager that handle pagefault protocol. These pagers map physical pages returned by pager.sys into virtual pages.

Pager algorithm:

PNG - 81.9 kb