Fix up the build -- all the build errors

This commit is contained in:
Eryn Wells 2016-03-29 12:07:10 -04:00
parent 8411502db5
commit 75af75af4e
6 changed files with 14 additions and 12 deletions

View file

@ -162,7 +162,6 @@ InterruptHandler::doKeyboardInterrupt()
{ {
// Quick 'n dirty read the scancode. // Quick 'n dirty read the scancode.
unsigned int c = 0; unsigned int c = 0;
auto& console = kernel::Console::systemConsole();
do { do {
c = kernel::io::inw(0x60); c = kernel::io::inw(0x60);
kstd::printFormat("Key! (scancode 0x%02X)\n", c); kstd::printFormat("Key! (scancode 0x%02X)\n", c);

View file

@ -44,7 +44,7 @@ Kernel::initialize(const StartupInformation& startupInformation)
{ {
mConsole.clear(kernel::Console::Color::Blue); mConsole.clear(kernel::Console::Color::Blue);
kstd::printString("Loading Polka...\n"); kstd::printFormat("Loading Polka...\n");
kstd::printFormat("Kernel image: start = 0x%08lX, end = 0x%08lX, size = %ld bytes\n", kstd::printFormat("Kernel image: start = 0x%08lX, end = 0x%08lX, size = %ld bytes\n",
startupInformation.kernelStart, startupInformation.kernelEnd, startupInformation.kernelStart, startupInformation.kernelEnd,
@ -76,7 +76,7 @@ Kernel::panic(const char* msg,
{ {
mConsole.clear(Console::Color::Magenta); mConsole.clear(Console::Color::Magenta);
kstd::printString("PANIC! PANIC! PANIC! :-(\n"); kstd::printFormat("PANIC! PANIC! PANIC! :-(\n");
va_list args; va_list args;
va_start(args, msg); va_start(args, msg);

View file

@ -197,6 +197,8 @@ printFormat(const char* format,
Size Size
} state = Default; } state = Default;
auto& cons = kernel::Kernel::systemKernel().console();
int nchars = 0; int nchars = 0;
Spec spec; Spec spec;
@ -207,14 +209,14 @@ printFormat(const char* format,
state = Percent; state = Percent;
spec.clear(); spec.clear();
} else { } else {
printChar(*p); cons.printChar(*p);
nchars++; nchars++;
} }
break; break;
case Percent: case Percent:
if (*p == '%') { if (*p == '%') {
state = Default; state = Default;
printChar(*p); cons.printChar(*p);
nchars++; nchars++;
} else if (Char::isDigit(*p)) { } else if (Char::isDigit(*p)) {
if (*p == '0' && !spec.zeroPadded) { if (*p == '0' && !spec.zeroPadded) {
@ -247,7 +249,7 @@ printFormat(const char* format,
} }
break; break;
default: default:
printChar(*p); cons.printChar(*p);
nchars++; nchars++;
break; break;
} }
@ -317,7 +319,7 @@ printFormat(const char* format,
spec.type = Spec::Type::String; spec.type = Spec::Type::String;
break; break;
} }
nchars += spec.print(kernel::systemKernel().console()); nchars += spec.print(cons);
continue; continue;
} }

View file

@ -15,8 +15,8 @@ namespace kstd {
* @return Number of characters printed * @return Number of characters printed
* @{ * @{
*/ */
int printFormat(const char* format, ...) PRINTF(2,3); int printFormat(const char* format, ...) PRINTF(1,2);
int printFormat(const char* format, va_list args); int printFormat(const char* format, va_list args);
/** @} */ /** @} */
} /* namespace kstd */ } /* namespace kstd */

View file

@ -7,6 +7,7 @@
*/ */
#include "Memory.hh" #include "Memory.hh"
#include "kstd/PrintFormat.hh"
namespace kernel { namespace kernel {
@ -15,10 +16,10 @@ namespace kernel {
*/ */
void void
MemoryManager::initialize(Console& console) MemoryManager::initialize()
{ {
initializeGDT(); initializeGDT();
console.printString("GDT loaded\n"); kstd::printFormat("GDT loaded\n");
} }
/* /*

View file

@ -17,7 +17,7 @@ namespace kernel {
struct MemoryManager struct MemoryManager
{ {
void initialize(Console& console); void initialize();
private: private:
x86::GDT mGDT; x86::GDT mGDT;