Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltairZ80: Enable SIO interrupt service event after BOOT #363

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

deltecent
Copy link
Contributor

The boot command causes all devices to reset which removes the SET SIO INTERRUPT service routine from the SIMH event queue which disables interrupt processing. The user must escape back to the simh> prompt and SET SIO INTERRUPT again after boot. An example of the problem:

at dsk altdos.dsk
set sio interrupt
boot dsk

MEMORY SIZE? << Enter >>
INTERRUPTS? Y << Enter >>
HIGHEST DISK NUMBER? << interrupt never happens, program hangs >>

This PR has sio_reset put the SIO interrupt service routine back on the event queue if interrupts have been enabled with SET SIO INTERRUPT.

at dsk altdos.dsk
set sio interrupt
boot dsk

MEMORY SIZE? 
INTERRUPTS? Y
HIGHEST DISK NUMBER? 1
HOW MANY DISK FILES? 1
HOW MANY RANDOM FILES? 1

056943 BYTES AVAILABLE
DOS MONITOR VER 1.0
COPYRIGHT 1977 BY MITS INC
.

@psco
Copy link
Contributor

psco commented Mar 3, 2024

Thank you Patrick for finding and fixing this defect. The change looks good and can be merged (@pkoning2).

@markpizz
Copy link
Contributor

markpizz commented Mar 3, 2024

Hi @deltecent and @psco ,

This thinking here is absolutely on the right track. I can't look at the code right now (I'm recovering from bilateral knee replacements), but consider these facts while working through this:

1 - how many times, and under what conditions is the SIO device reset routine called. Off the top of my head, there are probably 2 or maybe 3 times:
2 - one absolute time is when the simulator initially starts (aka power up). During this call the -P bit in sim_switches is set, which can potentially be used to influence the logic in the reset routine.
3 - another absolute time is as a result of a BOOT command. This time the -P bit in sim_switches will not be set.
4 - another possible time might be as a consequence of an ATTACH command.
5 - another possible time might be if there is some instruction/sequence which might trigger this by a running simulator program.

Your SET SIO INTERRUPT command might merely record this in a SIO REG variable, and the previously set value can be referenced by the reset routine...

  • Mark

@deltecent
Copy link
Contributor Author

@markpizz, If I understand you correctly, I believe that's what the PR does:

    if (sio_unit.flags & UNIT_SIO_INTERRUPT)
        sim_activate(&sio_unit, sio_unit.wait);             /* activate unit    */

I hope you have a speedy recovery.

@pkoning2 pkoning2 merged commit e444c67 into open-simh:master Mar 13, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants