Hi,
I am trying to archive my tapes. I am having difficulty reading the
tapes. I tried 2 tapes that are of low importance.
I am able to read the first 2 records (the first record is 14 bytes
and the second record is 512 bytes). I see the tape
move for the read as well as the backspace operations.
I setup a simulated environment to test prior to using real hardware.
Using a slightly modified version of SIMH along
with PDP11GUI and a virtual tape, I successfully read virtual tapes.
Now that everything is working on a simulator, I am using the same
code on real hardware.
The real hardware is a PDP-11/10 with 32kw core memory, TMA-11
controller with TS03 tape drive. I also have
a RK-11 controller with an attached RK05j drive which is available,
but is not used during this scenario.
I don't know the actual format of the tape. My goal is to get a
binary copy of the tape suitable for use with SIMH.
Now that I am using real hardware, I am getting a Record Length Error.
I set the read buffer to 2048 bytes (1024 words).
The values I have from the TMA-11 registers is as follows:
MTS 001105
MTC 160202
MTBRC 000000
MTCMA 000000
MTD 000000
MTRD 000000
I am looking for some source code to figure out what is going wrong.
I have reviewed the simple example in the TMA-11 documentation, but
proper error handling is not performed.
Thanks!
; +===============================================================
; | read
; +===============================================================
; |
; | Read record from tape. When an EOF is detected, 'rsize' is
; | set to 0. When the second EOF is detected (ie. end of tape)
; | 'exit' is set to TRUE.
; |
; | On Entry:
; | rsize has the number of bytes in the buffer
; |
; | On Exit:
; | all registers unchanged
; +---------------------------------------------------------------
read: mov #MAXTRIES, @#retries ; maximum number of retries
retry: tstb @#MTC ; is controller available?
bpl retry ; no, wait for controller
1$: bit #MTATUR,@#MTS ; is tape unit ready?
beq 1$ ; no, wait for tape unit
dec @#retries ;
bpl 2$ ; retry
halt ; too many reties (bails out here)
2$: mov #rbuf, @#MTCMA ; read buffer (buffer begins at end of code)
mov #174000, @#MTBRC ; max buffer size (2048 bytes)
mov #60003, @#MTC ; unit #0, 800bpi, read, go
3$: tstb @#MTC ; is read complete?
bpl 3$ ; no, wait for completion
mov @#MTS, R3
mov @#MTC, R4
mov #0, @#rsize ; assume EOF reached
bit #MTAEOF,@#MTS ; did we hit EOF? (MTAEOF is 040000
bne done ; yes, so we are done
tst @#MTC ; error?
bpl 5$ ; no error
mov #-1, @#MTBRC ; number of records to backspace
mov #60013, @#MTC ; unit #0, 800bpi, read, go
4$: tstb @#MTC ; is backspace complete?
bpl 4$ ; no, wait for completion
br retry ; try read again
5$: mov @#MTCMA,@#rsize ; determine number bytes read
sub #rbuf,@#rsize
done: inc @#reccnt ; another record (or EOF)
rts pc
Show replies by date