Ahh the old days, where the hardware designers rarely talked to the system designers and programming magic had to be performed to get PDP-11s to run anything multi-user at all.
A related story (where I was just a fly on the wall), was how to implement paging in UNIX (Series 6, I think the days before Bourne Shell, the days where /bin/sh had only one prompt (“% “, unless you were root ‘# ’), and “do-done loops” were a gleam in someone’s eye but I digress).
George Coulouris (QMC London University) employed an IT person (before the term was invented) who was a real UNIX Guru. I *really* wish I could remember his name - he taught me the basics of how to treat impatient students (of which I was one), who would nag while we waited for him to magically key-in disk i/o block-rewrites, from the 11/40 switches (before the days of microcode-handled consoles that could run fsck in single-user mode). The toggle-magic he would work in his sleep was essentially fsdb from some notes he made in machine code on paper. F***ing Brilliant!.
Back to the story This “Mr. Guru” had much more complicated things to do in his spare time. He was one of the contributors to fixing the “Instruction Backup Problem” on PDP-11/40s. The early days of trying to get paging to work reliably on PDP-11s. There was a piece of kernel assembler code that would be invoked whenever a page-fault was hit. The job of this code was to reverse out the partially executed machine code instruction that caused the fault, load (from disk, or some other cache in memory) the not-currently-available block of instructions or data, subtract the correct number of bytes from the user’s PC (program counter), and do an RTI (return from interrupt) to get the user’s program to blissfully continue from where it was rudely interrupted. It was actually a huge switch statement in assembler - a piece of code to handle each instruction, with their combination of (possibly) indirected 2-address arguments.
The major wrinkle here was that while it worked properly on an PDP-11/70 (for those who could afford that beauty), the rest of us had to make do on a PDP-11/40 (for which we grew fond and had to speak softly and kindly in its presence, in case it failed to properly write all the bits on a disk block and threw a block-checksum error and bring the whole machine down (again) and make the Mr. Guru dance over the toggle switches for an hour or so).
From time to time a user’s “a.out” would throw a core dump for no good reason. I’ve no idea how Mr. Guru figured this out, but the problem was occurring in the Page-Fault interrupt service function. There was one instruction type for which enough information was not salvageable unambiguously - to backup the instruction to a point it could be rerun on RTI. I’m sorry but I do not know what the actual instruction was. The fix was to change the assembler to not generate that particular instruction (with its ambiguous indirected arguments) on a PDP-11/40. Ever again!
Hats off to George C and Mr. Guru. Those *were* the days.