Two strands, joined because machine.py carries both.
`machine_map` is the canonical description of the hardware: address ranges,
service vectors and the DSP reset port, which used to sit as module constants
beside whichever code happened to use them. An exact-digest `FirmwareProfile`
supplies only what moves between ROM revisions, so profile selection is
evidence rather than a revision-string guess.
`timebase` does the same for the clock. Three constants carried it between
them - pit's 5 cycles an instruction, timers' 5.93, and timers'
INSTRUCTIONS_PER_SECOND at 4,348,000 - and each described a different part
while being imported by whatever needed a rate. The 5 is the 386EX I-modem's;
the 5.93 is the 80C186EB's; the 4,348,000 is the 186's rate on main211's
25.8048 MHz crystal, and it was serving the 20.16 MHz 302/403 as well.
Cycles per instruction is a property of the part and the code mix, so both
186 boards share it. The crystal is a property of the board. Keeping them
apart is what lets one model serve all three:
courier-20.16 20.1600 MHz 5.93 3,399,663 insn/s dsp/x86 5.93
courier-25.8048 25.8048 MHz 5.93 4,351,568 insn/s dsp/x86 4.6328
imodem-386ex 25.0000 MHz 5.00 5,000,000 insn/s
That separation fixes two things. The DSP ratio is not shared by the two 186
boards: docs/asic-pinout.md traces the C5x's CLKIN to the ASIC, which runs
from the shared 40.320 MHz can either way, so the 2806's faster crystal is
the CPU's alone and the DSP does not speed up with it. And timers.py's note
that the crystal cancels is right about the timers - the ratio is CPI/4 on
both boards - but did not cover what takes INSTRUCTIONS_PER_SECOND as an
absolute rate. FRAME_HZ was measured on the live 403 at 20.16 MHz and then
divided into main211's figure, 28% fast on the board it was measured on.
The board is taken from the timer constant the firmware writes: 25,200 counts
is 5.000 ms only at 20.16 MHz and 32,256 only at 25.8048, and the 7.4.16
board checks its own value back at 0x4a83b. Anything unrecognised leaves the
assumed 302/403 in place rather than guessing from it. All three flash
captures identify themselves in agreement with their own ATI7.
The 2806's 60M-instruction boot is byte-identical and still prints its
profile. Elsewhere only timer counts and event instants shift, by the 0.08%
between the rounded 4,348,000 and an exact 5.93/4. Note that every XMF here
programs 0x7e00 - they are all 25.8048 builds - so the 20.16 correction bites
only on the flash captures, and both stall on unimplemented x87 opcodes
before reaching it. It is argued from the documentation and from the boards'
own ATI7, not yet demonstrated by a run that gets that far.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>