mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 16:51:33 -04:00
Review non-canonical
This commit is contained in:
parent
8c63db6d0e
commit
a78ae11f34
@ -376,6 +376,10 @@ void system_call_entry(interrupt::syscall_regs* regs){
|
||||
sc_get_input_raw_timeout(regs);
|
||||
break;
|
||||
|
||||
case 0x20:
|
||||
sc_set_canonical(regs);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
sc_clear_screen(regs);
|
||||
break;
|
||||
|
@ -137,11 +137,11 @@ size_t stdio::virtual_terminal::read_input_raw(){
|
||||
size_t stdio::virtual_terminal::read_input_raw(size_t ms){
|
||||
if(raw_buffer.empty()){
|
||||
if(!ms){
|
||||
return static_cast<size_t>(keycode::INVALID);
|
||||
return static_cast<size_t>(keycode::TIMEOUT);
|
||||
}
|
||||
|
||||
if(!input_queue.sleep(ms)){
|
||||
return static_cast<size_t>(keycode::INVALID);
|
||||
return static_cast<size_t>(keycode::TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ size_t stdio::virtual_terminal::read_input_raw(size_t ms){
|
||||
}
|
||||
|
||||
void stdio::virtual_terminal::set_canonical(bool can){
|
||||
logging::logf(logging::log_level::TRACE, "Switched terminal %u canonical mode from %u to %u\n", id, uint64_t(canonical), uint64_t(canonical));
|
||||
logging::logf(logging::log_level::TRACE, "Switched terminal %u canonical mode from %u to %u\n", id, uint64_t(canonical), uint64_t(can));
|
||||
|
||||
canonical = can;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
enum class keycode : size_t {
|
||||
INVALID = 0
|
||||
, TIMEOUT = 1
|
||||
, PRESSED_ESC
|
||||
, PRESSED_DASH
|
||||
, PRESSED_EQUALS
|
||||
|
@ -57,7 +57,7 @@ void print(int64_t v){
|
||||
|
||||
void set_canonical(bool can){
|
||||
size_t value = can;
|
||||
asm volatile("mov rax, 11; mov rbx, %[value]; int 50;"
|
||||
asm volatile("mov rax, 0x20; mov rbx, %[value]; int 50;"
|
||||
:
|
||||
: [value] "g" (value)
|
||||
: "rax", "rbx");
|
||||
|
Loading…
x
Reference in New Issue
Block a user