Review non-canonical

This commit is contained in:
Baptiste Wicht 2016-08-18 20:26:54 +02:00
parent 8c63db6d0e
commit a78ae11f34
4 changed files with 9 additions and 4 deletions

View File

@ -376,6 +376,10 @@ void system_call_entry(interrupt::syscall_regs* regs){
sc_get_input_raw_timeout(regs); sc_get_input_raw_timeout(regs);
break; break;
case 0x20:
sc_set_canonical(regs);
break;
case 100: case 100:
sc_clear_screen(regs); sc_clear_screen(regs);
break; break;

View File

@ -137,11 +137,11 @@ size_t stdio::virtual_terminal::read_input_raw(){
size_t stdio::virtual_terminal::read_input_raw(size_t ms){ size_t stdio::virtual_terminal::read_input_raw(size_t ms){
if(raw_buffer.empty()){ if(raw_buffer.empty()){
if(!ms){ if(!ms){
return static_cast<size_t>(keycode::INVALID); return static_cast<size_t>(keycode::TIMEOUT);
} }
if(!input_queue.sleep(ms)){ 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){ 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; canonical = can;
} }

View File

@ -12,6 +12,7 @@
enum class keycode : size_t { enum class keycode : size_t {
INVALID = 0 INVALID = 0
, TIMEOUT = 1
, PRESSED_ESC , PRESSED_ESC
, PRESSED_DASH , PRESSED_DASH
, PRESSED_EQUALS , PRESSED_EQUALS

View File

@ -57,7 +57,7 @@ void print(int64_t v){
void set_canonical(bool can){ void set_canonical(bool can){
size_t value = 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) : [value] "g" (value)
: "rax", "rbx"); : "rax", "rbx");