Expand description
PS1 bare-metal runtime.
Provides the _start entry point that the PSX-EXE loader jumps to,
a panic handler, direct i-cache control, a BIOS TTY debug
trampoline, and optional heap initialisation. Homebrew crates
depend on this crate to get a working main() environment without
thinking about linker symbols or cache-flushing.
§Entry sequence
- The loader (our emulator or the real BIOS) copies the EXE
payload to
LOAD_ADDRand jumps to_start. _startzeroes the.bsssection using the linker-defined__bss_start/__bss_endsymbols.- With the
allocfeature, the bump allocator is seeded from__heap_start..__heap_end. main()is called. When it returns, we halt.
Modules§
- bios
- The runtime’s one remaining BIOS entry point: TTY
putchar. - cache
- Instruction-cache invalidation, done directly on the hardware.
- critical_
section - Critical sections: run code with CPU interrupts masked.
- heap
- Bump allocator gated behind the
allocfeature. - interrupts
- Minimal interrupt support used by engine-level clocks.
- present
- VBlank-kicked presentation: a one-frame-deep queue between the CPU and the
GPU. Built with the
present-queuefeature. - scratchpad
- The CPU scratchpad, and running code with its stack there.
- tty
- TTY output for debug printing.
Structs§
- Peripherals
- Every shared-state peripheral token, handed out once.
Functions§
- _start⚠
- Entry point the PSX-EXE loader jumps to.
- assert_
stack_ headroom - Trap (loudly, via TTY) if the live stack pointer has descended into the static data region.
- halt
- Infinite loop with no useful side effects. Used after
main()returns or from panic / reset paths.