polka/src/Kernel.hh

64 lines
1.3 KiB
C++
Raw Normal View History

/* Kernel.hh
* vim: set tw=80:
* Eryn Wells <eryn@erynwells.me>
*/
/**
* Kernel object. This is the highest level object in the system.
*/
#ifndef __KERNEL_HH__
#define __KERNEL_HH__
#include "Attributes.hh"
2016-03-23 00:56:00 -04:00
#include "Console.hh"
#include "Memory.hh"
#include "Multiboot.hh"
#include "kstd/Types.hh"
namespace kernel {
2016-03-25 01:25:21 -04:00
/** Collection of useful tidbits for setting up the system. */
struct StartupInformation
{
2016-03-25 01:25:21 -04:00
/** Starting address of the kernel. */
u32 kernelStart;
2016-03-25 01:25:21 -04:00
/** Ending address (the first address *after* the last) of the kernel. */
u32 kernelEnd;
/** Multiboot's magic value. This should be verified. */
u32 multibootMagic;
2016-03-25 01:25:21 -04:00
/** Pointer to the multiboot information struct. */
multiboot::Information* multibootInformation;
};
2016-03-25 01:25:21 -04:00
/** The kernel itself. */
struct Kernel
{
static Kernel& systemKernel();
2016-03-23 00:56:00 -04:00
Kernel();
/** Initialize the system. */
void initialize(const StartupInformation& startupInformation);
2016-03-23 00:56:00 -04:00
/**
* Put up a panic screen and halt the system.
* @see halt()
*/
void panic(const char* msg, ...);
/** Disable interrupts and halt the system. You will never return from that place... */
void halt() NORETURN;
2016-03-23 00:56:00 -04:00
Console& console();
2016-03-23 00:56:00 -04:00
private:
Console mConsole;
MemoryManager mMemoryManager;
};
} /* namespace kernel */
#endif /* __KERNEL_HH__ */