UnnamedOS

Memory Management Unit. More...

+ Collaboration diagram for MMU:

Data Structures

union  mmu_page_fault_error_t
 page fault error information More...
 

Functions

void mmu_load_page_directory (page_directory_t *page_directory)
 Loads a page directory into the CR3 register. More...
 
void mmu_enable_paging (page_directory_t *page_directory)
 Loads a page directory and enables paging. More...
 
uint8_t mmu_get_paging ()
 Returns whether paging is enabled or disabled. More...
 
void mmu_flush_tlb (void *vaddr)
 Flushes the Translation Lookaside Buffer for the given page. More...
 
static cpu_state_tmmu_handle_page_fault (cpu_state_t *cpu)
 Handles page faults. More...
 
void mmu_init ()
 Initializes the MMU.
 

Detailed Description

Memory Management Unit.

The MMU deals with technical details of paging and the Translation Lookaside Buffer.

See also
http://wiki.osdev.org/Memory_Management_Unit
http://www.lowlevel.eu/wiki/Steuerregister
http://wiki.osdev.org/TLB

Function Documentation

void mmu_enable_paging ( page_directory_t page_directory)

Loads a page directory and enables paging.

Parameters
page_directoryphysical address of a page directory (or 0 if paging should be disabled)

Definition at line 44 of file mmu.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mmu_flush_tlb ( void *  vaddr)

Flushes the Translation Lookaside Buffer for the given page.

This removes any cached mapping from virtual to physical addresses for this page, which is necessary when page directories are modified while they are in use.

Parameters
vaddrthe virtual address of a page to flush

Definition at line 69 of file mmu.c.

+ Here is the caller graph for this function:

uint8_t mmu_get_paging ( )

Returns whether paging is enabled or disabled.

Returns
paging flag

Definition at line 57 of file mmu.c.

+ Here is the caller graph for this function:

static cpu_state_t* mmu_handle_page_fault ( cpu_state_t cpu)
static

Handles page faults.

Parameters
cputhe CPU state
Returns
a (possibly altered) CPU state

Definition at line 80 of file mmu.c.

+ Here is the caller graph for this function:

void mmu_load_page_directory ( page_directory_t page_directory)

Loads a page directory into the CR3 register.

Parameters
page_directoryphysical address of a page directory

Definition at line 34 of file mmu.c.

+ Here is the caller graph for this function: