Skip to content

Commit

Permalink
x86/uart: use symbolic names for uart registers
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler569 committed May 7, 2024
1 parent 2af8267 commit feb5e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 7 additions & 8 deletions kernel/arch/x86/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ static void x86_uart_irq_handler(interrupt_frame *r, void *serial_device) {
}

static void x86_uart_setup(port_addr_t p) {
// TODO: cleanup with registers above
outb(p + 1, 0x00);
outb(p + 3, 0x80);
outb(p + 0, 0x03);
outb(p + 1, 0x00);
outb(p + 3, 0x03);
outb(p + 2, 0xC7);
outb(p + 4, 0x0B);
outb(p + UART_BAUD_HIGH, 0x00);
outb(p + UART_LINE_CTRL, 0x80);
outb(p + UART_BAUD_LOW, 0x03);
outb(p + UART_BAUD_HIGH, 0x00);
outb(p + UART_LINE_CTRL, 0x03);
outb(p + UART_FIFO_CTRL, 0xC7);
outb(p + UART_MODEM_CTRL, 0x0B);
}

void x86_uart_init() {
Expand Down
2 changes: 0 additions & 2 deletions kernel/drv/e1000.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <netinet/in.h>
#include <ng/debug.h>
#include <ng/irq.h>
#include <ng/limine.h>
#include <ng/net.h>
Expand Down

0 comments on commit feb5e36

Please sign in to comment.