AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
earlycon.h File Reference

Go to the source code of this file.

Data Structures

struct  earlycon
 An early console's operations. More...

Functions

void earlycon_init (void)
 Sets up the early console at boot, before anything else.
void earlycon_reinit (void)
 Sets up the early console again, once the kernel's command line has been read, since it may choose another console (earlycon=).
int earlycon_puts (char *s)
 Writes a string on the early console.
int earlycon_putc (char c)
 Writes a character on the early console.
int earlycon_on_screen (void)
 Says whether the early console writes on the screen, rather than on a serial port.
void earlycon_disable (void)
 Stops sending the kernel's messages to the early console, once a real console has taken over.
void printk_console (void(*write)(const char *s, size_t len))
 Registers the console that the kernel's messages are written to, besides the message buffer.

Function Documentation

◆ earlycon_disable()

void earlycon_disable ( void )

Stops sending the kernel's messages to the early console, once a real console has taken over.

Definition at line 34 of file printk.c.

References earlycon_disable(), and use_earlycon.

Referenced by earlycon_disable(), kmain(), and vt_probe().

◆ earlycon_init()

void earlycon_init ( void )

Sets up the early console at boot, before anything else.

Definition at line 59 of file earlycon.c.

References earlycon_init(), earlycon_uart, and earlycon::init.

Referenced by aarch64_init(), earlycon_init(), earlycon_init(), and x86_cpu_init().

◆ earlycon_on_screen()

int earlycon_on_screen ( void )

Says whether the early console writes on the screen, rather than on a serial port.

Returns
1 if it writes on the screen, 0 if not

Definition at line 52 of file earlycon.c.

References earlycon_on_screen(), and earlycon_uart.

Referenced by earlycon_on_screen(), and vt_probe().

◆ earlycon_putc()

int earlycon_putc ( char c)

Writes a character on the early console.

Parameters
cthe character
Returns
1 if it was written, 0 if not

Definition at line 23 of file earlycon.c.

References earlycon_putc(), earlycon::putc, UART_DR, UART_FR, and UART_FR_TXFF.

Referenced by earlycon_putc(), earlycon_puts(), and putc().

◆ earlycon_puts()

int earlycon_puts ( char * s)

Writes a string on the early console.

Parameters
sthe string
Returns
how many characters were written

Definition at line 38 of file earlycon.c.

References earlycon_putc(), earlycon_puts(), and earlycon::puts.

Referenced by earlycon_puts(), and puts().

◆ earlycon_reinit()

void earlycon_reinit ( void )

Sets up the early console again, once the kernel's command line has been read, since it may choose another console (earlycon=).

Definition at line 65 of file earlycon.c.

References earlycon_fb, earlycon_fb_available(), earlycon_reinit(), earlycon_uart, earlycon_vga, earlycon::init, kargs_get(), and NULL.

Referenced by aarch64_init(), earlycon_reinit(), earlycon_reinit(), and x86_cpu_init().

◆ printk_console()

void printk_console ( void(* write )(const char *s, size_t len))

Registers the console that the kernel's messages are written to, besides the message buffer.

Parameters
writethe console's write function

Definition at line 47 of file printk.c.

References console_write, and printk_console().

Referenced by printk_console(), and vt_probe().