Skip to content
Snippets Groups Projects
Commit aa0de544 authored by Byron Lathi's avatar Byron Lathi
Browse files

print input in terminal read, make kbd loop nicer

parent 200351a3
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,9 @@ uint32_t keyboard_handle_irq()
uint8_t keyboard_get_key()
{
while (!flag);
while (!flag) {
asm volatile ("hlt");
}
flag = 0;
return last_key;
......
......@@ -8,6 +8,7 @@ int32_t terminal_read(int32_t fd, void* buf, int32_t nbytes){
int bytes_read = 0;
while (bytes_read < nbytes) {
uint8_t key = keyboard_get_key();
putc(key);
if (key == '\n') {
*((uint8_t*)buf + bytes_read) = '\0';
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment