2017-11-02 21:59:18 -04:00
|
|
|
#include "multiboot.h"
|
2017-11-01 01:01:29 -04:00
|
|
|
#include "logger.h"
|
2017-11-02 12:04:40 -04:00
|
|
|
#include "protected.h"
|
2017-11-03 00:19:48 -04:00
|
|
|
#include "timer.h"
|
2017-11-01 01:01:29 -04:00
|
|
|
|
2017-11-03 01:10:07 -04:00
|
|
|
static void on_timer();
|
|
|
|
|
2017-11-03 22:15:05 -04:00
|
|
|
void init(struct KernelMQ_Multiboot_Info multiboot_info)
|
2017-11-01 00:43:42 -04:00
|
|
|
{
|
2017-11-01 01:01:29 -04:00
|
|
|
logger_initialize();
|
2017-11-01 04:25:39 -04:00
|
|
|
|
2017-11-01 10:45:01 -04:00
|
|
|
print_multiboot_info(multiboot_info);
|
2017-11-01 04:25:39 -04:00
|
|
|
|
2017-11-01 01:01:29 -04:00
|
|
|
logger_info("Kernel initialization started.");
|
2017-11-01 01:26:22 -04:00
|
|
|
|
2017-11-02 12:36:28 -04:00
|
|
|
protected_initialize();
|
2017-11-03 01:10:07 -04:00
|
|
|
|
|
|
|
timer_register_handler(on_timer);
|
2017-11-03 00:19:48 -04:00
|
|
|
timer_initialize(50);
|
2017-11-01 01:26:22 -04:00
|
|
|
|
2017-11-01 01:01:29 -04:00
|
|
|
logger_warn("Nothing to do.");
|
|
|
|
logger_fail("Halt.");
|
2017-11-01 00:43:42 -04:00
|
|
|
}
|
2017-11-03 01:10:07 -04:00
|
|
|
|
|
|
|
void on_timer()
|
|
|
|
{
|
|
|
|
logger_info("Timer tick.");
|
|
|
|
}
|