# The BIOS (firmware: run as itself, identified by SHA-1, never shipped) Sources: ps2tek "BIOS File Structure", "BIOS Boot Process", "BIOS EE Syscalls", "BIOS EE Patches", "BIOS IOP Modules", "BIOS PlayStation Compatibility" (tier 3, facts only); the MAME traces (OBSERVED, `../ee-python/docs/mame-oracle.md`). SHA-1s: census.md. ## What is in it A 4 MB ROM (rom0) at 1FC00000h, shared by both CPUs, made of dozens of files indexed by ROMDIR (entries of name, extended-info size, file size; found from the first "RESET" string) (ps2tek). Among them: the EE kernel and EELOAD, OSDSYS (the logo and the browser), PS1DRV (PS1 mode's GPU translator, iop.md) and TBIN (the PS1 BIOS), and the IOP's modular kernel as IRX files (IOPBOOT, SYSMEM, LOADCORE, EXCEPMAN, SIFMAN, CDVDMAN, SECRMAN, SIO2MAN, ...). DVD player ROMs and MechaCon firmware are separate chips' dumps (census.md). ## Boot (ps2tek "BIOS Boot Process"; MAME traces) Both CPUs start at BFC00000h; PRId sends each to its own code (iop.md, OBSERVED in both traces). The EE: **measures its own clock** (SCPH-10000 with COP0.Count, SCPH-39001 by counting H-blanks with a timer; ps2tek), initialises the RDRAM controller (MCH_RICM, MCH_DRD), copies the kernel to 80000000h and enters it at 80001000h, sets up the TLB and the PGIF handler, loads EENULL (the idle thread), initialises SIF and waits for the IOP, then EELOAD loads OSDSYS. The IOP: IOPBOOT, SYSMEM and LOADCORE, then every module from EXCEPMAN on. MAME's two-frame EE trace (SCPH-10000) ends in a five-instruction loop on COP0.Count at 9FC42548h: the clock measurement, or a delay built on it (OBSERVED; which one is to read from the trace's context when M1 runs). **The clock measurement is a timing judge in disguise.** The BIOS compares the EE's Count against another time base; a board whose EE-to-bus or EE-to-video ratio is wrong gives the kernel a wrong clock, and everything the kernel times (alarms, thread delays) follows it. The specification's time base (memory-map.md) makes this exact. **Known kernel bugs that games patch** (ps2tek "BIOS EE Patches"): the alarm functions and some thread functions are buggy, and both the official SDK and ps2sdk install patches through SetSyscall before `main`. The board runs them as the hardware does; nothing to model, everything to keep. ## Policy - **No HLE BIOS** (decision P13): the BIOS always runs as itself, from the player's dump (`MAME_ROMPATH`'s `ps2.zip` or `$PS2_BIOS_DIR`, matched by SHA-1). Play! shows an HLE BIOS is possible (its README: "built-in high-level emulation BIOS"), and it is a different machine: the kernel's timings, bugs and patches would be ours, not Sony's. - For the core's rungs, ee-python uses a **test-harness syscall shim** (its decision E8), never part of this board. - **Fast boot** for gate cases: the slice method (late-era method L1-L3): a state written by ps2-rust after the BIOS has booted to a chosen point (the browser, or the moment a test ELF is loaded) is the start state for Python slices. Side-loading an ELF into a booted kernel uses the kernel's own `LoadExecPS2` path (ps2tek "BIOS EE Syscalls"), driven from that state.