|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
QEMU isa-debug-exit device implementation. More...
#include <miniOS/qemu_exit.h>
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. | |
QEMU isa-debug-exit device implementation.
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).
| port | I/O port address. |
| val | Byte to write. |

| 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).

