Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Page_map Class Reference

The Page_map includes the page directory and all of the page tables. More...

#include <pagemap.h>

Inherits Address_map.

Inheritance diagram for Page_map:

Inheritance graph
[legend]
Collaboration diagram for Page_map:

Collaboration graph
[legend]
List of all members.

Public Methods

void init ()
void map_page (void *virtual_page, void *physical_page)
unsigned int * make_temp_mapping (unsigned int *physical_page)
void unmap_page (void *virtual_page)
void get_pages_to_checkpoint (Array< void * > &pages_to_log)
void handle_page_fault (unsigned int error_flags)

Static Public Methods

unsigned int * table_entry_to_phys (unsigned int *page_entry)

Static Public Attributes

const unsigned int PTE_USER = 0x4
const unsigned int PTE_ACCESSED = 0x20
const unsigned int PTE_PAGE_FRAME_ADDRESS = 0xfffff000
const unsigned int CR0_PAGING = 0x80000000
const unsigned int PAGE_TABLE_CACHE_SIZE = 1

Protected Attributes

void * direct_mapped_end
unsigned int * temp_mapping_cache

Detailed Description

The Page_map includes the page directory and all of the page tables.


Member Function Documentation

void Page_map::get_pages_to_checkpoint Array< void * > &    pages_to_log
 

Get a list of dirty pages that should be checkpointed.

void Page_map::handle_page_fault unsigned int    error_flags
 

Recover gracefully from a page fault interrupt.

void Page_map::init  
 

Create initial page directory and page tables and enable paging.

Reimplemented from Address_map.

unsigned int * Page_map::make_temp_mapping unsigned int *    physical_page
 

Map a page into the temporary mapping cache, a portion of virtual memory set aside specifically for temporarily mapping pages while they are being modified. This avoids wasting virtual address space by keeping them mapped all the time. Return the virtual mapped address.

For now, this function assumes that the temporary mapping cache is just one page in size. Later, this code can be expanded to accomodate a real cache of several pages, using some sort of least-used count to figure out which mappings should be overwritten. Note that if the physical address given is actually within a page and not on a physical page boundary, then the returned virtual address is likewise offset from the virtual page boundary.

void Page_map::map_page void *    virtual_page,
void *    physical_page
 

Create a virtual to physical memory mapping for a single page, making a page table to contain the mapping if necessary.

unsigned int* Page_map::table_entry_to_phys unsigned int *    page_entry [inline, static]
 

Convert a page table entry into the physical page frame address it contains.

void Page_map::unmap_page void *    virtual_page
 

Disable the page table entry for the given virtual page.


Member Data Documentation

const unsigned int Page_map::CR0_PAGING = 0x80000000 [static]
 

void* Page_map::direct_mapped_end [protected]
 

end of direct-mapped 1-to-1 memory.

const unsigned int Page_map::PAGE_TABLE_CACHE_SIZE = 1 [static]
 

number of pages to use in table cache.

const unsigned int Page_map::PTE_ACCESSED = 0x20 [static]
 

const unsigned int Page_map::PTE_PAGE_FRAME_ADDRESS = 0xfffff000 [static]
 

const unsigned int Page_map::PTE_USER = 0x4 [static]
 

unsigned int* Page_map::temp_mapping_cache [protected]
 

start of temporary mapping cache.


The documentation for this class was generated from the following files:

Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman