diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
commit | e9232199bdd97233dabd59f07c63607c93c0c59c (patch) | |
tree | 66aff19650079c9fc990f75d2ed390dd674cfdaa /src/vmm.cc | |
parent | Add allocator (diff) | |
download | kernel.cpp-e9232199bdd97233dabd59f07c63607c93c0c59c.tar.xz |
Check multiboot2 header length, and if needed map the next page as well
Diffstat (limited to 'src/vmm.cc')
-rw-r--r-- | src/vmm.cc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -78,6 +78,13 @@ Result<uint32_t, vmm::Error> vmm::map(uint32_t addr, const vmm::address dest) { return Result<uint32_t, vmm::Error>{vmm::AddressAlreadyMapped}; } +void vmm::unmap(const address d) { + if (directory[d.table_idx] == 0) return; + page_table table{directory[d.table_idx]}; + table.set(d.page_idx, 0); + vmm::reload(); +} + vmm::page_table::page_table(uint32_t from) { // TODO get flags // convert physical address to a virtual address so we can read it |