|
|
|
@ -1,13 +1,59 @@
|
|
|
|
#include "arch/lapic.h"
|
|
|
|
#include "arch/lapic.h"
|
|
|
|
#include "boot/startup_ap.h"
|
|
|
|
#include "boot/startup_ap.h"
|
|
|
|
|
|
|
|
#include "debug/copystream.h"
|
|
|
|
#include "debug/output.h"
|
|
|
|
#include "debug/output.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "arch/cga.h"
|
|
|
|
#include "arch/cga.h"
|
|
|
|
#include "arch/textwindow.h"
|
|
|
|
#include "arch/textwindow.h"
|
|
|
|
#include "arch/serial.h"
|
|
|
|
#include "arch/serial.h"
|
|
|
|
#include "device/serialstream.h"
|
|
|
|
#include "device/serialstream.h"
|
|
|
|
|
|
|
|
#include "device/textstream.h"
|
|
|
|
|
|
|
|
#include "device/ps2controller.h"
|
|
|
|
|
|
|
|
TextStream kout = TextStream(0, 80, 0, 10, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TextStream dout[8] = {
|
|
|
|
|
|
|
|
// TextStream(0 ,20,12,25,false),
|
|
|
|
|
|
|
|
// TextStream(20,40,12,25,false),
|
|
|
|
|
|
|
|
// TextStream(40,60,12,25,false),
|
|
|
|
|
|
|
|
// TextStream(60,80,12,25,false),
|
|
|
|
|
|
|
|
// TextStream(0 ,0 ,0, 0,false),
|
|
|
|
|
|
|
|
// TextStream(0 ,0 ,0, 0,false),
|
|
|
|
|
|
|
|
// TextStream(0 ,0 ,0, 0,false),
|
|
|
|
|
|
|
|
// TextStream(0 ,0 ,0, 0,false),
|
|
|
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
TextStream dout[Core::MAX] = {
|
|
|
|
|
|
|
|
{0, 40, 10, 14},
|
|
|
|
|
|
|
|
{40, 80, 10, 14},
|
|
|
|
|
|
|
|
{0, 40, 14, 18},
|
|
|
|
|
|
|
|
{40, 80, 14, 18},
|
|
|
|
|
|
|
|
{0, 40, 18, 22},
|
|
|
|
|
|
|
|
{40, 80, 18, 22},
|
|
|
|
|
|
|
|
{0, 40, 22, 25},
|
|
|
|
|
|
|
|
{40, 80, 22, 25},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CopyStream copystream[Core::MAX]{
|
|
|
|
|
|
|
|
{&dout[0], &sout},
|
|
|
|
|
|
|
|
{&dout[1], &sout},
|
|
|
|
|
|
|
|
{&dout[2], &sout},
|
|
|
|
|
|
|
|
{&dout[3], &sout},
|
|
|
|
|
|
|
|
{&dout[4], &sout},
|
|
|
|
|
|
|
|
{&dout[5], &sout},
|
|
|
|
|
|
|
|
{&dout[6], &sout},
|
|
|
|
|
|
|
|
{&dout[7], &sout},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OutputStream* copyout[Core::MAX]{
|
|
|
|
|
|
|
|
&dout[0],
|
|
|
|
|
|
|
|
©stream[1],
|
|
|
|
|
|
|
|
&dout[2],
|
|
|
|
|
|
|
|
&dout[3],
|
|
|
|
|
|
|
|
&dout[4],
|
|
|
|
|
|
|
|
&dout[5],
|
|
|
|
|
|
|
|
&dout[6],
|
|
|
|
|
|
|
|
&dout[7]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
TextStream kout = TextStream(0, 80, 0, 12, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main function
|
|
|
|
// Main function
|
|
|
|
// (the bootstrap processor starts here)}
|
|
|
|
// (the bootstrap processor starts here)}
|
|
|
|
@ -55,14 +101,22 @@ extern "C" int main() {
|
|
|
|
kout << "pointer: " << reinterpret_cast<void*>(1994473406541717165ull)
|
|
|
|
kout << "pointer: " << reinterpret_cast<void*>(1994473406541717165ull)
|
|
|
|
<< " -> 0x1badcafefee1dead" << endl;
|
|
|
|
<< " -> 0x1badcafefee1dead" << endl;
|
|
|
|
kout << "smiley: " << static_cast<char>(1) << endl;
|
|
|
|
kout << "smiley: " << static_cast<char>(1) << endl;
|
|
|
|
|
|
|
|
|
|
|
|
/* Start application processors
|
|
|
|
/* Start application processors
|
|
|
|
* To avoid unexpected behaviour, make sure that interrupts are not
|
|
|
|
* To avoid unexpected behaviour, make sure that interrupts are not
|
|
|
|
* enabled before the APs are booted. Otherwise it might interfere with the
|
|
|
|
* 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
|
|
|
|
* Startup IPIs or even block devices like keyboard because of a missing EOI
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
ApplicationProcessor::boot();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationProcessor::boot();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PS2Controller::init();
|
|
|
|
|
|
|
|
Key key = Key();
|
|
|
|
|
|
|
|
while (true){
|
|
|
|
|
|
|
|
if (PS2Controller::fetch(key)) {
|
|
|
|
|
|
|
|
kout << key.ascii() << flush ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,16 +127,21 @@ extern "C" int main_ap() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TextWindow dout0 = TextWindow(0,20,13,19, false);
|
|
|
|
//TextWindow dout0 = TextWindow(0,20,13,19, false);
|
|
|
|
//dout0.reset();
|
|
|
|
//dout0.reset();
|
|
|
|
//dout0.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::RED, false));
|
|
|
|
//dout0.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::RED, false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////test Serial
|
|
|
|
////test Serial
|
|
|
|
Serial s = Serial();
|
|
|
|
//Serial s = Serial();
|
|
|
|
s.write('a');
|
|
|
|
//s.write('a');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//uint8_t from = static_cast<int>(LAPIC::getID()) * 20;
|
|
|
|
|
|
|
|
//uint8_t to = from+20;
|
|
|
|
|
|
|
|
//dout[LAPIC::getID()] = TextStream(from, to, 0, 6, false);
|
|
|
|
|
|
|
|
DBG << "test\n" << flush;
|
|
|
|
|
|
|
|
DBG << static_cast<int>(LAPIC::getID()) << flush;
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|