Compare commits
2 Commits
9ffd22e941
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8135e9ff9 | ||
|
|
c38000e503 |
@@ -69,7 +69,8 @@ enum Vector {
|
|||||||
// Interrupts
|
// Interrupts
|
||||||
KEYBOARD=32,
|
KEYBOARD=32,
|
||||||
PANIC=33,
|
PANIC=33,
|
||||||
TIMER=34
|
TIMER=34,
|
||||||
|
ASS=25
|
||||||
};
|
};
|
||||||
constexpr size_t VECTORS = 256;
|
constexpr size_t VECTORS = 256;
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ void initInterruptHandlers() {
|
|||||||
IDT::InterruptDescriptor::Returning(handle_keyboard_asm));
|
IDT::InterruptDescriptor::Returning(handle_keyboard_asm));
|
||||||
IDT::set(Core::Interrupt::Vector::TIMER,
|
IDT::set(Core::Interrupt::Vector::TIMER,
|
||||||
IDT::InterruptDescriptor::Returning(handle_timer));
|
IDT::InterruptDescriptor::Returning(handle_timer));
|
||||||
// Load the idt pointer
|
IDT::set(Core::Interrupt::Vector::ASS,
|
||||||
|
IDT::InterruptDescriptor::Returning(handle_assassin));
|
||||||
|
// Load the idt pointer
|
||||||
IDT::load();
|
IDT::load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ void Dispatcher::go(Thread *first) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Dispatcher::dispatch(Thread *next) {
|
void Dispatcher::dispatch(Thread *next) {
|
||||||
//lifePointer[Core::getID()] = next;
|
lifePointer[Core::getID()] = next;
|
||||||
lifePointer[Core::getID()]->resume(next);
|
lifePointer[Core::getID()]->resume(next);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,20 @@ Thread::Thread(void* tos) {
|
|||||||
|
|
||||||
#include "../thread/scheduler.h"
|
#include "../thread/scheduler.h"
|
||||||
void Thread::resume(Thread* next) {
|
void Thread::resume(Thread* next) {
|
||||||
Guarded g = Guard::enter();
|
Context *from;
|
||||||
Context *from = &g.vault().sch.active()->context;
|
Context *to;
|
||||||
Context *to = &next->context;
|
|
||||||
|
|
||||||
|
|
||||||
|
from = &this->context;
|
||||||
|
to = &next->context;
|
||||||
|
|
||||||
|
//dispatcher.lifePointer[Core::getID()] = next;
|
||||||
|
DBG << "from: " << hex << from << endl;
|
||||||
|
DBG << "to : " << hex << to << endl << flush;
|
||||||
|
|
||||||
g.vault().sch.dispatcher.lifePointer[Core::getID()] = next;
|
|
||||||
DBG << "from: " << hex << from << endl;
|
|
||||||
DBG << "to : " << hex << to << endl << flush;
|
|
||||||
context_switch(to, from);
|
context_switch(to, from);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::go() {
|
void Thread::go() {
|
||||||
|
|||||||
Reference in New Issue
Block a user