Settle is a program, and a machine with no fallback still starts
The boot state opened a loop that could not be closed from inside: the machine said "settle it to try again" and gave you no way to do so. Settle closes it, in 349 bytes. A PROGRAM RATHER THAN A SHELL WORD. The shell is for the things that cannot be done without it, and this is not one - it reaches the system through SWI like anything else, which means it can be replaced, left off a disk, or called by whatever comes to call programs in turn. That last one is the point: a shell word is not callable by anything. Two services for it. osBootState answers in Q, and a machine with no disk answers settled, because there is nothing there to be unsettled about. osBootSettle puts it back. SETTLING IS THE ONLY WRITE A PROGRAM GETS - marking a start as trying or fallen back is the loader's business, and a service that let a program claim either would let it lie about something the loader has no way to check. And a hole the tests walked into, which was mine rather than theirs. With no fallback configured, a failed start left the machine unable to start at all: the mark said do not use the system, and there was nothing else to use. That turns "the last start failed" into "no start is permitted", which is worse than the problem the mark was added to solve. With nothing to fall back to it now tries the configuration again and says so - a failure that was passing recovers, and one that is not leaves the machine exactly where it would have been without any of this, which is the most that can be promised when there is only one thing to start. docs.sh caught both new services having no row in the services table before anything else did.
This commit is contained in:
@@ -433,6 +433,22 @@ wedgeFirst | Boot/stage1.asm | rom | -
|
||||
wedgeSecond | Boot/stage1.asm | rom | - | 90000000 | disks/wedgesecond.img
|
||||
wedgeThird | Boot/stage1.asm | rom | - | 90000000 | disks/wedgethird.img
|
||||
wedgedImage | Boot/wedged.asm | assemble | - | -
|
||||
|
||||
# ---- Closing the loop from inside the machine ----
|
||||
#
|
||||
# A machine that says "settle it to try again" and gives you no way to do so has told you
|
||||
# about a problem it will not let you fix. Settle is a program rather than a shell word:
|
||||
# one job, reached through SWI, replaceable, and callable by anything that comes to call
|
||||
# programs in sequence.
|
||||
cosmosSettle | CosmOS/Source/cosmos.asm | run | settle.in | 90000000 | disks/settle.img
|
||||
# Saying so when there is nothing to settle is as much a part of it as doing it.
|
||||
cosmosSettled | CosmOS/Source/cosmos.asm | run | settle.in | 90000000 | disks/settled.img
|
||||
settleApp | CosmOS/Apps/Settle.asm | assemble | - | -
|
||||
|
||||
# A failed start with NOTHING to fall back to. The mark must not become a reason to refuse
|
||||
# to start at all - a failure that was passing recovers here, and one that is not leaves
|
||||
# the machine exactly where it would have been without any of this.
|
||||
noFallback | Boot/stage1.asm | rom | - | 90000000 | disks/nofallback.img
|
||||
# Reading a disk that has directories on it. The machine can walk a path at this point but
|
||||
# cannot make a directory, so the disk is built by the host tool and read here - which is
|
||||
# the two implementations checking each other rather than either checking itself.
|
||||
|
||||
Reference in New Issue
Block a user