fixed really all bugs, for real
This commit is contained in:
@@ -122,10 +122,7 @@ bool fetch(Key &pressed) {
|
|||||||
|
|
||||||
pressed = key_decoder.decode(out_buffer);
|
pressed = key_decoder.decode(out_buffer);
|
||||||
|
|
||||||
if (pressed.alt() || pressed.ctrl() || !pressed.valid())
|
return true;
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRepeatRate(Speed speed, Delay delay) {
|
void setRepeatRate(Speed speed, Delay delay) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* \ref TextWindow and only implements the method \ref TextStream::flush().
|
* \ref TextWindow and only implements the method \ref TextStream::flush().
|
||||||
* Further formatting or special effects are implemented in \ref TextWindow.
|
* 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
|
// Prevent copies and assignments
|
||||||
TextStream(const TextStream&) = delete;
|
TextStream(const TextStream&) = delete;
|
||||||
TextStream& operator=(const TextStream&) = delete;
|
TextStream& operator=(const TextStream&) = delete;
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ extern Key kout_key;
|
|||||||
namespace Epilogues {
|
namespace Epilogues {
|
||||||
|
|
||||||
void keyboard(Vault& g) {
|
void keyboard(Vault& g) {
|
||||||
|
g.kout.setPos(0,0);
|
||||||
g.kout << kout_key.ascii() << flush ;
|
g.kout << kout_key.ascii() << flush ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer(Vault& g) { (void)g; }
|
void timer(Vault& g) { (void)g; }
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Guarded::~Guarded() { Guard::leave(); }
|
|||||||
|
|
||||||
Guarded Guard::enter() {
|
Guarded Guard::enter() {
|
||||||
epi_flag FOR_CURRENT_CORE = true;
|
epi_flag FOR_CURRENT_CORE = true;
|
||||||
Core::Interrupt::enable();
|
//Core::Interrupt::enable();
|
||||||
global_lock.lock();
|
global_lock.lock();
|
||||||
return Guarded(global_vault);
|
return Guarded(global_vault);
|
||||||
}
|
}
|
||||||
@@ -34,16 +34,17 @@ void Guard::leave() {
|
|||||||
bool istate = Core::Interrupt::disable();
|
bool istate = Core::Interrupt::disable();
|
||||||
|
|
||||||
Epilogue next;
|
Epilogue next;
|
||||||
|
global_lock.unlock();
|
||||||
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
||||||
Core::Interrupt::enable();
|
Core::Interrupt::enable();
|
||||||
|
global_lock.lock();
|
||||||
next(global_vault);
|
next(global_vault);
|
||||||
|
global_lock.unlock();
|
||||||
Core::Interrupt::disable();
|
Core::Interrupt::disable();
|
||||||
}
|
}
|
||||||
epi_flag FOR_CURRENT_CORE = false;
|
epi_flag FOR_CURRENT_CORE = false;
|
||||||
global_lock.unlock();
|
|
||||||
Core::Interrupt::restore(istate);
|
Core::Interrupt::restore(istate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guard::relay(Epilogue handler) {
|
void Guard::relay(Epilogue handler) {
|
||||||
//if(!epilogue_queue FOR_CURRENT_CORE.produce(handler))
|
//if(!epilogue_queue FOR_CURRENT_CORE.produce(handler))
|
||||||
// return; // enqueue, but dont execute
|
// return; // enqueue, but dont execute
|
||||||
@@ -62,9 +63,9 @@ void Guard::relay(Epilogue handler) {
|
|||||||
epi_flag FOR_CURRENT_CORE = true;
|
epi_flag FOR_CURRENT_CORE = true;
|
||||||
global_lock.lock();
|
global_lock.lock();
|
||||||
handler(global_vault);
|
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() {
|
void handle_keyboard() {
|
||||||
//Key key = Key();
|
//Key key = Key();
|
||||||
if (PS2Controller::fetch(kout_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();
|
//koutlock.lock();
|
||||||
//kout << key.ascii() << endl << flush ;
|
//kout << key.ascii() << endl << flush ;
|
||||||
//koutlock.unlock();
|
//koutlock.unlock();
|
||||||
}
|
}
|
||||||
else if (kout_key.ctrl() && kout_key.alt() && kout_key.scancode == Key::KEY_DEL)
|
else
|
||||||
System::reboot();
|
LAPIC::endOfInterrupt();
|
||||||
|
|
||||||
LAPIC::endOfInterrupt();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[gnu::interrupt]] void handle_panic(InterruptContext *context) {
|
[[gnu::interrupt]] void handle_panic(InterruptContext *context) {
|
||||||
|
|||||||
@@ -39,15 +39,16 @@ void Application::action() { // NOLINT
|
|||||||
{
|
{
|
||||||
Guarded g = Guard::enter();
|
Guarded g = Guard::enter();
|
||||||
//g.vault();
|
//g.vault();
|
||||||
while(text[cnt++] != '\n'){
|
g.vault().kout.setPos((unsigned)0,(unsigned)Core::getID()*2+1);
|
||||||
DBG << cnt;
|
|
||||||
}
|
g.vault().kout << cnt++ << flush;
|
||||||
|
|
||||||
//g.vault().kout << endl << flush;
|
//g.vault().kout << endl << flush;
|
||||||
//Guard::leave();
|
//Guard::leave();
|
||||||
//koutlock.unlock();
|
//koutlock.unlock();
|
||||||
}
|
}
|
||||||
Core::pause();
|
Core::pause();
|
||||||
activeWaitDelay(100000000);
|
//activeWaitDelay(1000000000);
|
||||||
if(cnt >= sizeof(text)-1)
|
if(cnt >= sizeof(text)-1)
|
||||||
cnt=0;
|
cnt=0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user