KERNEL: Improved Physical memory allocation code / Code refactor
* Moved tests to a different folder * Adjusted the memory map address locations * Improved readability of `kernel.cpp`
This commit is contained in:
@ -40,6 +40,7 @@ struct BootInfoBlock {
|
||||
|
||||
};
|
||||
|
||||
// TODO Put the BootInfoBlock 1MB above the kernel.
|
||||
const uint32_t BootInfoBlock_pptr = (uint32_t)&kernel_end - 0xC0000000 + 0x1;
|
||||
const uint32_t MemoryMapHeap_pptr = BootInfoBlock_pptr + sizeof(BootInfoBlock);
|
||||
|
||||
const uint32_t pke = ((uint32_t)&kernel_end) - 0xC0000000;
|
||||
const uint32_t BootInfoBlock_pptr = pke + 1000 - sizeof(BootInfoBlock);
|
||||
const uint32_t MemoryMapHeap_pptr = pke + 0x1;
|
||||
|
@ -99,9 +99,8 @@ if (CHECK_FLAG(mbi->flags, 6))
|
||||
// continue to the next block
|
||||
mmap = (multiboot_memory_map_t *) ((unsigned long) mmap + mmap->size + sizeof(mmap->size));
|
||||
|
||||
CurrentInfoBlock->next = (MemoryInfoBlock*) ((uint32_t)CurrentInfoBlock) + sizeof(MemoryInfoBlock);
|
||||
CurrentInfoBlock->next = (MemoryInfoBlock*) CurrentInfoBlock + 16;
|
||||
CurrentInfoBlock = CurrentInfoBlock->next;
|
||||
|
||||
}
|
||||
|
||||
CurrentInfoBlock->next = (MemoryInfoBlock*) 0x0;
|
||||
|
Reference in New Issue
Block a user