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

Provides utilities for IO operations with the hardware. More...

#include <stdint.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COM1   0x3F8

Functions

void outb (uint16_t port, uint8_t value)
 Outputs a byte to the specified port.
uint8_t inb (uint16_t port)
 Inputs a byte from the specified port.
void outw (uint32_t port, uint16_t value)
 Outputs 2 bytes to the specified port.
uint16_t inw (uint32_t port)
 Inputs 2 bytes from the specified port.
void outl (uint32_t port, uint32_t value)
 Outputs 4 bytes to the specified port.
uint32_t inl (uint32_t port)
 Inputs 4 bytes from the specified port.
void io_wait (void)
 Write 0 to unused port 0x80 to perform a short pause.
static uint64_t rdmsr (uint32_t msr)
static void wrmsr (uint32_t msr, uint64_t value)

Detailed Description

Provides utilities for IO operations with the hardware.

Author
Matheus Boscariol
Since
15/11/2026

Definition in file io.h.

Macro Definition Documentation

◆ COM1

#define COM1   0x3F8

Definition at line 13 of file io.h.

Function Documentation

◆ inb()

uint8_t inb ( uint16_t port)
inline

Inputs a byte from the specified port.

Parameters
portThe port to input from
Returns
The value input

Definition at line 31 of file io.h.

◆ inl()

uint32_t inl ( uint32_t port)
inline

Inputs 4 bytes from the specified port.

Parameters
portThe port to input from
Returns
The value input

Definition at line 74 of file io.h.

◆ inw()

uint16_t inw ( uint32_t port)
inline

Inputs 2 bytes from the specified port.

Parameters
portThe port to input from
Returns
The value input

Definition at line 52 of file io.h.

◆ io_wait()

void io_wait ( void )
inline

Write 0 to unused port 0x80 to perform a short pause.

Definition at line 83 of file io.h.

Here is the call graph for this function:

◆ outb()

void outb ( uint16_t port,
uint8_t value )
inline

Outputs a byte to the specified port.

Parameters
portThe port to output to
valueThe value to output

Definition at line 22 of file io.h.

◆ outl()

void outl ( uint32_t port,
uint32_t value )
inline

Outputs 4 bytes to the specified port.

Parameters
portThe port to output to
valueThe value to output

Definition at line 65 of file io.h.

◆ outw()

void outw ( uint32_t port,
uint16_t value )
inline

Outputs 2 bytes to the specified port.

Parameters
portThe port to output to
valueThe value to output

Definition at line 43 of file io.h.

◆ rdmsr()

uint64_t rdmsr ( uint32_t msr)
inlinestatic

Definition at line 88 of file io.h.

◆ wrmsr()

void wrmsr ( uint32_t msr,
uint64_t value )
inlinestatic

Definition at line 95 of file io.h.