Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
kprintf.h File Reference

Utility functions for formatted output and serial console management. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  serial_t
 Hardware abstraction layer for serial I/O operations. More...
 

Typedefs

typedef struct serial_t serial_t
 Hardware abstraction layer for serial I/O operations.
 

Functions

void set_kprintf_console (serial_t console)
 Configures the global serial console used by kprintf.
 
int kprintf (const char *format,...)
 Standard formatted print to the serial console.
 

Detailed Description

Utility functions for formatted output and serial console management.

Provides a freestanding implementation of kprintf for kernel-level debugging and serial console output in a freestanding environment.

Author
Abhin Parekadan Jose
Date
2026-05-16

Typedef Documentation

◆ serial_t

typedef struct serial_t serial_t

Hardware abstraction layer for serial I/O operations.

This structure maps generic I/O requests to hardware-specific driver functions (e.g., PL011 UART).

Function Documentation

◆ kprintf()

int kprintf ( const char *  format,
  ... 
)

Standard formatted print to the serial console.

A wrapper around vprintf that handles variadic argument initialization and cleanup.

Parameters
formatFormatting string containing plain text and specifiers.
...Variable arguments matching the specifiers in the format string.
Returns
The total number of characters successfully printed.

◆ set_kprintf_console()

void set_kprintf_console ( serial_t  console)

Configures the global serial console used by kprintf.

Sets the function pointers that kprintf will use to output characters.

Parameters
consoleA serial_t structure containing initialized function pointers.