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

PDP11: Hitting panic() will hang the Pi #157

Open
hoglet67 opened this issue Jan 10, 2022 · 2 comments
Open

PDP11: Hitting panic() will hang the Pi #157

hoglet67 opened this issue Jan 10, 2022 · 2 comments

Comments

@hoglet67
Copy link
Owner

hoglet67 commented Jan 10, 2022

Hit this by switching from the 6502 to to the PDP11 without doing a Ctrl-BREAK (justr a normal BREAK)

For some reason (a bug in 0.28 of the PDP Tube ROM?) this eventually hits a HALT instruction (at 000000).

The instruction hit is 177700 which is diassembled as ??? but executed as HALT. This seems like an inconsistency.

The HALT instruction calls panic()

panic() ends up doing:

    cpu.halted = 1;
    printstate();
    while (1);

Doing a while (1) like this is bad, as reset is not seen.

Doing this would be better:

while (tubeContinueRunning());

So several things to look at:

  1. Replace while (1) with while (tubeContinueRunning()
  2. Investigate what instructions act as HALT
  3. Investigate possible bug in 0.28 of the PDP11 Tube ROM
  4. SIngle stepping a halt instruction could be more user friendly
@hoglet67 hoglet67 changed the title PDP11: Hittinng panic() will hang the Pi PDP11: Hitting panic() will hang the Pi Jan 10, 2022
@hoglet67
Copy link
Owner Author

I've done (1) - probably going to leave the rest to the next release (indigo)

@jgharston
Copy link
Contributor

On a real PDP11 HALT stalls the CPU until a hardware reset. On emulators such as E11 and SIMH it drops out to the emulator command line usually saying something like:
HALT at 123456
E11>

The instruction 177700 is in the block reserved for floating point instructions, if the F11 is not present it should trigger an Unknown Instruction trap via &0008. The PDP11 Tube Client sets all the unused vectors to NULLIRQ which just returns, so executing 177700 should be "long" null operation. increment PC, trap to 8, stack PC and PSW, vector to NULLIRQ, RTI, pop PC and PSW, continue executing at the next word.

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

No branches or pull requests

2 participants