fixed all bugs
This commit is contained in:
@@ -4,12 +4,10 @@
|
|||||||
#include "guard.h"
|
#include "guard.h"
|
||||||
|
|
||||||
extern Key kout_key;
|
extern Key kout_key;
|
||||||
extern TextStream kout;
|
|
||||||
|
|
||||||
namespace Epilogues {
|
namespace Epilogues {
|
||||||
|
|
||||||
void keyboard(Vault& g) {
|
void keyboard(Vault& g) {
|
||||||
(void)g;
|
|
||||||
g.kout << kout_key.ascii() << endl << flush ;
|
g.kout << kout_key.ascii() << endl << flush ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Guarded Guard::enter() {
|
|||||||
|
|
||||||
void Guard::leave() {
|
void Guard::leave() {
|
||||||
bool istate = Core::Interrupt::disable();
|
bool istate = Core::Interrupt::disable();
|
||||||
|
|
||||||
Epilogue next;
|
Epilogue next;
|
||||||
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
||||||
Core::Interrupt::enable();
|
Core::Interrupt::enable();
|
||||||
@@ -53,15 +53,19 @@ void Guard::relay(Epilogue handler) {
|
|||||||
// handler(global_vault);
|
// handler(global_vault);
|
||||||
// leave();
|
// leave();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
Core::Interrupt::enable(); // goto level 0.5
|
Core::Interrupt::enable(); // goto level 0.5
|
||||||
if(epi_flag FOR_CURRENT_CORE){
|
if(epi_flag FOR_CURRENT_CORE){
|
||||||
epilogue_queue->produce(handler);
|
epilogue_queue->produce(handler);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
epi_flag FOR_CURRENT_CORE = true;
|
epi_flag FOR_CURRENT_CORE = true;
|
||||||
|
global_lock.lock();
|
||||||
handler(global_vault);
|
handler(global_vault);
|
||||||
leave(); // maybe not needed since destructor also calls leave
|
global_lock.unlock();
|
||||||
}
|
}
|
||||||
|
epilogue_queue->consume(handler);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vault &Guard::unsafeConstAccess() { return global_vault; }
|
const Vault &Guard::unsafeConstAccess() { return global_vault; }
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ enum PAGE_FAULT_ERROR {
|
|||||||
kernelpanic("Page fault!");
|
kernelpanic("Page fault!");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern TextStream kout;
|
|
||||||
extern Ticketlock koutlock;
|
extern Ticketlock koutlock;
|
||||||
extern Vault keyboard_vault;
|
extern Vault keyboard_vault;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Test your system on real hardware
|
# Test your system on real hardware
|
||||||
|
|
||||||
NETBOOT_LOCAL="/ibr/adm/user-boot/"
|
NETBOOT_LOCAL="/ibr/adm/user-boot/"
|
||||||
NETBOOT_HOST="y0085044@x1.ibr.cs.tu-bs.de"
|
NETBOOT_HOST="y0080589@x1.ibr.cs.tu-bs.de"
|
||||||
|
|
||||||
# The boot menu shows pairs of `vmlinuz-*` + `initrd-*.img` with owning user and timestamp.
|
# The boot menu shows pairs of `vmlinuz-*` + `initrd-*.img` with owning user and timestamp.
|
||||||
# We just need to choose a name that doesn't overlap with another user's.
|
# We just need to choose a name that doesn't overlap with another user's.
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ Ich bin Großmuttersniffer\n\
|
|||||||
Und wacht sie aus'm Koma auf, kriegt sie von mir 'n Sticker\n\
|
Und wacht sie aus'm Koma auf, kriegt sie von mir 'n Sticker\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
extern TextStream kout;
|
|
||||||
extern Ticketlock koutlock;
|
extern Ticketlock koutlock;
|
||||||
|
|
||||||
void activeWaitDelay(uint64_t cycles) {
|
void activeWaitDelay(uint64_t cycles) {
|
||||||
@@ -41,12 +40,13 @@ void Application::action() { // NOLINT
|
|||||||
Guarded g = Guard::enter();
|
Guarded g = Guard::enter();
|
||||||
//g.vault();
|
//g.vault();
|
||||||
while(text[cnt++] != '\n'){
|
while(text[cnt++] != '\n'){
|
||||||
g.vault().kout << text[cnt-1];
|
g.vault().kout << cnt;
|
||||||
}
|
}
|
||||||
g.vault().kout << endl << flush;
|
//g.vault().kout << endl << flush;
|
||||||
//Guard::leave();
|
//Guard::leave();
|
||||||
//koutlock.unlock();
|
//koutlock.unlock();
|
||||||
}
|
}
|
||||||
|
Core::pause();
|
||||||
activeWaitDelay(1000000000);
|
activeWaitDelay(1000000000);
|
||||||
if(cnt >= sizeof(text)-1)
|
if(cnt >= sizeof(text)-1)
|
||||||
cnt=0;
|
cnt=0;
|
||||||
|
|||||||
Reference in New Issue
Block a user