|
AquilaOS documentation
How it works, and its code
|
x86: the early console on the first serial port (COM1, port 0x3F8), polled: each character waits until the UART can take it. More...
#include <core/system.h>#include <core/string.h>#include <console/earlycon.h>#include <cpu/io.h>#include <mm/mm.h>Go to the source code of this file.
Macros | |
| #define | UART_IER 1 |
| #define | UART_FCR 2 |
| #define | UART_LCR 3 |
| #define | UART_MCR 4 |
| #define | UART_DLL 0 |
| #define | UART_DLH 1 |
| #define | UART_LCR_DLAB 0x80 |
Functions | |
| static void | serial_init (void) |
| Sets the UART up: no interrupts, no FIFO, 38400 baud, 8 bits, no parity, one stop bit. | |
| static int | serial_tx_empty (void) |
| Returns whether the UART's transmit holding register is empty. | |
| static int | serial_chr (char chr) |
| Writes a character, a newline as CR LF. | |
| static int | serial_str (char *str) |
| Writes a string, and returns how many characters it wrote. | |
| static int | earlycon_uart_puts (char *s) |
| static int | earlycon_uart_putc (char c) |
| static void | earlycon_uart_init (void) |
Variables | |
| static struct ioaddr | earlycon_uart_ioaddr |
| struct earlycon | earlycon_uart |
x86: the early console on the first serial port (COM1, port 0x3F8), polled: each character waits until the UART can take it.
Definition in file uart.c.
| #define UART_DLH 1 |
Definition at line 22 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_DLL 0 |
Definition at line 21 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_FCR 2 |
Definition at line 18 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_IER 1 |
Definition at line 17 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_LCR 3 |
Definition at line 19 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_LCR_DLAB 0x80 |
Definition at line 23 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
| #define UART_MCR 4 |
Definition at line 20 of file uart.c.
Referenced by serial_init(), and uart_8250_comm_init().
|
static |
Definition at line 84 of file uart.c.
References earlycon_uart_init(), serial_init(), and serial_str().
Referenced by earlycon_uart_init().
|
static |
Definition at line 79 of file uart.c.
References earlycon_uart_putc(), and serial_chr().
Referenced by earlycon_uart_putc().
|
static |
Definition at line 74 of file uart.c.
References earlycon_uart_puts(), and serial_str().
Referenced by earlycon_uart_puts().
|
static |
Writes a character, a newline as CR LF.
Returns 1. The wait for the UART is bounded, so that a UART that never empties doesn't hang the kernel.
Definition at line 50 of file uart.c.
References earlycon_uart_ioaddr, io_out8(), serial_chr(), and serial_tx_empty().
Referenced by earlycon_uart_putc(), serial_chr(), and serial_str().
|
static |
Sets the UART up: no interrupts, no FIFO, 38400 baud, 8 bits, no parity, one stop bit.
Definition at line 27 of file uart.c.
References earlycon_uart_ioaddr, io_in8(), io_out8(), serial_init(), UART_DLH, UART_DLL, UART_FCR, UART_IER, UART_LCR, UART_LCR_DLAB, and UART_MCR.
Referenced by earlycon_uart_init(), and serial_init().
|
static |
Writes a string, and returns how many characters it wrote.
Definition at line 64 of file uart.c.
References serial_chr(), and serial_str().
Referenced by earlycon_uart_init(), earlycon_uart_puts(), and serial_str().
|
static |
Returns whether the UART's transmit holding register is empty.
Definition at line 42 of file uart.c.
References earlycon_uart_ioaddr, io_in8(), and serial_tx_empty().
Referenced by serial_chr(), and serial_tx_empty().
| struct earlycon earlycon_uart |
Definition at line 92 of file uart.c.
Referenced by earlycon_init(), earlycon_on_screen(), and earlycon_reinit().
|
static |
Definition at line 12 of file uart.c.
Referenced by serial_chr(), serial_init(), and serial_tx_empty().