From 86623b76dce72bc611f470e0e9ecad963fd558b2 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 7 Apr 2022 21:25:54 +0200 Subject: kernel: remove the `/tty` device --- src/kernel/arch/i386/driver/serial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/kernel/arch/i386/driver/serial.c') diff --git a/src/kernel/arch/i386/driver/serial.c b/src/kernel/arch/i386/driver/serial.c index d2c34e7..14bb8fd 100644 --- a/src/kernel/arch/i386/driver/serial.c +++ b/src/kernel/arch/i386/driver/serial.c @@ -44,12 +44,11 @@ bool serial_poll_read(char *c) { size_t serial_read(char *buf, size_t len) { irq_interrupt_flag(true); for (size_t i = 0; i < len; i++) { - for (;;) { - if (serial_poll_read(&buf[i])) break; + while (!serial_poll_read(&buf[i])) asm("hlt" ::: "memory"); - } } irq_interrupt_flag(false); + // TODO root driver assumes no partial reads return len; } -- cgit v1.2.3