Move memory map dump to MemoryManager::initialize
This commit is contained in:
parent
93b11307fa
commit
57aaad7d22
2 changed files with 14 additions and 12 deletions
|
@ -54,18 +54,6 @@ Kernel::initialize(const StartupInformation& startupInformation)
|
|||
kstd::printFormat("Multiboot: start = 0x%08lX\n", u32(multiboot));
|
||||
kstd::printFormat("Command line: \"%s\"\n", multiboot->commandLine());
|
||||
|
||||
kstd::printFormat("Memory map:\n");
|
||||
kstd::printFormat(" available: lower = %ld KB, upper = %ld KB\n",
|
||||
multiboot->lowerMemoryKB(), multiboot->upperMemoryKB());
|
||||
for (auto it = multiboot->memoryMapBegin(); it != multiboot->memoryMapEnd(); ++it) {
|
||||
auto begin = (*it).base;
|
||||
auto end = begin + (*it).length - 1;
|
||||
kstd::printFormat(" begin = 0x%08lX %08lX, end = 0x%08lX %08lX (%s)\n",
|
||||
u32(begin >> 32), u32(begin & 0xFFFFFFFF),
|
||||
u32(end >> 32), u32(end & 0xFFFFFFFF),
|
||||
(*it).type == 1 ? "available" : "reserved");
|
||||
}
|
||||
|
||||
mMemoryManager.initialize(startupInformation);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,20 @@ MemoryManager::MemoryManager()
|
|||
void
|
||||
MemoryManager::initialize(const StartupInformation& startupInformation)
|
||||
{
|
||||
auto multiboot = startupInformation.multibootInformation;
|
||||
kstd::printFormat("Memory map:\n");
|
||||
kstd::printFormat(" available: lower = %ld KB, upper = %ld KB, total = %ld KB\n",
|
||||
multiboot->lowerMemoryKB(), multiboot->upperMemoryKB(),
|
||||
startupInformation.memorySize() / 1024);
|
||||
for (auto it = multiboot->memoryMapBegin(); it != multiboot->memoryMapEnd(); ++it) {
|
||||
auto begin = (*it).base;
|
||||
auto end = begin + (*it).length - 1;
|
||||
kstd::printFormat(" begin = 0x%08lX %08lX, end = 0x%08lX %08lX (%s)\n",
|
||||
u32(begin >> 32), u32(begin & 0xFFFFFFFF),
|
||||
u32(end >> 32), u32(end & 0xFFFFFFFF),
|
||||
(*it).type == 1 ? "available" : "reserved");
|
||||
}
|
||||
|
||||
initializeGDT();
|
||||
mFrameAllocator.initialize(startupInformation);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue