-
Notifications
You must be signed in to change notification settings - Fork 8
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
Tape read failure #4
Comments
Does the problem occur on faster machines? I'm asking because in the past there has already been a problem with that (with other devices though) with a sort of workaround, as in commit 79e1a9e . |
It may be worst on my fastest machine. I rebuilt KLH10 with those changed options, but I don't think it made any difference. Using NSALV to restore files works very reliably in SIMH, so I'll try to add some debug logging to both emulators to see what the difference is. |
Looking at the TM03 tape controller right before the failure. This is from KLH10 with
The last rdreg is interesting. It has the "tape online" bit set, but the "formatter ready" bit is off. Compare with SIMH:
There is a |
So apparently, the |
I have just pushed a fix so that you can compile with
Apart from that, in this code that you mentioned,
it smells like the clearing of TM_SDRY races with tm_io(), where it When the device process signals, with SIGUSR1, that the command is In any case, it looks safer to invert the order: |
Alternatively, if the signal handler doesn't directly call the It is in theory possible that tm_io() returns 0, in which case GO is So in this case, the code (also in a few instances) should be changed #if KLH10_DEV_DPTM03 (which of course is incompatible with my previous suggestion to try, but Now it seems unlikely that tm_io() randomly returns 0 from time to time. |
Some more testing with an unmodified KLH10:
This seems consistent with a timing-dependent race condition. I don't quite have the knowledge to see what the best fix would be. Are there some tests you want me to run? I can insert logging to view the state changes for the GO and SRDY bits; in both the failing and successful scenarious. |
When the DP (device process) has processed a command it sends a signal. The normal completion path would be something like
Somewhere this process must go wrong. Now in the tape reading code you show way above, if I read it correctly, the actual command isn't RDR but NOP. NOP always turns off GO right away and doesn't even involve the device process, and doesn't mess with SRDY. So it might be some interplay between the RDR command and the NOP |
I see that the TM_ER3 command gets sent to the device proc, but on completion, tm_cmddon() doesn't call tm_ssta() for it. So this command would seem to leave the SRDY bit off. |
EDIT: fixed by adding the new CONFFLAGS_USR thing. |
There seems to be some problem reading from tapes. This is an extract from my configuration file (based on
run/ksits/klh10-pi.ini
):minsys.tape
is a tape image created with itstar. It works fine with SIMH.@.nsalv-260-u
is the ITS disk salvager fromrun/ksits
.When I type
go
and thenmark<ESC>g
, the disk formatting procedure works ok. (Answer0
,y
,0
,n
,3000
,foobar
.)But next, if I type
tran<ESC>g
to restore files from a tape, things sometimes go badly. (Answer0
,y
.)On some of my host machines, the start of a file is found, but then I get
On some other host machines, sometimes all files are restored, or the error appears in the middle of the tape.
If we look into the source code of NSALV 260, we see
%TMTC
is the tape control register at 772432.%TMCS1
is control and status 1 at 772400.%TMFS
is formatter status at 772412.So presumably, the tape controller is ready, but the tape formatter is not.
The text was updated successfully, but these errors were encountered: