summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/driver/serial.c
diff options
context:
space:
mode:
authordzwdz2022-04-07 21:25:54 +0200
committerdzwdz2022-04-07 21:25:54 +0200
commit86623b76dce72bc611f470e0e9ecad963fd558b2 (patch)
treee9f1204a3761e4389e4b51276c7d359957f4fb86 /src/kernel/arch/i386/driver/serial.c
parentda2bbef4e4f586ecf13cd5ffe9a62df3114a3483 (diff)
kernel: remove the `/tty` device
Diffstat (limited to 'src/kernel/arch/i386/driver/serial.c')
-rw-r--r--src/kernel/arch/i386/driver/serial.c5
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;
}