2016-03-23 00:33:45 -04:00
|
|
|
/* Kernel.cc
|
|
|
|
* vim: set tw=80:
|
|
|
|
* Eryn Wells <eryn@erynwells.me>
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Kernel object. This is the highest level object in the system.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Kernel.hh"
|
|
|
|
#include "Interrupts.hh"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
static kernel::Kernel sKernel;
|
|
|
|
|
|
|
|
} /* anonymous namespace */
|
|
|
|
|
|
|
|
namespace kernel {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Static
|
|
|
|
*/
|
|
|
|
|
2016-03-23 00:55:42 -04:00
|
|
|
Kernel&
|
2016-03-23 00:33:45 -04:00
|
|
|
Kernel::systemKernel()
|
|
|
|
{
|
2016-03-23 00:55:42 -04:00
|
|
|
return sKernel;
|
2016-03-23 00:33:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Public
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
Kernel::panic(const char* msg,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Private
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
Kernel::halt()
|
|
|
|
{
|
|
|
|
x86::InterruptHandler::systemInterruptHandler().disableInterrupts();
|
|
|
|
for (;;) {
|
|
|
|
asm("hlt");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} /* namespace kernel */
|