Somewhere to send the fault about there being nowhere to send it
Dispatching through a vector with nothing in it was the one fault this machine could not hand over, because the thing that would hand it over is the thing that has just found nothing to hand it to. It stopped the machine and no program could do anything about it - so calling a service the system does not implement was fatal, and that is an ordinary mistake to make. Two new fault vectors: 5 when a software vector was empty, 6 when a device interrupted and its hardware entry was. Separate, because they are separate mistakes with separate fixes - one is a program calling something that is not there, the other a program that asked to be interrupted and forgot the handler. WHICH ENTRY WAS EMPTY ARRIVES IN Q, and it is the only thing on this machine a handler is given in a register. Not a fault cause register by another route: the vector still says what happened and Q says which of the 256 entries it happened about, which is a parameter and not a cause. It costs no new state at all, because the frame already saved the Q the interrupted program had and RETI puts it back. The escalation happens once. If vector 5 or 6 is itself empty the machine stops the way it always did, having genuinely run out of places to go. swiFaultTest is what guards that, and it was written long before any of this: it installs nothing, so it must still get the old halt. Breaking the escalation fails the two new tests and not that one; making the escalation unbounded fails that one and not the two new ones. Each break fails exactly the half it belongs to. noDeviceTest is fed no input on purpose. The console raises its line once when input ENDS as well as when a byte arrives - which exists so a program driven by interrupts is told when nothing more is coming - so with no input at all, that end is what turns up. Groundwork for CosmOS's fault screen, which wanted to catch these two and could not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
4d976fc22a
commit
000a6d39cb
@@ -190,6 +190,16 @@ maskTest | testPrograms/maskTest.asm | run | -
|
||||
# reach on its own. The round trip through a handler is covered by hand built
|
||||
# binaries until #Vectors arrives.
|
||||
swiFaultTest | testPrograms/swiFaultTest.asm | run | - | -
|
||||
# And the same fault CAUGHT, which nothing could do until the machine had somewhere to send
|
||||
# it. Calling a service the system does not implement used to be fatal, and it is an ordinary
|
||||
# mistake. The number of the empty entry arrives in Q, and the handler steps over the SWI and
|
||||
# carries on - so the recording says both that the fault was delivered and that a program can
|
||||
# live through one.
|
||||
noHandlerTest | testPrograms/noHandlerTest.asm | run | - | -
|
||||
# The other half: a device raising its line with nothing installed to answer it. Nothing is
|
||||
# typed at this on purpose - the console raises its line once when input ENDS as well as when
|
||||
# a byte arrives, and with no input at all that end is what turns up.
|
||||
noDeviceTest | testPrograms/noDeviceTest.asm | run | - | -
|
||||
|
||||
# ---- Meeting a byte that is not an instruction ----
|
||||
# This one is meant to fault. It checks the CPU stops, says what it found and
|
||||
|
||||
Reference in New Issue
Block a user