36 lines
877 B
C
36 lines
877 B
C
#ifndef PAGING_H
|
|
#define PAGING_H
|
|
|
|
#include "../include/stdio.h"
|
|
#include <stdint.h>
|
|
|
|
|
|
extern uint32_t kernel_page_directory[1024] __attribute__((aligned(4096)));
|
|
extern uint32_t kernel_page_table[1024] __attribute__((aligned(4096)));
|
|
extern uint32_t user_page_table[1024] __attribute__((aligned(4096)));
|
|
|
|
|
|
//paging.c
|
|
void enablePaging();
|
|
void loadPageDirectory(uint32_t* page_directory);
|
|
void paging_init();
|
|
void test_paging();
|
|
|
|
//page_alloc.c
|
|
void init_allocator();
|
|
void* alloc_page();
|
|
void free_page(void* physaddr);
|
|
|
|
//page_tables.c
|
|
void *get_physaddr(void *virtualaddr);
|
|
void map_page(void* physaddr, void* virtualaddr, unsigned int flags);
|
|
void map_kernel_page(void* virtualaddr, unsigned int flags);
|
|
void* setup_user_process(void* user_code_phys, uint32_t* user_stack_top);
|
|
|
|
//heap.c
|
|
void heap_init();
|
|
void* heap_alloc(uint32_t size);
|
|
void heap_free(void* ptr);
|
|
|
|
#endif
|