diff options
Diffstat (limited to 'kernel/src/devices')
| -rw-r--r-- | kernel/src/devices/keyboard.c | 17 | ||||
| -rw-r--r-- | kernel/src/devices/serial.c | 15 |
2 files changed, 18 insertions, 14 deletions
diff --git a/kernel/src/devices/keyboard.c b/kernel/src/devices/keyboard.c index 67c2f19..d631aac 100644 --- a/kernel/src/devices/keyboard.c +++ b/kernel/src/devices/keyboard.c @@ -17,13 +17,16 @@ stdbuff *keyboard_buffer; void init_keyboard() { - // outb(KEYBOARD_CMD_PORT, 0xF3); - // io_wait(); - // outb(KEYBOARD_DATA_PORT, 0x00); - // io_wait(); - // while (!(inb(KEYBOARD_STATUS_PORT) & 1)) {} - // if (inb(KEYBOARD_DATA_PORT) == 0xFA) - // printf("[keyboard init]\n"); + /* + outb(KEYBOARD_CMD_PORT, 0xF3); + io_wait(); + outb(KEYBOARD_DATA_PORT, 0x00); + io_wait(); + while (!(inb(KEYBOARD_STATUS_PORT) & 1)) + ; + if (inb(KEYBOARD_DATA_PORT) == 0xFA) + printf("[keyboard init]\n"); + */ } void keyboard_handler() diff --git a/kernel/src/devices/serial.c b/kernel/src/devices/serial.c index 2d2da51..006f25a 100644 --- a/kernel/src/devices/serial.c +++ b/kernel/src/devices/serial.c @@ -3,13 +3,14 @@ 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() |
