fixed really all bugs, for real

main
Simon 5 months ago
parent 0a150eb84b
commit 7c1f380184

@ -122,10 +122,7 @@ bool fetch(Key &pressed) {
pressed = key_decoder.decode(out_buffer);
if (pressed.alt() || pressed.ctrl() || !pressed.valid())
return false;
else
return true;
return true;
}
void setRepeatRate(Speed speed, Delay delay) {

@ -20,7 +20,7 @@
* \ref TextWindow and only implements the method \ref TextStream::flush().
* Further formatting or special effects are implemented in \ref TextWindow.
*/
class TextStream: public OutputStream, protected TextWindow {
class TextStream: public OutputStream, public TextWindow {
// Prevent copies and assignments
TextStream(const TextStream&) = delete;
TextStream& operator=(const TextStream&) = delete;

@ -8,7 +8,9 @@ extern Key kout_key;
namespace Epilogues {
void keyboard(Vault& g) {
g.kout.setPos(0,0);
g.kout << kout_key.ascii() << flush ;
}
void timer(Vault& g) { (void)g; }

@ -25,7 +25,7 @@ Guarded::~Guarded() { Guard::leave(); }
Guarded Guard::enter() {
epi_flag FOR_CURRENT_CORE = true;
Core::Interrupt::enable();
//Core::Interrupt::enable();
global_lock.lock();
return Guarded(global_vault);
}
@ -34,16 +34,17 @@ void Guard::leave() {
bool istate = Core::Interrupt::disable();
Epilogue next;
global_lock.unlock();
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
Core::Interrupt::enable();
global_lock.lock();
next(global_vault);
global_lock.unlock();
Core::Interrupt::disable();
}
epi_flag FOR_CURRENT_CORE = false;
global_lock.unlock();
Core::Interrupt::restore(istate);
}
void Guard::relay(Epilogue handler) {
//if(!epilogue_queue FOR_CURRENT_CORE.produce(handler))
// return; // enqueue, but dont execute
@ -62,9 +63,9 @@ void Guard::relay(Epilogue handler) {
epi_flag FOR_CURRENT_CORE = true;
global_lock.lock();
handler(global_vault);
global_lock.unlock();
leave();
}
epilogue_queue->consume(handler);
//epilogue_queue->consume(handler);
}

@ -79,15 +79,16 @@ extern Vault keyboard_vault;
void handle_keyboard() {
//Key key = Key();
if (PS2Controller::fetch(kout_key)) {
Guard::relay(Epilogues::keyboard);
LAPIC::endOfInterrupt();
if (kout_key.ctrl() && kout_key.alt() && kout_key.scancode == Key::KEY_DEL)
System::reboot();
Guard::relay(Epilogues::keyboard);
//koutlock.lock();
//kout << key.ascii() << endl << flush ;
//koutlock.unlock();
}
else if (kout_key.ctrl() && kout_key.alt() && kout_key.scancode == Key::KEY_DEL)
System::reboot();
LAPIC::endOfInterrupt();
else
LAPIC::endOfInterrupt();
}
[[gnu::interrupt]] void handle_panic(InterruptContext *context) {

@ -39,15 +39,16 @@ void Application::action() { // NOLINT
{
Guarded g = Guard::enter();
//g.vault();
while(text[cnt++] != '\n'){
DBG << cnt;
}
g.vault().kout.setPos((unsigned)0,(unsigned)Core::getID()*2+1);
g.vault().kout << cnt++ << flush;
//g.vault().kout << endl << flush;
//Guard::leave();
//koutlock.unlock();
}
Core::pause();
activeWaitDelay(100000000);
//activeWaitDelay(1000000000);
if(cnt >= sizeof(text)-1)
cnt=0;

Loading…
Cancel
Save