void System::main() { int i = 0; enable(); devices.printDevices(video, WinMain); video.putc(WinMain, '\n'); restart(console.start(WinMain)); }
void Devices::printDevices(Video &IO, int window) /* Prints a list of detected drives to a window */ { int i; char str[21]; /* ntostr(numFD, str); IO.prints(window, "\nFD Drives Detected: "); IO.prints(window, str); ntostr(numHD, str); IO.prints(window, "\nHD Drives Detected: "); IO.prints(window, str);*/ for(i = 0; i <= 1; i++) { IO.prints(window, "\nDrive "); /* Prints floppy drives installed */ IO.putc(window, 'A' + i); IO.prints(window, ": "); switch(floppy[i]) { case 1: IO.prints(window, "360kb 5.25in"); break; case 2: IO.prints(window, "1.2mb 5.25in"); break; case 3: IO.prints(window, "720kb 3.5in"); break; case 4: IO.prints(window, "1.44mb 3.5in"); break; case 5: IO.prints(window, "2.88mb 3.5in"); break; default: IO.prints(window, "No floppy drive"); } } IO.putc(window, '\n'); }
void System::assert(int Window, char expr, char *error_msg) /*Different levels of kernel errors, only one so far.*/ { video.setcolour(Window, TRED | BBLUE | BLINK); /*print error in red*/ video.prints(Window, "\n Error: "); video.setcolour(Window, TRED | BBLUE); video.prints(Window, error_msg); video.putc(Window, '\n'); switch (expr) { case 1: /*level one. No need to restart*/ video.setcolour(Window, TCYAN | BBLUE); return; default: /*level zero. restart required.*/ video.prints(Window, " System halted."); video.hidecursor(true); break; } restart(0); }