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:
|
_start:
|
||||||
mov $kernel_stack, %esp
|
mov $kernel_stack, %esp
|
||||||
|
|
||||||
|
push %ebx
|
||||||
call compat_call_ctors
|
call compat_call_ctors
|
||||||
call init
|
call init
|
||||||
call compat_call_dtors
|
call compat_call_dtors
|
||||||
|
|
|
@ -33,6 +33,13 @@ namespace multiboot
|
||||||
T const & operator [](size_t idx) {
|
T const & operator [](size_t idx) {
|
||||||
return this->data[idx];
|
return this->data[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const T *begin() const {
|
||||||
|
return &data[0];
|
||||||
|
}
|
||||||
|
const T *end() const {
|
||||||
|
return &data[length];
|
||||||
|
}
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
// Make sure the size is not dependend on the template parameter
|
// Make sure the size is not dependend on the template parameter
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
using namespace multiboot;
|
using namespace multiboot;
|
||||||
|
|
||||||
extern "C" void init(Structure *data)
|
extern "C" void init(Structure const * data)
|
||||||
{
|
{
|
||||||
Console::main
|
Console::main
|
||||||
<< "Hello World!\n"
|
<< "Hello World!\n"
|
||||||
|
@ -23,6 +23,11 @@ extern "C" void init(Structure *data)
|
||||||
<< "command line: " << data->commandline << "\n"
|
<< "command line: " << data->commandline << "\n"
|
||||||
<< "count of modules: " << data->modules.length << "\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));
|
PMM::markOccupied(physical_t(0x1500));
|
||||||
for(int i = 0; i < 10; i++) {
|
for(int i = 0; i < 10; i++) {
|
||||||
|
|
Loading…
Reference in a new issue