diff --git a/prototypes/base/Makefile b/prototypes/base/Makefile index 27c76cc..ee264e4 100644 --- a/prototypes/base/Makefile +++ b/prototypes/base/Makefile @@ -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 diff --git a/prototypes/base/init.cpp b/prototypes/base/init.cpp index 7b6771f..77f0441 100644 --- a/prototypes/base/init.cpp +++ b/prototypes/base/init.cpp @@ -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."); \ No newline at end of file