next up previous contents index
Next: 10.9.3 pdir_find_pde: find an Up: (X86) Base Environment: Page Previous: 10.9.1 base_paging_init: create minimal

10.9.2 base_pdir_pa: initial kernel page directory

   

SYNOPSIS

#include <oskit/x86/base_paging.h>

extern oskit_addr_t base_pdir_pa ;

DESCRIPTION

This variable is initialized by base_paging_init (see Section 10.9.1) to contain the physical address of the base page directory. This is the value that should be loaded into the processor's page directory base register (CR3) in order to run in the linear address space defined by this page directory. (The base page directory is automatically activated in this way during initialization; the client OS only needs to load the CR3 register itself if it wants to switch among multiple linear address spaces.) The pdir_find_pde function (Section 10.9.3) and other related functions can be used to manipulate the page directory and its associated page tables.

Initially, the base page directory and its page tables directly map physical memory starting at linear address 0. The client OS is free to change the mappings after initialization, for example by adding new mappings outside of the physical address range, or by relocating the physical memory mappings to a different location in the linear address space as described in Section 10.6.3.

Most ``real'' operating systems will need to create other, separate page directories and associated page tables to represent different address spaces or protection domains. However, the base page directory may still be useful, e.g., as a template for initializing the common kernel portion of other page directories, or as a ``kernel-only'' address space for use by kernel tasks, etc.



University of Utah Flux Research Group