diff --git a/arch/cga.cc b/arch/cga.cc index 4eccf7c..345ee5b 100644 --- a/arch/cga.cc +++ b/arch/cga.cc @@ -1,5 +1,6 @@ #include "cga.h" -#include "arch/ioport.h" +#include "../debug/output.h" +#include "../arch/ioport.h" namespace CGA { diff --git a/arch/textwindow.cc b/arch/textwindow.cc index 0103137..cb0adca 100644 --- a/arch/textwindow.cc +++ b/arch/textwindow.cc @@ -1,6 +1,7 @@ #include "textwindow.h" #include "cga.h" #include "../utils/string.h" +#include "../debug/output.h" TextWindow::TextWindow(unsigned from_col, unsigned to_col, unsigned from_row, unsigned to_row, bool use_cursor) { diff --git a/device/serialstream.cc b/device/serialstream.cc index 7313626..dd405e6 100644 --- a/device/serialstream.cc +++ b/device/serialstream.cc @@ -41,8 +41,6 @@ void SerialStream::reset() { } void SerialStream::setPos(int x, int y) { - //char out[] = {0x1b, '[', 0, 0, ';', 0, 0, 'H', 0}; - //*this << 0x1b; write(0x1b); sout << '['; sout << dec << x; @@ -50,9 +48,6 @@ void SerialStream::setPos(int x, int y) { sout << dec << y; sout << 'H'; flush(); - //itoa(x, &out[2], 10); - //itoa(y, &out[5], 10); - //print( out , strlen(out)); } void SerialStream::print(char* str, int length) { diff --git a/main.cc b/main.cc index fa2d0ae..4452c47 100644 --- a/main.cc +++ b/main.cc @@ -14,6 +14,7 @@ #include "arch/ioapic.h" #include "user/app1/appl.h" #include "sync/ticketlock.h" + TextStream kout = TextStream(0, 80, 0, 10, true); //TextStream dout[8] = { @@ -26,6 +27,7 @@ TextStream kout = TextStream(0, 80, 0, 10, true); // TextStream(0 ,0 ,0, 0,false), // TextStream(0 ,0 ,0, 0,false), //}; + TextStream dout[Core::MAX] = { {0, 40, 10, 14}, {40, 80, 10, 14}, @@ -47,6 +49,7 @@ CopyStream copystream[Core::MAX]{ {&dout[6], &sout}, {&dout[7], &sout}, }; + Ticketlock ticketlock; OutputStream* copyout[Core::MAX]{ @@ -112,10 +115,9 @@ extern "C" int main_ap() { << static_cast(LAPIC::getID()) << " in main_ap()" << endl; Core::Interrupt::enable(); - DBG << "test\n" << flush; - DBG << static_cast(LAPIC::getID()) << endl << flush; + DBG << "App CPU " << static_cast(Core::getID()) << endl << flush; - assert(Core::getID() != 1); + //assert(Core::getID() != 1); Application{}.action(); return 0; diff --git a/sync/ticketlock.h b/sync/ticketlock.h index 9a517d1..c3fc492 100644 --- a/sync/ticketlock.h +++ b/sync/ticketlock.h @@ -4,8 +4,8 @@ #pragma once -#include "arch/core.h" -#include "arch/cache.h" +#include "../arch/core.h" +#include "../arch/cache.h" /*! \brief Using Ticketlocks, it is possible to serialize blocks of code * that might otherwise run in parallel on multiple CPU cores, * or be interleaved due to interrupts or scheduling.