Outs multiboot structure to init(), missing correct parameter passing.

This commit is contained in:
Felix Queißner 2016-05-04 10:40:11 +02:00
parent d8e269a959
commit 3ba62396cf
2 changed files with 18 additions and 2 deletions

View file

@ -35,6 +35,13 @@ kernel-base.ker: $(OBJS)
%.o: src/%.S
$(AS) $(CFLAGS) -c -o obj/$@ $<
# Linux/Multiboot boot specific:
# -kernel bzImage use 'bzImage' as kernel image
# -append cmdline use 'cmdline' as kernel command line
# -initrd file use 'file' as initial ram disk
# -dtb file use 'file' as device tree image
run:
qemu-system-i386 -kernel kernel-base.ker

View file

@ -7,7 +7,9 @@
#include "multiboot.hpp"
#include "compat.h"
extern "C" void init(void)
using namespace multiboot;
extern "C" void init(Structure *data)
{
Console::main
<< "Hello World!\n"
@ -15,13 +17,20 @@ extern "C" void init(void)
<< BColor(Color::Blue) << "Hello blue!" << BColor() << "\n"
<< "Hello default color.\n";
PMM::markOccupied(physical_t(0x1500));
Console::main
<< "multiboot structure: 0x" << data << "\n"
<< "bootloader name: " << data->bootLoaderName << "\n"
<< "command line: " << data->commandline << "\n"
<< "count of modules: " << data->modules.length << "\n";
/*
PMM::markOccupied(physical_t(0x1500));
for(int i = 0; i < 10; i++) {
bool success;
physical_t page(PMM::alloc(success));
Console::main << "allocated page " << i << " [" << success << "]: 0x" << page.data() << "\n";
}
*/
}
static_assert(sizeof(void*) == 4, "Target platform is not 32 bit.");