mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 09:35:15 -04:00
Finish implementation of the terminal
This commit is contained in:
parent
75b1381064
commit
380db5f28d
@ -35,6 +35,21 @@ void stdio::virtual_terminal::print(char key){
|
|||||||
k_print(key);
|
k_print(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stdio::virtual_terminal::send_input(char key){
|
||||||
|
//Some input may arrive before the scheduler is started
|
||||||
|
//Loose them
|
||||||
|
if(!scheduler::is_started()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduler::tasklet task;
|
||||||
|
task.fun = &tasklet_handle_input;
|
||||||
|
task.d1 = static_cast<size_t>(key);
|
||||||
|
task.d2 = reinterpret_cast<size_t>(this);
|
||||||
|
|
||||||
|
scheduler::irq_register_tasklet(task);
|
||||||
|
}
|
||||||
|
|
||||||
void stdio::virtual_terminal::handle_input(char key){
|
void stdio::virtual_terminal::handle_input(char key){
|
||||||
if(canonical){
|
if(canonical){
|
||||||
//Key released
|
//Key released
|
||||||
@ -76,21 +91,6 @@ void stdio::virtual_terminal::handle_input(char key){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stdio::virtual_terminal::send_input(char key){
|
|
||||||
//Some input may arrive before the scheduler is started
|
|
||||||
//Loose them
|
|
||||||
if(!scheduler::is_started()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
scheduler::tasklet task;
|
|
||||||
task.fun = &tasklet_handle_input;
|
|
||||||
task.d1 = static_cast<size_t>(key);
|
|
||||||
task.d2 = reinterpret_cast<size_t>(this);
|
|
||||||
|
|
||||||
scheduler::irq_register_tasklet(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t stdio::virtual_terminal::read_input(char* buffer, size_t max){
|
size_t stdio::virtual_terminal::read_input(char* buffer, size_t max){
|
||||||
size_t read = 0;
|
size_t read = 0;
|
||||||
char c;
|
char c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user