2018-12-28 10:30:39 +00:00
|
|
|
#include <dbg.h>
|
2018-12-30 21:44:14 +00:00
|
|
|
#include <stdint.h>
|
2019-01-06 16:33:02 +00:00
|
|
|
#include <gic.h>
|
2018-12-30 21:44:14 +00:00
|
|
|
#include <interrupt.h>
|
2019-01-06 16:33:02 +00:00
|
|
|
#include <timer.h>
|
2018-12-28 09:27:49 +00:00
|
|
|
|
2018-12-31 16:28:04 +00:00
|
|
|
extern "C" void go_usr(void);
|
|
|
|
|
2018-12-28 10:30:39 +00:00
|
|
|
/* KERNEL MAIN */
|
2018-12-28 09:27:49 +00:00
|
|
|
extern "C" int main(int argc, char** argv) {
|
2018-12-28 10:30:39 +00:00
|
|
|
printkl("Welcome to STKARM -- Simple and Trivial Kernel for Advanced Reduced Instruction Set Computer Machines");
|
2018-12-28 09:27:49 +00:00
|
|
|
|
2018-12-31 16:28:04 +00:00
|
|
|
printkl("Installing kernel...");
|
|
|
|
|
|
|
|
printkl("Now firing test software interrupt...");
|
2018-12-30 21:44:14 +00:00
|
|
|
fireswi();
|
|
|
|
|
2019-01-06 16:33:02 +00:00
|
|
|
printkl("Now enabling timer...");
|
2019-01-07 14:57:16 +00:00
|
|
|
Timer::timer[0].set(0x100, Timer::CONTINUOUS, Timer::PRESCALER_128, Timer::LS_OSC);
|
2019-01-06 16:33:02 +00:00
|
|
|
Timer::timer[0].start();
|
2019-01-07 14:57:16 +00:00
|
|
|
Timer::timer[5].set(0x100, Timer::CONTINUOUS, Timer::PRESCALER_16, Timer::LS_OSC);
|
|
|
|
Timer::timer[5].start();
|
|
|
|
|
|
|
|
printkl("Now enabling GIC...");
|
|
|
|
GIC::enable();
|
2019-01-06 16:33:02 +00:00
|
|
|
|
|
|
|
printkl("Now going user...");
|
2018-12-31 16:28:04 +00:00
|
|
|
go_usr();
|
|
|
|
|
|
|
|
printkl("EOK -- End of Kernel -- This point can not be reached");
|
2018-12-28 09:27:49 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-28 10:30:39 +00:00
|
|
|
|