The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
serial.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

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.

Function Documentation

◆ serial_initialize()

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.

◆ serial_putchar()

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.

Parameters
ccharacter to send.

◆ serial_write()

void serial_write ( const char * str)

write a null-terminated string to COM1.

Parameters
strstring to send.