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