Complete keyboard implementation

This commit is contained in:
Baptiste Wicht 2014-01-30 17:29:35 +01:00
parent 1199b98558
commit 586aeaedcf

View File

@ -102,6 +102,10 @@ volatile uint8_t count;
spinlock lock; spinlock lock;
sleep_queue queue; sleep_queue queue;
void give_char(scheduler::pid_t pid, char t){
scheduler::get_process(pid).regs.eax = t;
}
void keyboard_handler(const interrupt::syscall_regs&){ void keyboard_handler(const interrupt::syscall_regs&){
auto key = static_cast<char>(in_byte(0x60)); auto key = static_cast<char>(in_byte(0x60));
@ -116,8 +120,7 @@ void keyboard_handler(const interrupt::syscall_regs&){
++count; ++count;
} else { } else {
auto pid = queue.wake_up(); auto pid = queue.wake_up();
give_char(pid, key);
//TODO Give key to process pid
} }
} }
} }
@ -140,8 +143,7 @@ void keyboard::get_char_blocking(){
--count; --count;
auto pid = scheduler::get_pid(); auto pid = scheduler::get_pid();
give_char(pid, key);
//TODO Give key to process pid
} else { } else {
//Wait for a char //Wait for a char
queue.sleep(); queue.sleep();