BBC MOS Archeology ------------------ The initial MOS 0.10 had sufficient entry points and API implemented for BASIC to run - this was essentially just the VDU driver and the CFS. A lot of the kernel was unimplemented. The MOS code is split into distinct components, suggesting it was built from seperate source files and added together: &C000 : CHARACTER SET &C300 : VDU DRIVERS &DB00 : KERNEL &F200 : CASSETTE FILING SYSTEM &FFA1 : SYSTEM ENTRY BLOCK MOS entry block included JMP (FSCV) as well as several other entries. Only 16 vectors, &0200-&021F. System IRQs not vectored, IRQ1V jumped to after system IRQ handler. &0200 was EVENTV, not USERV, jumps to 'Bad event'. Unsure what IRQ2V does, jumps to 'Bad event'. NMI hardwired to a RTI No buffer vectors, but MOS entries to access buffers. OSBYTE generates 'Bad command' error for unimplemented calls instead of *FX generating this. Only OSBYTE 0-16, 120-145. A lot of unimplemented calls generate errors instead of the mature MOS where if a call does nothing, it does nothing, not generate an error. Three system counters, OSWORD 5/6 reads/writes timer 3. A lot of memory usage very untidy. Kernel zero page scattered around, CFS zero page scattered around. Low OSBYTE calls write memory at &0220+. Different idea of sideways ROM entries. Sideways ROMs selected Electron-style: LDA #12:STA ROMLATCH:STX ROMLATCH Startup code 'prods' ROMLATCH, assumes certain settings case Overflow flag to be set, presumably with something wired to 6502 SO (Set Overflow) pin. ROM HEADERS: &8000 - Cold Entry Point - entered on Hard Reset &8003 - Warm Entry Point - entered on Soft Reset &8006 - ROM type: b7 = service ROM, called at &8000 on reset b6 = language ROM, b1 = Warm entry exists &8007 - Offset of copyright message, points to &80xx &8008 &8009 - ROM title, terminated with &00 &80xx - &00,"(C)" ROM validity string Some different OSBYTEs: OSBYTEs: 120 Close SPOOL/EXEC (moved to OSBYTE 119) 121 error (becomes Scan Keyboard) 122 Set LED state (becomes Scan Keyboard) 123 Enter BRK handler (becomes Printer Dormant) ... 136 nothing (becomes *CODE) 137 *MOTOR 138 *CAT - passes string 'CAT' to FSCV if CFS not selected (later insert byte into buffer) 139 *OPT 140 *TAPE 141 Insert byte into buffer (later *ROM) 142 Read function key string (later enter language) 143 Read number of function keys (later issue service call) 144 *TV 145 nothing Command table includes *DISK, *DISC, *NET, just sets A=4 (disk/disc) and A=3 (net) then jumps to an error. Unknown command passed to FSCV with A=1 No *BASIC command, the MOS just enters whatever sideways ROM is present. The layout of ROMs suggests a future intention to select a ROM using its name as a *command. No extended function keys. Function keys enter &90-&9A into keyboard buffer, cursor keys enter &87-&8B into keyboard buffer.