On 27/03/2026 14.22, Mark Pizzolato - Info Comm wrote:
> On Friday, March 27, 2026 at 5:09 AM, Johnny Billquist wrote:
>> On 27/03/2026 12.41, Mark Pizzolato - Info Comm wrote:
>>> You are 100% correct!
>>>
>>> What I described was absolutely NOT what the PDP11 did for power loss.
>>> What I described was a way to avoid data/state loss in ANY running
>>> simulator when the host system is shutting down. This is completely
>>> WITHOUT ANYTHING inside the simulator noticing what happened.
>>
>> That is not true. Anything interacting/interfacing with the outside world can
>> potentially be impacted by such an event. You are not suspending the whole
>> universe.
>
> You are certainly correct. Please describe how the original PDP11's power fail
> logic would preserve what is happening in the rest of the universe and how that
> would be fundamentally different from what would happen to the reset of the
> universe with what I described.
Like I said, with RSX, any program can register a power fail AST that
will be called when power is restored (SPRA$ - Specify Power Recovery
AST). Thus all software that requires are explicitly notified about what
have happened, and can take appropriate action, such as closing and
reestablishing external connections, read back possible state from
external sources, resync time, or do whatever else might be the more
appropriate thing to do.
There is no way the OS could know exactly what needs to be done for
individual applications or systems, so it provides functionality that
enables applications to explicitly be aware of, and take action at the
reasonable moment in time.
The same is also true for all device drivers, who have a special entry
point for power fail recovery. Which then obviously should reset,
reconfigure and restart the device, check the queue of requests, and
restart the one that was ongoing at the time of the power fail if any,
and that will allow everything to resume operation.
But all of this requires that the machine acts in the way that a PDP-11
would act on power failure.
>>> Feel free to implement precisely what you described to that reflects how
>>> the hardware worked. When you do that, you will then have to figure out
>>> how to magically implement the non-volatile memory when this is
>>> happening.
>>
>> In theory, this would be simple. Generate the power fail interrupt.
>> Allow the simulation to continue for a small while, or until halt. Then dump
>> memory to a file. At startup, have a way to simulate power on with retained
>> memory, using such a memory snapshot.
>> Nothing magic about it at all. Not really that much more complexity than what
>> you described simh doing now.
>>
>> But yes, it would still rely in simh getting a signal (such as SIGHUP) when the
>> system is going down, and simh being allowed to complete some more
>> processing. But that is fairly standard.
>
> Go ahead and implement what you've described which will certainly require
> changes to both the PDP11 simulator code and additional simh capabilities to
> get there.
>
> Meanwhile , what I described can be implemented with a simh configuration
> script which will work for essentially all existing simulators.
Well. What you described, and what is currently implemented is close to
useless for any actual PDP-11 software.
So what we have today is pretty much nothing.
I could certainly argue that it would make a lot more sense to implement
something in simh that actually behaves the same way as a real machine
(that is, after all, the aim and purpose of simh), but me personally
have enough other projects, and not really a big need for this
functionality, so I will not spend the time on it.
Sometimes I do feel that something have gone pretty far astray, when the
actual behavior of the real machine is no longer considered the absolute
truth on how the emulation should behave. It's sad, but I try to stay
far away from simh development for that reason (among others).
Johnny