copystream for up to 8 cores
This commit is contained in:
@@ -22,7 +22,6 @@ Serial::Serial(ComPort port, BaudRate baud_rate, DataBits data_bits,
|
|||||||
// FIFO: Enable & clear buffers
|
// FIFO: Enable & clear buffers
|
||||||
writeReg(FIFO_CONTROL_REGISTER,
|
writeReg(FIFO_CONTROL_REGISTER,
|
||||||
ENABLE_FIFO | CLEAR_RECEIVE_FIFO | CLEAR_TRANSMIT_FIFO);
|
ENABLE_FIFO | CLEAR_RECEIVE_FIFO | CLEAR_TRANSMIT_FIFO);
|
||||||
|
|
||||||
// Modem Control: OUT2 (0000 1000) must be set for interrupt
|
// Modem Control: OUT2 (0000 1000) must be set for interrupt
|
||||||
writeReg(MODEM_CONTROL_REGISTER, OUT_2);
|
writeReg(MODEM_CONTROL_REGISTER, OUT_2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,11 +43,10 @@
|
|||||||
* possible that the debug output in a multi core system is displayed
|
* possible that the debug output in a multi core system is displayed
|
||||||
* on the wrong (previous) core.
|
* on the wrong (previous) core.
|
||||||
*/
|
*/
|
||||||
#include "arch/lapic.h"
|
|
||||||
#define DBG dout[LAPIC::getID()]
|
|
||||||
|
|
||||||
#include "../arch/core.h"
|
#include "../arch/core.h"
|
||||||
#include "../device/textstream.h"
|
#include "../device/textstream.h"
|
||||||
|
#define DBG *copyout[Core::getID()]
|
||||||
|
|
||||||
/*! \brief Debug window for the CGA screen
|
/*! \brief Debug window for the CGA screen
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ TextStream::TextStream(unsigned from_col,
|
|||||||
from_row,
|
from_row,
|
||||||
to_row,
|
to_row,
|
||||||
use_cursor){
|
use_cursor){
|
||||||
CGA::Color fg = static_cast<CGA::Color>((LAPIC::getID() + 1 ));
|
//CGA::Color fg = static_cast<CGA::Color>((LAPIC::getID() + 1 ));
|
||||||
this->reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, fg, false));
|
//this->reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, fg, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
58
main.cc
58
main.cc
@@ -1,5 +1,6 @@
|
|||||||
#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"
|
||||||
@@ -8,17 +9,49 @@
|
|||||||
#include "device/serialstream.h"
|
#include "device/serialstream.h"
|
||||||
#include "device/textstream.h"
|
#include "device/textstream.h"
|
||||||
#include "device/ps2controller.h"
|
#include "device/ps2controller.h"
|
||||||
TextStream kout = TextStream(0, 80, 0, 12, true);
|
TextStream kout = TextStream(0, 80, 0, 10, true);
|
||||||
|
|
||||||
TextStream dout[8] = {
|
//TextStream dout[8] = {
|
||||||
TextStream(0 ,20,12,25,false),
|
// TextStream(0 ,20,12,25,false),
|
||||||
TextStream(20,40,12,25,false),
|
// TextStream(20,40,12,25,false),
|
||||||
TextStream(40,60,12,25,false),
|
// TextStream(40,60,12,25,false),
|
||||||
TextStream(60,80,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(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]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -83,7 +116,6 @@ extern "C" int main() {
|
|||||||
if (PS2Controller::fetch(key)) {
|
if (PS2Controller::fetch(key)) {
|
||||||
kout << key.ascii() << flush ;
|
kout << key.ascii() << flush ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -101,8 +133,8 @@ extern "C" int main_ap() {
|
|||||||
|
|
||||||
|
|
||||||
////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 from = static_cast<int>(LAPIC::getID()) * 20;
|
||||||
|
|||||||
Reference in New Issue
Block a user