B4: the disk remembers whether the last start arrived
The loader marks the superblock before it hands over and the system clears the mark when it reaches its prompt, so a system that crashes on the way there leaves it set. The loader finding it still set next time is how a machine that will not start says so to the only thing in a position to do anything about it. Without that, pointing boot.cfg at something that dies before the shell is a machine that can never be told anything again - the shell is the only way to change the file, and the file is what stops the shell from starting. Three states rather than two, and the third is the one worth having: 0 settled the last start arrived; use the configuration 1 trying handed over, and nothing came back to say it got there 2 fell back a try failed and the fallback was used, until settled With only 0 and 1 the machine alternates for ever: fall back, reach a prompt, clear the mark, retry the broken system, crash, fall back. State 2 stops that. A system known not to start is not tried again until somebody says the situation has changed. REACHING THE PROMPT IS A DELIBERATE THRESHOLD. It is not a claim that the system works - a shell can be reached by something broken in every other way. It is the point where a person can type, which is exactly what the fallback exists to give back: anything wrong past there is fixable from the prompt and nothing wrong before it is fixable at all. The routines live in sbfs.asm because both the loader and the system read and write this byte, and two pieces of code with their own idea of where a byte lives is what this format has two implementations and a byte for byte comparison to avoid. And the trap this system documents in its own manual caught me anyway: the first version handed the state back in A, which CALL restores, so every read got whatever the caller happened to be holding. It comes back in memory now, and the comment says why. Three disks differing only in the state on them, so the tests read as three consecutive starts of one machine while none depends on another running.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
stage two
|
||||
no /System/Boot/cosmos.bin
|
||||
trying the fallback
|
||||
nothing to start
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
stage two
|
||||
a system that never reaches a prompt
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
@@ -0,0 +1,8 @@
|
||||
stage two
|
||||
the last start did not arrive
|
||||
CosmOS
|
||||
this is the fallback: what boot.cfg asks for did not start
|
||||
>
|
||||
halted
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
@@ -0,0 +1,8 @@
|
||||
stage two
|
||||
still on the fallback: settle it to try again
|
||||
CosmOS
|
||||
this is the fallback: what boot.cfg asks for did not start
|
||||
>
|
||||
halted
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
Reference in New Issue
Block a user