diff options
author | dzwdz | 2022-03-27 14:47:50 +0200 |
---|---|---|
committer | dzwdz | 2022-03-27 14:47:50 +0200 |
commit | 45283c43460900d080478973c873339b5db3013e (patch) | |
tree | cde5d7afdf54fa57b07c8aa5f2a61cc663261445 /src/kernel/arch/i386/tty/serial.c | |
parent | cc16c5d9847da67b3ff369c13712fcae4bebe2ae (diff) |
kernel/tty: poll only on IRQs, don't burn cycles
Diffstat (limited to 'src/kernel/arch/i386/tty/serial.c')
-rw-r--r-- | src/kernel/arch/i386/tty/serial.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/kernel/arch/i386/tty/serial.c b/src/kernel/arch/i386/tty/serial.c index e77ff5c..054f956 100644 --- a/src/kernel/arch/i386/tty/serial.c +++ b/src/kernel/arch/i386/tty/serial.c @@ -14,15 +14,13 @@ static void serial_selftest(void) { void serial_init(void) { // see https://www.sci.muni.cz/docs/pc/serport.txt - - port_out8(COM1 + 1, 0x00); // disable interrupts, we won't be using them - // set baud rate divisor port_out8(COM1 + 3, 0b10000000); // enable DLAB port_out8(COM1 + 0, 0x01); // divisor = 1 (low byte) port_out8(COM1 + 1, 0x00); // (high byte) port_out8(COM1 + 3, 0b00000011); // 8 bits, no parity, one stop bit + port_out8(COM1 + 1, 0x01); // enable the Data Ready IRQ port_out8(COM1 + 2, 0b11000111); // enable FIFO with 14-bit trigger level (???) serial_selftest(); |