#include <pagemap.h>
Inherits Address_map.
Inheritance diagram for Page_map:
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 |
|
Get a list of dirty pages that should be checkpointed.
|
|
Recover gracefully from a page fault interrupt.
|
|
Create initial page directory and page tables and enable paging.
Reimplemented from Address_map. |
|
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. |
|
Create a virtual to physical memory mapping for a single page, making a page table to contain the mapping if necessary.
|
|
Convert a page table entry into the physical page frame address it contains.
|
|
Disable the page table entry for the given virtual page.
|
|
|
|
end of direct-mapped 1-to-1 memory.
|
|
number of pages to use in table cache.
|
|
|
|
|
|
|
|
start of temporary mapping cache.
|
Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman