diff options
Diffstat (limited to 'src/kernel/arch/i386/driver/serial.c')
-rw-r--r-- | src/kernel/arch/i386/driver/serial.c | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |