The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
serial.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* minimal COM1 serial port driver (16550 UART), polling-mode transmit.
5
*
6
* intended for kernel debug output: it works before the VGA console is up
7
* and is visible headlessly under QEMU with `-serial stdio`. transmit only
8
* blocks by polling the line-status register, so it needs no IRQ and is
9
* safe to call from panic and early boot.
10
*/
11
12
#include "
common/stdint.h
"
13
14
/**
15
* initialize COM1 (115200 baud, 8N1, FIFO enabled).
16
* safe to call once, early in boot, before interrupts are enabled.
17
*/
18
void
serial_initialize
(
void
);
19
20
/**
21
* write a single character to COM1, blocking until the UART is ready.
22
* translates '\n' to "\r\n" so terminals render lines correctly.
23
* @param c character to send.
24
*/
25
void
serial_putchar
(
char
c);
26
27
/**
28
* write a null-terminated string to COM1.
29
* @param str string to send.
30
*/
31
void
serial_write
(
const
char
*str);
stdint.h
serial_write
void serial_write(const char *str)
write a null-terminated string to COM1.
Definition
serial.c:100
serial_putchar
void serial_putchar(char c)
write a single character to COM1, blocking until the UART is ready.
Definition
serial.c:83
serial_initialize
void serial_initialize(void)
minimal COM1 serial port driver (16550 UART), polling-mode transmit.
Definition
serial.c:37
src
drivers
serial
serial.h
Generated by
1.18.0