Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
|
#include "mmu.h"
#include "multiboot.h"
#include <stdint.h>
#include "debug.h"
#include "mal.h"
#include "structures.h"
#include "fpinfo.h"
#include "hdef.h"
#include <libc.h>
Macros | |
#define | GLOBAL_BIT (1 << 8) |
Functions | |
void | mapPageC (uintptr_t pd, uintptr_t p, uintptr_t v, uint8_t user) |
void | prepareC (uintptr_t pd, uintptr_t v, uintptr_t *pageList) |
Prepares a Page Directory to receive a mapping by inserting the according Page Table. More... | |
uint32_t | pageCountMapPageC (uintptr_t pd, uintptr_t vaddr) |
tests if there is a page table in pd at vaddr More... | |
void | mapPageWrapper (page_directory_t *dir, uint32_t paddr, uint32_t vaddr, uint8_t user) |
void | initFreePageList (uintptr_t base, uintptr_t length) |
uint32_t * | allocPage () |
Unsafe page allocator. Allocated a page. More... | |
void | freePage (uint32_t *page) |
Frees a page in a really unsafe way. More... | |
void | dumpMmap (uint32_t *mmap_ptr, uint32_t len) |
Despite its unexplicit name, this function initializes the physical memory, preparing the page allocator as well. More... | |
void | mark_kernel_global () |
Marks the whole kernel area as global, preventing TLB invalidations. More... | |
void | initMmu () |
Initializes the MMU, creating the kernel's page directory and switching to it. More... | |
Variables | |
page_directory_t * | kernelDirectory =0 |
The kernel's page directory. More... | |
uint32_t | maxPages = 0 |
The maximal amount of pages available. More... | |
uint32_t | allocatedPages = 0 |
The current allocated amount of pages. More... | |
uint32_t | ramEnd = 0 |
End of memory. More... | |
uint32_t | pageCount = 0 |
uint32_t * | firstFreePage |
First free available page. More... | |
uint32_t | placement_address |
Placement address, this should be unused. More... | |
#define GLOBAL_BIT (1 << 8) |
uint32_t* allocPage | ( | ) |
Unsafe page allocator. Allocated a page.
void dumpMmap | ( | uint32_t * | mmap_ptr, |
uint32_t | len | ||
) |
Despite its unexplicit name, this function initializes the physical memory, preparing the page allocator as well.
mmap_ptr | Pointer to a multiboot-compliant memory map |
len | Length of the memory map structure |
void freePage | ( | uint32_t * | page | ) |
Frees a page in a really unsafe way.
page | The page to free. |
void initFreePageList | ( | uintptr_t | base, |
uintptr_t | length | ||
) |
void initMmu | ( | ) |
Initializes the MMU, creating the kernel's page directory and switching to it.
void mapPageC | ( | uintptr_t | pd, |
uintptr_t | p, | ||
uintptr_t | v, | ||
uint8_t | user | ||
) |
void mapPageWrapper | ( | page_directory_t * | dir, |
uint32_t | paddr, | ||
uint32_t | vaddr, | ||
uint8_t | user | ||
) |
void mark_kernel_global | ( | ) |
Marks the whole kernel area as global, preventing TLB invalidations.
uintptr_t pageCountMapPageC | ( | uintptr_t | pd, |
uintptr_t | vaddr | ||
) |
tests if there is a page table in pd at vaddr
pd | a page directory |
uintptr_t | vaddr |
void prepareC | ( | uintptr_t | pd, |
uintptr_t | v, | ||
uintptr_t * | page_list | ||
) |
Prepares a Page Directory to receive a mapping by inserting the according Page Table.
pd | a page directory |
v | a virtual address |
page_list |
uint32_t allocatedPages = 0 |
The current allocated amount of pages.
uint32_t* firstFreePage |
First free available page.
page_directory_t* kernelDirectory =0 |
The kernel's page directory.
uint32_t maxPages = 0 |
The maximal amount of pages available.
uint32_t pageCount = 0 |
uint32_t placement_address |
Placement address, this should be unused.
uint32_t ramEnd = 0 |
End of memory.