#include "arch/lapic.h" #include "boot/startup_ap.h" #include "debug/output.h" #include "arch/cga.h" #include "arch/textwindow.h" #include "arch/serial.h" #include "device/serialstream.h" // Main function // (the bootstrap processor starts here)} extern "C" int main() { unsigned int numCPUs = Core::count(); DBG_VERBOSE << "Number of CPUs: " << numCPUs << endl; ////test cga implemantation // CGA::setCursor(1, 2); // unsigned x,y; // CGA::getCursor(x, y); // CGA::setCursor(x+1, y+1); // for(uint8_t i = 0; i < 10; i++) // CGA::show(i, i, i+0x30, CGA::Attribute()); ////test textwindow implemantation //TextWindow tw_global = TextWindow(0, 80, 0, 25, true); //tw_global.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::BLUE, false)); TextWindow kout = TextWindow(0, 80, 0, 12, true); kout.reset(); kout.setPos(0,0); kout.print("Corem ipsum dolor sit amit", 26); kout.setPos(0,-1); kout.print("test", 4, CGA::Attribute(CGA::BLACK, CGA::BLUE)); int x,y; kout.getPos(x,y); kout.setPos(x+1,y); kout.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::BLUE, false)); TextWindow dout0 = TextWindow(0,20,13,10, false); dout0.reset(); dout0.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::BLUE, false)); ////test Serial Serial s = Serial(); s.write('a'); // test SerialStream SerialStream ss = SerialStream(); ss.print("test", 4); ss.setAttribute(SerialStream::UNDERSCORE); ss.print("test", 4); ss.setAttribute(SerialStream::RESET); ss.setForeground(SerialStream::MAGENTA); ss.print("test", 4); ss.setBackground(SerialStream::CYAN); ss.print("test", 4); ss.setPos(10, 10); ss.print("test", 4); /* Start application processors * To avoid unexpected behaviour, make sure that interrupts are not * enabled before the APs are booted. Otherwise it might interfere with the * Startup IPIs or even block devices like keyboard because of a missing EOI */ ApplicationProcessor::boot(); return 0; } // Main function for application processors extern "C" int main_ap() { DBG_VERBOSE << "CPU core " << static_cast(Core::getID()) << " / LAPIC " << static_cast(LAPIC::getID()) << " in main_ap()" << endl; return 0; }