You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
962 B
C++
44 lines
962 B
C++
#include "epilogues.h"
|
|
|
|
#include "../debug/output.h"
|
|
#include "../arch/core.h"
|
|
#include "../arch/lapic.h"
|
|
#include "guard.h"
|
|
#include "../thread/scheduler.h"
|
|
|
|
extern Key kout_key;
|
|
|
|
#include "../user/app1/appl.h"
|
|
extern Application application1;
|
|
namespace Epilogues {
|
|
|
|
void keyboard(Vault& v) {
|
|
v.kout.setPos(0,0);
|
|
v.kout << kout_key.ascii() << flush ;
|
|
|
|
if(kout_key.scancode == Key::KEY_K)
|
|
v.sch.kill(v.sch.dispatcher.lifePointer[3]);
|
|
}
|
|
|
|
void timer(Vault& v) {
|
|
static int counter = 0;
|
|
int x, y;
|
|
if(Core::getID() == 0) {
|
|
v.kout.getPos(x, y);
|
|
v.kout.setPos(65, 0);
|
|
v.kout << counter++ << flush;
|
|
v.kout.setPos(x, y);
|
|
}
|
|
DBG << "timer C:" << dec << Core::getID() << " L:" << LAPIC::getID() << "\n" << flush;
|
|
|
|
v.sch.resume(true);
|
|
}
|
|
|
|
void assassin(Vault& v) {
|
|
DBG << "assassin epilog\n"<< endl;
|
|
if (v.sch.active()->kill_flag) {
|
|
v.sch.exit();
|
|
}
|
|
}
|
|
}; // namespace Epilogues
|