summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/i386/driver/serial.c5
-rw-r--r--src/kernel/arch/i386/tty/tty.c4
-rw-r--r--src/kernel/arch/io.h1
3 files changed, 2 insertions, 8 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;
}
diff --git a/src/kernel/arch/i386/tty/tty.c b/src/kernel/arch/i386/tty/tty.c
index ab15aba..fa3ce72 100644
--- a/src/kernel/arch/i386/tty/tty.c
+++ b/src/kernel/arch/i386/tty/tty.c
@@ -11,10 +11,6 @@ void tty_init(void) {
serial_write("<3 ", 3);
}
-void tty_read(char *buf, size_t len) {
- serial_read(buf, len);
-}
-
void tty_write(const char *buf, size_t len) {
vga_write(buf, len);
serial_write(buf, len);
diff --git a/src/kernel/arch/io.h b/src/kernel/arch/io.h
index acba67a..ef8cb17 100644
--- a/src/kernel/arch/io.h
+++ b/src/kernel/arch/io.h
@@ -2,7 +2,6 @@
#include <stddef.h>
void tty_init(void);
-void tty_read(char *buf, size_t len);
void tty_write(const char *buf, size_t len);
static inline void _tty_hex(const char *buf, size_t len) {