summaryrefslogtreecommitdiff
path: root/kernel/src/devices/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/devices/serial.c')
-rw-r--r--kernel/src/devices/serial.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/kernel/src/devices/serial.c b/kernel/src/devices/serial.c
index 76bc71a..2d2da51 100644
--- a/kernel/src/devices/serial.c
+++ b/kernel/src/devices/serial.c
@@ -3,13 +3,13 @@
void init_serial()
{
- outb(PORT + 1, 0x00); // Disable all interrupts
- outb(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor)
- outb(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud
- outb(PORT + 1, 0x00); // (hi byte)
- outb(PORT + 3, 0x03); // 8 bits, no parity, one stop bit
- outb(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-byte threshold
- outb(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set
+ outb(PORT + 1, 0x00); // Disable all interrupts
+ outb(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor)
+ outb(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud
+ outb(PORT + 1, 0x00); // (hi byte)
+ outb(PORT + 3, 0x03); // 8 bits, no parity, one stop bit
+ outb(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-byte threshold
+ outb(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set
}
uint8_t serial_received()
@@ -19,7 +19,8 @@ uint8_t serial_received()
char read_serial()
{
- while (serial_received() == 0);
+ while (serial_received() == 0)
+ ;
return (char)inb(PORT);
}
@@ -31,7 +32,8 @@ uint8_t is_transmit_empty()
void write_serial(char c)
{
- while (is_transmit_empty() == 0);
+ while (is_transmit_empty() == 0)
+ ;
outb(PORT, (uint8_t)c);
}