Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
Macros | Functions | Variables
x86_multiboot/boot/include/mmu.h File Reference
#include "multiboot.h"
#include "structures.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define PAGE_SIZE   4096
 Defines the size of a Page. More...
 

Functions

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 initMmu ()
 Initializes the MMU, creating the kernel's page directory and switching to it. More...
 
void mapPageWrapper (page_directory_t *dir, uint32_t paddr, uint32_t vaddr, uint8_t user)
 

Variables

uint32_t * firstFreePage
 First free available page. More...
 

Macro Definition Documentation

◆ PAGE_SIZE

#define PAGE_SIZE   4096

Defines the size of a Page.

Function Documentation

◆ allocPage()

uint32_t * allocPage ( )

Unsafe page allocator. Allocated a page.

Returns
Virtual address to a free page.

◆ dumpMmap()

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.

Parameters
mmap_ptrPointer to a multiboot-compliant memory map
lenLength of the memory map structure

◆ freePage()

void freePage ( uint32_t *  page)

Frees a page in a really unsafe way.

Parameters
pageThe page to free.

◆ initFreePageList()

void initFreePageList ( uintptr_t  base,
uintptr_t  length 
)

◆ initMmu()

void initMmu ( )

Initializes the MMU, creating the kernel's page directory and switching to it.

◆ mapPageWrapper()

void mapPageWrapper ( page_directory_t dir,
uint32_t  paddr,
uint32_t  vaddr,
uint8_t  user 
)

Variable Documentation

◆ firstFreePage

uint32_t* firstFreePage

First free available page.