CosmOS had 1,161 bytes of Program Memory left before the address applications load at, and Tab completion is not going to fit in that with anything to spare. So the wall moves up one page: the system keeps below 0x4FFF and 0x2FFF, and an application is based at 0x5000 and 0x3000. A PAGE IS A CHEAP THING TO GIVE IT AND AN EXPENSIVE THING TO RUN OUT OF. An application still has 44K of Program Memory before the vector table and the largest one here uses 7.5K, so what was taken from applications is space nothing has ever asked for - while what the system gained is the difference between building the next thing and counting bytes while building it. Not doubling, which was the version that would have cost application space worth minding. One page, and the same again when it is needed. Nothing in the machine knows where the wall is, so this is 34 #Base lines, one threshold in the fault handler, and the table in the CosmOS README that Tests/docs.sh reads its limits out of. The native assembler's scratch map had to move with it, and docs.sh said so before anything ran: its data reached 0x40D6 and its buffers began at 0x4000, so they were sitting on its variables. That file already carries a paragraph about the floor coming up and the map staying where it was. It has happened twice now, and been caught by a check the first time wrote. Twenty three recordings are the same runs a page higher. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
94 lines
2.2 KiB
NASM
94 lines
2.2 KiB
NASM
; Settle.asm
|
|
; Says how the last start went, and tells the machine to stop falling back.
|
|
;
|
|
; A program rather than a shell command, because the shell is for the things you cannot do
|
|
; without it and this is not one of them. 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 sequence - and none of that is true of a word built into the shell.
|
|
;
|
|
; ---- What settling means ----
|
|
;
|
|
; The loader marks the disk before handing over and the system clears the mark on reaching
|
|
; its prompt, so a mark still set is a start that never arrived. After that the loader uses
|
|
; the fallback and KEEPS USING IT, because a system known not to start should not be tried
|
|
; every other boot for ever.
|
|
;
|
|
; Settling is how it is told that has changed. It does not fix anything and it does not
|
|
; check anything: it says "the situation is different now, try again". Which is why it is a
|
|
; deliberate act by somebody who has just changed something, rather than anything automatic.
|
|
;
|
|
; Written by Anachronaut
|
|
|
|
#Include services.asm
|
|
|
|
#Program
|
|
|
|
#Base 0x5000
|
|
|
|
start:
|
|
SWI osBootState
|
|
MVQA
|
|
SETD.0 State
|
|
STA.0
|
|
|
|
BRA alreadySettled
|
|
|
|
INIB 0d2
|
|
XOR
|
|
BRQ fellBack
|
|
|
|
; Trying. Nothing has gone wrong yet - this is what the disk looks like while a start is
|
|
; still in progress, which from in here means the system that is running has not reached
|
|
; its prompt, which it plainly has. So the mark is stale.
|
|
SETD.0 WasTrying
|
|
SWI osPrintString
|
|
BRI doSettle
|
|
|
|
fellBack:
|
|
SETD.0 WasFallen
|
|
SWI osPrintString
|
|
|
|
doSettle:
|
|
SWI osBootSettle
|
|
MVQA
|
|
BNA settleFailed
|
|
SETD.0 Settled
|
|
SWI osPrintString
|
|
RSTA
|
|
SWI osExit
|
|
|
|
settleFailed:
|
|
SETD.0 NoDisk
|
|
SWI osPrintString
|
|
INIA 0d1
|
|
SWI osExit
|
|
|
|
alreadySettled:
|
|
SETD.0 Already
|
|
SWI osPrintString
|
|
RSTA
|
|
SWI osExit
|
|
|
|
#Data
|
|
|
|
#Base 0x3000
|
|
|
|
WasTrying:
|
|
"the disk says a start is still in progress
|
|
"
|
|
WasFallen:
|
|
"the disk says the last start did not arrive, so this is the fallback
|
|
"
|
|
Settled:
|
|
"settled: the next start will use the configuration again
|
|
"
|
|
Already:
|
|
"already settled: the next start will use the configuration
|
|
"
|
|
NoDisk:
|
|
"nothing to settle: no disk answered
|
|
"
|
|
|
|
State:
|
|
0x00
|