Allow clients to get the console from the kernel object
This commit is contained in:
parent
3ad5e67e66
commit
6aa4453f77
3 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -27,6 +27,8 @@ struct Kernel
|
|||
|
||||
void halt() NORETURN;
|
||||
|
||||
Console& console();
|
||||
|
||||
private:
|
||||
Console mConsole;
|
||||
};
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue