LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
serial.h
Go to the documentation of this file.
1
9#ifndef KERNEL_DRIVERS_SERIAL_H
10#define KERNEL_DRIVERS_SERIAL_H
11
12#include <stddef.h>
13#include <stdbool.h>
14#include <stdint.h>
15#include <arch/x86_64/io.h>
16
17#define SERIAL_BAUD_DIVISOR 1
18
23bool get_serial_status(void);
24
30int serial_init(void);
31
37void serial_puts(char *str);
38
43void serial_putc(char c);
44
50void serial_print_int(uint64_t value);
51
58void serial_print_hex(uint64_t address, uint64_t byte_count);
59
60#endif
Provides utilities for IO operations with the hardware.
void serial_puts(char *str)
Prints a string to the serial port.
Definition serial.c:50
int serial_init(void)
Initializes the serial port & output.
Definition serial.c:21
bool get_serial_status(void)
Returns the status of the serial output (enabled or disabled).
Definition serial.c:16
void serial_print_hex(uint64_t address, uint64_t byte_count)
Print a hex number to serial output.
Definition serial.c:118
void serial_putc(char c)
Prints a character to serial port.
Definition serial.c:63
void serial_print_int(uint64_t value)
Prints a number to the serial port.
Definition serial.c:77