Skip to content
This repository was archived by the owner on May 29, 2018. It is now read-only.
Noxer edited this page Jan 29, 2013 · 4 revisions

Atlas 2 uses a paging table to implement paging. The OS divides the memory (65536 words) into 64 parts (with 1024 words each). The first three pages are always reserved for the kernel.

There are two entries for each page: A first entry describing the current owner of this page and a second entry for the owner of a swapped page. Note: Swapping does is not yet implemented!

When an entry is 0x0000 the corrosponding page is free and may be allocated by a process.

A page table entry consists of two parts. The lower 12 bit of the entry represent the process id to which this page belongs. The upper 4 bits represent flags of which the highest one is set to 1 if the page is reserved (the signal daemon has the process id 0x000 so we need to set that flag in order to recognize pages allocated by it). The three remaining bits are unused. They may later be used for mmap functionality.

You can easily calculate the page to which the entry belongs by subtracting the start of the table from the pointer to the entry. Dividing the result by two (without remainder) and multiplicating it with 1024.

Clone this wiki locally