From 3e48e9690d03f48c771bbaf7c9111c57985e4f9d Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Mon, 31 Aug 2026 16:45:17 -0400 Subject: [PATCH] Put a disk of your own in drive 1 make run-voyager and make run-cosmos now attach Disks/personal.img as the second drive. It is made the first time it is wanted and then left alone: a rule with no prerequisites, so make never looks at it again. NOT UNDER build/, and that is the whole point. Everything else in this repository is made from source and can be thrown away without losing anything, so 'clean' empties build/ without a thought - and a disk of your own that a clean deletes is not a disk of your own. It is the one place here where something MADE ON THE MACHINE can live, which starts to matter the moment there are tools on it that make things. Disks/ is in .gitignore for the same reason: what you make on the machine is yours and not the repository's. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW --- .gitignore | 4 ++++ Programs/CosmOS/README.md | 12 ++++++++++++ README.md | 4 ++++ makefile | 34 ++++++++++++++++++++++++++-------- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index a1cccc6..117985d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,7 @@ Source/Emulator/rom.c # their own build outputs and their own compiled binaries. What this repository takes from # them gets vendored deliberately, with a note saying where it came from. /External/ + +# The personal disk 'make run-voyager' puts in drive 1. Made on demand, never rebuilt, and +# not cleaned - it is the one place in here where something made ON the machine can live. +/Disks/ diff --git a/Programs/CosmOS/README.md b/Programs/CosmOS/README.md index b839084..7901ea4 100644 --- a/Programs/CosmOS/README.md +++ b/Programs/CosmOS/README.md @@ -841,6 +841,18 @@ file` - which it is, since there is nowhere for the rest of it to be. remembers the drive it was opened on and returns there for each block. Between them the copy walks back and forth without `Copy` itself knowing there is more than one disk. +### A Disk Of Your Own: + +`make run-voyager` puts a second disk in **drive 1**, at `Disks/personal.img`. It is made the +first time it is needed and then left alone: never rebuilt, never cleaned, never committed. + +That last part is the point. Everything else in this repository is made from source and can be +thrown away without losing anything - but a disk is where something *made on the machine* +lives, and a disk that `make clean` deletes is not a disk of your own. It sits outside +`build/` for exactly that reason, and `Disks/` is in `.gitignore`. + +Delete it by hand if you ever want a fresh one. + ### Where A Program Is Looked For: Three places, tried in order: diff --git a/README.md b/README.md index 5974854..d150f1d 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,10 @@ make run-voyager `make` builds a disk as well as the tools, so there is one to boot. `make run-cosmos` is the same system in the terminal, for a machine with no graphics library. +Both put a second disk in drive 1, at `Disks/personal.img`. It is made once and then never +rebuilt, cleaned or committed: everything else here can be thrown away and made again from +source, and that one is where anything made ON the machine lives. + Then `dir` to see what is there, `load Snake.sbx` and `run` to play something, or `load Asm.sbx` and `run cosmos.asm` to watch the machine build itself. Every source in `Programs/` is on that disk, under `/Source`, so anything not shipped as a diff --git a/makefile b/makefile index ee1e17d..62b9cf3 100644 --- a/makefile +++ b/makefile @@ -160,6 +160,18 @@ APPS = $(patsubst $(PROG_DIR)/CosmOS/Apps/%.asm,$(PROG_BUILD)/CosmOS/Apps $(wildcard $(PROG_DIR)/CosmOS/Apps/*.asm)) COSMOS_DISK = $(PROG_BUILD)/cosmos.img +# ---- A disk that is yours ---- +# +# Drive 1 whenever the system is run, and the only thing in this repository that is never +# rebuilt, never cleaned and never committed. Everything else here is made from source and +# can be thrown away without losing anything; this is the one place where something MADE ON +# THE MACHINE can live, which matters more the moment there are tools on it that make things. +# +# NOT UNDER build/, which is the whole point. 'make clean' empties that, and a disk of your +# own that a clean deletes is not a disk of your own. It is a rule with no prerequisites, so +# once it exists make never looks at it again. +PERSONAL_DISK = Disks/personal.img + # VOYAGER IS NOT IN THE HARD LIST. Everything below it - the assembler, the disk tool, the # linter, the whole test suite - has to build on a machine with no graphics library at all, @@ -589,14 +601,20 @@ disk: $(COSMOS) $(COSMOS_DISK) # THE MACHINE STARTS ITSELF. No image is named, so the emulator shadows its ROM into Program # Memory and that reads the disk for everything else - a boot slot, then a loader, then # whatever /System/Boot/boot.cfg names, or cosmos.bin when it names nothing. -run-cosmos: $(COSMOS_DISK) - $(EMU_RUN) --disk $(COSMOS_DISK) +$(PERSONAL_DISK): + @mkdir -p $(@D) + $(DISKTOOL) format $@ 2048 8 + @echo " That disk is yours. It is drive 1, and nothing in this makefile will touch it" + @echo " again - not clean, not a rebuild. Delete it by hand if you want a new one." + +run-cosmos: $(COSMOS_DISK) $(PERSONAL_DISK) + $(EMU_RUN) --disk $(COSMOS_DISK) --disk $(PERSONAL_DISK) # The same disk with the system handed over directly instead, which is what a debugger does: # memory is placed from outside and nothing on the disk is consulted about it. Useful when the # thing being debugged is the boot chain itself, since it skips the boot chain. -run-cosmos-direct: $(COSMOS) $(COSMOS_DISK) - $(EMU_RUN) --disk $(COSMOS_DISK) $(COSMOS) +run-cosmos-direct: $(COSMOS) $(COSMOS_DISK) $(PERSONAL_DISK) + $(EMU_RUN) --disk $(COSMOS_DISK) --disk $(PERSONAL_DISK) $(COSMOS) # ---- The same disk, on the machine with a screen ---- # @@ -607,11 +625,11 @@ run-cosmos-direct: $(COSMOS) $(COSMOS_DISK) # was built when the disk was made, so a machine whose console has changed will happily boot # an image full of programs written for the old one - and they will draw whatever the old way # now means. Making the disk a dependency of running it is what stops that being a puzzle. -run-voyager: $(COSMOS_DISK) - $(VOY_RUN) --disk $(COSMOS_DISK) +run-voyager: $(COSMOS_DISK) $(PERSONAL_DISK) + $(VOY_RUN) --disk $(COSMOS_DISK) --disk $(PERSONAL_DISK) -run-voyager-direct: $(COSMOS) $(COSMOS_DISK) - $(VOY_RUN) --disk $(COSMOS_DISK) $(COSMOS) +run-voyager-direct: $(COSMOS) $(COSMOS_DISK) $(PERSONAL_DISK) + $(VOY_RUN) --disk $(COSMOS_DISK) --disk $(PERSONAL_DISK) $(COSMOS) # Pull in the dependency rules the assembler wrote with -M, so that touching a library # reassembles every program that includes it.