LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
serial.c File Reference

Serial utilities and configuration. More...

#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <drivers/serial.h>
#include <arch/x86_64/io.h>
Include dependency graph for serial.c:

Go to the source code of this file.

Functions

bool get_serial_status (void)
 Returns the status of the serial output (enabled or disabled).
int serial_init (void)
 Initializes the serial port & output.
void serial_puts (char *str)
 Prints a string to the serial port.
void serial_putc (char c)
 Prints a character to serial port.
void serial_print_int (uint64_t value)
 Prints a number to the serial port.
void serial_print_hex (uint64_t address, uint64_t digit_count)
 Print a hex number to serial output.

Variables

bool serial_enabled = false

Detailed Description

Serial utilities and configuration.

Author
Matheus Boscariol
Since
30/10/2026

Definition in file serial.c.

Function Documentation

◆ get_serial_status()

bool get_serial_status ( void )

Returns the status of the serial output (enabled or disabled).

Returns
The serial output status

Definition at line 16 of file serial.c.

◆ serial_init()

int serial_init ( void )

Initializes the serial port & output.

Returns
0 = self test passed
1 = self test failed

Definition at line 21 of file serial.c.

Here is the call graph for this function:

◆ serial_print_hex()

void serial_print_hex ( uint64_t address,
uint64_t byte_count )

Print a hex number to serial output.

Parameters
addressNumber to print as hex
digit_countDigits to print
Deprecated
Use kprintf()

Definition at line 118 of file serial.c.

Here is the call graph for this function:

◆ serial_print_int()

void serial_print_int ( uint64_t value)

Prints a number to the serial port.

Parameters
valueNumber to print
Deprecated
Use kprintf()

Definition at line 77 of file serial.c.

Here is the call graph for this function:

◆ serial_putc()

void serial_putc ( char c)

Prints a character to serial port.

Parameters
cCharacter to print

Definition at line 63 of file serial.c.

Here is the call graph for this function:

◆ serial_puts()

void serial_puts ( char * str)

Prints a string to the serial port.

Parameters
strString to print
Deprecated
Use kprintf()

Definition at line 50 of file serial.c.

Here is the call graph for this function:

Variable Documentation

◆ serial_enabled

bool serial_enabled = false

Definition at line 15 of file serial.c.