14 #define VMM_PAGEDIR ((page_directory_t*) 0xFFFFF000) 15 #define VMM_PAGETAB(i) ((page_table_t*) (0xFFC00000 + (i) * PAGE_SIZE)) 21 VMM_KERNEL = 0b0, VMM_USER = 0b1, VMM_WRITABLE = 0b100
75 void vmm_free(
void* ptr,
size_t len);
page_directory_t * vmm_create_page_directory()
Creates an empty page directory.
void * vmm_use_virtual_memory(void *vaddr, size_t len, vmm_flags_t flags)
Marks some page(s) as used and maps them into memory.
void vmm_enable_domain_check(uint8_t enable)
Enables or disables domain checking.
void vmm_unmap_range(void *vaddr, size_t len)
Unmaps the given page(s) from memory.
void vmm_modified_page_directory()
Ends a page directory modification.
void * vmm_alloc(size_t len, vmm_flags_t flags)
Marks some page(s) as used and maps them somewhere into memory.
void vmm_map_range(void *vaddr, void *paddr, size_t len, vmm_flags_t flags)
Maps the given page(s) into memory.
An entry in a page table.
void * vmm_map_physical_memory(void *paddr, size_t len, vmm_flags_t flags)
If necessary, maps the given page(s) somewhere into memory.
page_directory_t * vmm_load_page_directory(page_directory_t *new_directory)
Loads a new page directory.
void vmm_unmap(void *_vaddr)
Unmaps the given page from memory.
void vmm_init()
Initializes the VMM.
vmm_flags_t
Whether we are working with kernel or user memory.
void vmm_free(void *vaddr, size_t len)
Frees the given page(s) and unmaps them from memory.
void vmm_use(void *vaddr, void *paddr, size_t len, vmm_flags_t flags)
Marks the given page(s) as used and maps them into memory.
void vmm_destroy_page_directory(page_directory_t *dir_phys)
Destroys a page directory.
An entry in a page directory.
void * vmm_get_physical_address(void *_vaddr)
Translates a virtual address into a physical address.
void vmm_unmap_physical_memory(void *vaddr, size_t len)
If necessary, unmaps the given page(s) from memory.
uint8_t vmm_map(void *_vaddr, void *paddr, vmm_flags_t flags)
Maps the given page into memory.
void vmm_modify_page_directory(page_directory_t *new_directory)
Loads a page directory for temporary modification.
void vmm_dump()
Dumps the current page directory.
void * vmm_use_physical_memory(void *paddr, size_t len, vmm_flags_t flags)
Marks the given page(s) as used and maps them somewhere into memory.