diff --git a/prototypes/base/entrypoint.S b/prototypes/base/entrypoint.S index b25bc1e..ba94dae 100644 --- a/prototypes/base/entrypoint.S +++ b/prototypes/base/entrypoint.S @@ -8,6 +8,7 @@ _start: mov $kernel_stack, %esp + push %ebx call compat_call_ctors call init call compat_call_dtors diff --git a/prototypes/base/include/multiboot.hpp b/prototypes/base/include/multiboot.hpp index d8e370b..10121f4 100644 --- a/prototypes/base/include/multiboot.hpp +++ b/prototypes/base/include/multiboot.hpp @@ -33,6 +33,13 @@ namespace multiboot T const & operator [](size_t idx) { return this->data[idx]; } + + const T *begin() const { + return &data[0]; + } + const T *end() const { + return &data[length]; + } } __attribute__((packed)); // Make sure the size is not dependend on the template parameter diff --git a/prototypes/base/init.cpp b/prototypes/base/init.cpp index 77f0441..3aca0a6 100644 --- a/prototypes/base/init.cpp +++ b/prototypes/base/init.cpp @@ -9,7 +9,7 @@ using namespace multiboot; -extern "C" void init(Structure *data) +extern "C" void init(Structure const * data) { Console::main << "Hello World!\n" @@ -23,6 +23,11 @@ extern "C" void init(Structure *data) << "command line: " << data->commandline << "\n" << "count of modules: " << data->modules.length << "\n"; + for(const Module &module : data->modules) { + Console::main + << "Module " << module.name << "\n"; + } + /* PMM::markOccupied(physical_t(0x1500)); for(int i = 0; i < 10; i++) {