Passes multiboot structure to the system.
This commit is contained in:
parent
3ba62396cf
commit
80a7c9dccf
3 changed files with 14 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
_start:
|
||||
mov $kernel_stack, %esp
|
||||
|
||||
push %ebx
|
||||
call compat_call_ctors
|
||||
call init
|
||||
call compat_call_dtors
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue