|
ginnOS
The reference: libc, the libraries and the kernel
|
Macros | |
| #define | TX_WAIT_LOOPS 100000 |
Enumerations | |
| enum | { COM1_PORT = 0x3F8 , UART_DATA = 0 , UART_INT_ENABLE = 1 , UART_DIVISOR_LOW = 0 , UART_DIVISOR_HIGH = 1 , UART_FIFO_CTRL = 2 , UART_LINE_CTRL = 3 , UART_MODEM_CTRL = 4 , UART_LINE_STATUS = 5 , UART_SCRATCH = 7 } |
| enum | { LINE_CTRL_8BITS = 0x03 , LINE_CTRL_DLAB = 0x80 , FIFO_ENABLE_CLEAR = 0xC7 , MODEM_READY = 0x0B , LINE_STATUS_TX_EMPTY = 0x20 , BAUD_DIVISOR_115200 = 0x0001 } |
Functions | |
| void | serial_initialize (void) |
| minimal COM1 serial port driver (16550 UART), polling-mode transmit. | |
| void | serial_putchar (char c) |
| write a single character to COM1, blocking until the UART is ready. | |
| void | serial_write (const char *str) |
| write a null-terminated string to COM1. | |
| #define TX_WAIT_LOOPS 100000 |
| anonymous enum |
| anonymous enum |
| void serial_initialize | ( | void | ) |
minimal COM1 serial port driver (16550 UART), polling-mode transmit.
intended for kernel debug output: it works before the VGA console is up and is visible headlessly under QEMU with -serial stdio. transmit only blocks by polling the line-status register, so it needs no IRQ and is safe to call from panic and early boot. initialize COM1 (115200 baud, 8N1, FIFO enabled). safe to call once, early in boot, before interrupts are enabled.
| void serial_putchar | ( | char | c | ) |
write a single character to COM1, blocking until the UART is ready.
translates '
' to "\r\n" so terminals render lines correctly.
| c | character to send. |
| void serial_write | ( | const char * | str | ) |
write a null-terminated string to COM1.
| str | string to send. |