Files
Anachronaut d07b23f90b Rung 2: the machine starts itself off a disk
Stage one exists and works. It is 330 bytes of program and everything it
knows is a thing that will be true forever: which port the disk is on, that
a SplitBit disk begins with its own name, and where two numbers sit in that
first block. Not what a file is, not what a directory is, not that SBFS has
versions. It reads the live boot slot into Program Memory, jumps to the
first byte, and prints one character and halts if there is nothing there.

It is an ordinary boot image for now, so the whole chain runs on machinery
that already exists and the emulator has not been touched. Nothing about it
changes when it moves into ROM except who puts it in memory.

SplitDisk gained "boot" to write a slot and "bootslot" to choose one, kept
apart on purpose: writing a slot and starting from it are different
decisions, and joining them would make every write a commitment. A slot is
always written WHOLE, because one still holding the tail of what was there
before is one whose contents depend on its history, and stage one reads all
of it without knowing where the file stopped.

Three recorded tests, and the pair is the point: two disks differing only
in which slot the superblock names, with payloads that say different
things. One prints "booted" and the other does not, so this is a test of
CHOOSING a slot rather than a test that some bytes were read. The third
boots a disk with no boot area and gets the one character a ROM has room
for. Eight more host checks, including that a slot is padded whole.

Two things worth recording. The first draft used #Align to put the scratch
buffer at 0x8000 and produced a 33K file - thirty two kilobytes of zeroes
in something meant to be a ROM. It is an address, not storage, which is
exactly what the assembler's own scratch map exists to say.

And SplitLint caught the second in code written an hour after the baseline
that catches it. In the blit set-up, RSTA writes a source address of zero
and then RSTA writes a bank number of zero - two unrelated quantities that
are equal by accident, in the most safety critical file in the repository.
It is marked with a reason rather than removed.
2026-08-26 23:31:04 -04:00

34 lines
1.1 KiB
NASM

; slotTest.asm
; Something small to put in a boot slot, so that the chain can be proved end to end.
;
; NO DATA SEGMENT, and that is not tidiness - it is the shape of what stage one can do.
; Stage one reads raw blocks into Program Memory and jumps to the first byte. It places no
; data, because it has no way to know where a payload's data ends and its code begins
; without knowing a format, and knowing a format is the thing ROM must do as little of as
; possible. So a payload either carries no initialised data or arranges its own.
;
; Which is why this prints with INIA and OUTA rather than from a string. The real stage two
; needs a Data Segment, and how it gets one is an open question written up beside this.
;
; Written by Anachronaut
#Program
#Base 0xC000
here:
INIA 0x62 ; "b"
OUTA 0x00
INIA 0x6F ; "o"
OUTA 0x00
INIA 0x6F ; splitlint[redundant-assignment]: a second "o", spelled out like the rest
OUTA 0x00
INIA 0x74 ; "t"
OUTA 0x00
INIA 0x65 ; "e"
OUTA 0x00
INIA 0x64 ; "d"
OUTA 0x00
INIA 0x0A
OUTA 0x00
HALT