From ca243895ca42acb3e330a5df095d884a80beb3ff Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Thu, 20 Aug 2026 21:42:57 -0400 Subject: [PATCH] Grow the CosmOS disk to 512K, because it has to hold its own source cosmos.img was 256 blocks and two directory blocks: 64K, sixteen files. Ample for a disk that held nothing but programs, and not enough for the thing that comes next. The native assembler reads SOURCE from this disk, and the CosmOS sources alone are 104,142 bytes against the 65,536 a 256 block disk holds - so the machine could not hold its own source code. 2048 blocks and four directory blocks: 512K and room for 32 files. Nothing was recorded that had to change, which is worth saying rather than assuming: dir lists names and does not report free space, so no golden file names a block count. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW --- Programs/makefile | 2 +- Tests/makedisks.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Programs/makefile b/Programs/makefile index 636bd5f..fd01eec 100644 --- a/Programs/makefile +++ b/Programs/makefile @@ -76,7 +76,7 @@ cosmos: $(COSMOS) $(APPS) $(COSMOS_DISK): $(APPS) @mkdir -p $(@D) rm -f $@ - $(DISKTOOL) format $@ 256 2 + $(DISKTOOL) format $@ 2048 4 @for app in $(APPS); do $(DISKTOOL) put $@ $$app; done # The system as well as the disk. Building only the image leaves whatever cosmos.bin was diff --git a/Tests/makedisks.sh b/Tests/makedisks.sh index 5ee3542..10da6a4 100755 --- a/Tests/makedisks.sh +++ b/Tests/makedisks.sh @@ -59,7 +59,11 @@ for i in 1 2 3 4 5 6 7 8; do "$TOOL" put "$DISKS/sbfs.img" "filler$i.txt" >/dev/ # to the hardware, so something has to check that one still gives the machine back. # # notes.txt is there so that loading something that is not a program can be tried too. -"$TOOL" format "$DISKS/cosmos.img" 256 2 >/dev/null +# 512K, and four directory blocks for 32 files. It was 64K and 16, which was ample for a +# disk that held programs and nothing else - but the native assembler reads SOURCE from +# here, and the CosmOS sources alone are 104,142 bytes against the 65,536 a 256 block disk +# holds. A machine that is going to assemble itself has to be able to hold its own source. +"$TOOL" format "$DISKS/cosmos.img" 2048 4 >/dev/null "$ROOT/Assembler" -I "$ROOT/Programs/CosmOS/Source" \ "$ROOT/Programs/CosmOS/Apps/greet.asm" -o "$WORK/greet.sbx" >/dev/null "$TOOL" put "$DISKS/cosmos.img" "$WORK/greet.sbx" >/dev/null