Okay, just create a console object when you need one... for now

This commit is contained in:
Eryn Wells 2016-02-28 13:33:20 -05:00
parent e86960a283
commit a7d0607c92
3 changed files with 10 additions and 41 deletions

View file

@ -14,38 +14,30 @@
extern "C"
void
kearly()
{ }
/** The beginning of the world... */
extern "C"
void
kmain()
{
auto console = kernel::Console::systemConsole();
kernel::Console console;
console.clear(kernel::Console::Color::Blue);
console.writeString("Hello world!\n");
console.writeString("Loading system ...\n");
/*
* TODO: The performance of this loop slowed down a _lot_ (7 to 8 orders of
* magnitude according to the busy loop) when I moved this code from
* kearly() to here. I wonder if it has something to do with object
* initialization? Should probably investigate some.
*/
volatile int foo = 0;
int j = 0;
int i = 0;
for (;;) {
if (j == 0) {
if (i == 0) {
console.writeString("--- MARK ---\n");
}
console.writeChar('a' + i);
console.writeChar('\n');
i = (i + 1) % 26;
j = (j + 1) % 500;
for (uint32_t k = 0; k < (2u << 20) - 1; k++) {
foo /= 2;
}
}
}
/** The beginning of the world... */
extern "C"
void
kmain()
{ }