miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
qemu_exit.c File Reference

QEMU isa-debug-exit device implementation. More...

#include <miniOS/qemu_exit.h>
Include dependency graph for qemu_exit.c:

Functions

static void outb (uint16_t port, uint8_t val)
 Write a byte to an I/O port.
void qemu_exit (uint8_t code)
 Exit QEMU via the isa-debug-exit device at port 0xf4.

Detailed Description

QEMU isa-debug-exit device implementation.

Function Documentation

◆ outb()

void outb ( uint16_t port,
uint8_t val )
inlinestatic

Write a byte to an I/O port.

Bare-metal x86-64 port I/O. Matches the outb pattern used elsewhere in the kernel (e.g. keyboard driver, LAPIC).

Parameters
portI/O port address.
valByte to write.
Here is the caller graph for this function:

◆ qemu_exit()

void qemu_exit ( uint8_t code)

Exit QEMU via the isa-debug-exit device at port 0xf4.

Exit QEMU via the isa-debug-exit device.

QEMU computes exit code as (code << 1) | 1: qemu_exit(0) -> QEMU exits 1 (functional test PASS) qemu_exit(1) -> QEMU exits 3 (functional test FAIL / panic)

If QEMU is not running with -device isa-debug-exit,iobase=0xf4,iosize=0x04 this is a no-op (the port write is ignored).

Here is the call graph for this function:
Here is the caller graph for this function: