mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-16 16:11:42 -04:00
Complete keyboard implementation
This commit is contained in:
parent
1199b98558
commit
586aeaedcf
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user