Allow clients to get the console from the kernel object

This commit is contained in:
Eryn Wells 2016-03-23 01:42:52 -04:00
parent 3ad5e67e66
commit 6aa4453f77
3 changed files with 13 additions and 2 deletions

View file

@ -12,7 +12,7 @@
namespace {
static kernel::Kernel sKernel;
} /* anonymous namespace */
namespace kernel {
@ -55,6 +55,12 @@ Kernel::panic(const char* msg,
halt();
}
Console&
Kernel::console()
{
return mConsole;
}
/*
* Private
*/

View file

@ -27,6 +27,8 @@ struct Kernel
void halt() NORETURN;
Console& console();
private:
Console mConsole;
};

View file

@ -32,7 +32,10 @@ kmain(multiboot::Information *information,
multiboot::Information::setInformation(information);
auto info = multiboot::Information::information();
kernel::Kernel::systemKernel().initialize();
auto& kernel = kernel::Kernel::systemKernel();
kernel.initialize();
auto& console = kernel.console();
console.printFormat("Command line: \"%s\"\n", info->commandLine());