From 1c4816103e25beea09b3f08a65f65fe65fdde6c4 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Wed, 3 Aug 2016 17:19:53 +0200 Subject: [PATCH] Comments --- kernel/src/virtual_allocator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/src/virtual_allocator.cpp b/kernel/src/virtual_allocator.cpp index aae156cb..f62a5926 100644 --- a/kernel/src/virtual_allocator.cpp +++ b/kernel/src/virtual_allocator.cpp @@ -61,7 +61,10 @@ std::string sysfs_allocated(){ } //end of anonymous namespace void virtual_allocator::init(){ + // The first addressable virtual address is just after the paging structures virtual_start = paging::virtual_paging_start + (paging::physical_memory_pages * paging::PAGE_SIZE); + + // Take the next first aligned 1MiB virtual address first_virtual_address = virtual_start % 0x100000 == 0 ? virtual_start : (virtual_start / 0x100000 + 1) * 0x100000; last_virtual_address = virtual_allocator::kernel_virtual_size; managed_space = last_virtual_address - first_virtual_address;