|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
QEMU isa-debug-exit device helper. More...
#include <miniOS/types.h>

Go to the source code of this file.
Functions | |
| void | qemu_exit (uint8_t code) |
| Exit QEMU via the isa-debug-exit device. | |
QEMU isa-debug-exit device helper.
Provides qemu_exit() which triggers QEMU's isa-debug-exit device to exit the emulator with a deterministic exit code. Used by functional tests to signal pass/fail without relying on serial output polling.
isa-debug-exit protocol: QEMU exit code = (value_written_to_port << 1) | 1 qemu_exit(0) -> QEMU exits with code 1 (test PASS) qemu_exit(1) -> QEMU exits with code 3 (test FAIL)
Device must be added to QEMU invocation: -device isa-debug-exit,iobase=0xf4,iosize=0x04
| void qemu_exit | ( | uint8_t | code | ) |
Exit QEMU via the isa-debug-exit device.
Writes code to port 0xf4. QEMU translates this to exit code (code << 1) | 1. Call with 0 for PASS (QEMU exits 1), 1 for FAIL (QEMU exits 3).
| code | Exit value to encode. 0 = pass, 1 = fail. |
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).

