[Simh] Simulating power fail

Paul Koning paulkoning at comcast.net
Fri Sep 7 13:11:35 EDT 2018



> On Sep 7, 2018, at 12:37 PM, Mark Pizzolato <Mark at infocomm.com> wrote:
> 
> On Friday, September 7, 2018 at 1:18 AM, Lars Brinkhoff wrote:
>> Timothe Litt wrote:
>>> Adding an API in the CPU of the form assert_powerfail( vector) - where
>>> the default is the usual 24/26, but a ROM can specify an alternate
>>> (usually its base address + 24/26). This is common to all initiators.
>> 
>> This touches on something else I have been thinking about.
>> 
>> Would it be appropriate to have a SIGTERM (and/or similar signals) trigger a
>> power fail in the PDP-11 and other simulators with corresponding
>> mechanisms?  SIGINT goes into the SCP console, and of course SIGKILL instantly
>> switches off the simulated machine.
>> ...
> 
> Alternatively, I've got a simulator that's been running via a script in a 
> background process for 10+ years.  The script it is running under receives
> one of these signals and that immediately drops out of sim_instr() and the
> script is configured to SAVE the simulator state to a file. 

That's a fairly simple scripting exercise wrapped around SIMH.  You can catch the signal, send control/E to get the sim> prompt, then suitable examine and deposit commands to simulate a trap to 24.

A Linux daemon control script could do the analogous, in response to system startup and shutdown sequencing.  I've done that with DtCyber, where the entire system shutdown is scripted that way, a fairly complex process.  In SIMH the equivalent would typically be simpler, depending somewhat on the OS involved.  For example, running RSTS as a Linux daemon, started and shutdown via systemctl or /etc/rc scripts would be easy enough.

	paul




More information about the Simh mailing list