2016-05-01 18:22:12 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2016-05-02 07:25:08 +00:00
|
|
|
#include "console.hpp"
|
2016-05-03 14:11:36 +00:00
|
|
|
#include "pmm.hpp"
|
|
|
|
#include "numeric.hpp"
|
2016-05-03 15:18:30 +00:00
|
|
|
#include "pointer.hpp"
|
2016-05-04 08:17:56 +00:00
|
|
|
#include "multiboot.hpp"
|
2016-05-01 18:22:12 +00:00
|
|
|
#include "compat.h"
|
|
|
|
|
2016-05-04 08:40:11 +00:00
|
|
|
using namespace multiboot;
|
|
|
|
|
2016-05-04 09:51:23 +00:00
|
|
|
extern "C" void init(Structure const * data)
|
2016-05-01 18:22:12 +00:00
|
|
|
{
|
2016-05-02 07:32:27 +00:00
|
|
|
Console::main
|
|
|
|
<< "Hello World!\n"
|
|
|
|
<< FColor(Color::Yellow) << "Hello color!" << FColor() << "\n"
|
|
|
|
<< BColor(Color::Blue) << "Hello blue!" << BColor() << "\n"
|
2016-05-02 16:17:15 +00:00
|
|
|
<< "Hello default color.\n";
|
2016-05-03 15:18:30 +00:00
|
|
|
|
2016-05-04 08:40:11 +00:00
|
|
|
Console::main
|
|
|
|
<< "multiboot structure: 0x" << data << "\n"
|
|
|
|
<< "bootloader name: " << data->bootLoaderName << "\n"
|
|
|
|
<< "command line: " << data->commandline << "\n"
|
|
|
|
<< "count of modules: " << data->modules.length << "\n";
|
2016-05-03 15:18:30 +00:00
|
|
|
|
2016-05-04 09:51:23 +00:00
|
|
|
for(const Module &module : data->modules) {
|
|
|
|
Console::main
|
|
|
|
<< "Module " << module.name << "\n";
|
|
|
|
}
|
|
|
|
|
2016-05-04 08:40:11 +00:00
|
|
|
/*
|
|
|
|
PMM::markOccupied(physical_t(0x1500));
|
2016-05-03 15:18:30 +00:00
|
|
|
for(int i = 0; i < 10; i++) {
|
2016-05-03 15:07:58 +00:00
|
|
|
bool success;
|
2016-05-03 15:18:30 +00:00
|
|
|
physical_t page(PMM::alloc(success));
|
|
|
|
Console::main << "allocated page " << i << " [" << success << "]: 0x" << page.data() << "\n";
|
2016-05-03 14:11:36 +00:00
|
|
|
}
|
2016-05-04 08:40:11 +00:00
|
|
|
*/
|
2016-05-01 18:22:12 +00:00
|
|
|
}
|
2016-05-03 14:11:36 +00:00
|
|
|
|
|
|
|
static_assert(sizeof(void*) == 4, "Target platform is not 32 bit.");
|