rcornwell / sims

Burroughs B5500, ICL1900, SEL32, IBM 360/370, IBM 7000 and DEC PDP10 KA10/KI10/KL10/KS10, PDP6 simulators for SimH
http://sky-visions.com
95 stars 20 forks source link

ITS 724 not happy about magtape #146

Closed larsbrinkhoff closed 5 years ago

larsbrinkhoff commented 5 years ago

This may well be a problem with ITS, or with the SIMH configuration. But maybe you (@rcornwell) have some ideas, or can look into this?

The problem is that ITS 724 will not read from a magtape. (Haven't tried writing yet, probably doesn't work either.) When I run DUMP, I see this:

DUMP  .2
TAPE REWOUND

_LIST
DBG(32957500259)> MTA CONI: MT CONI 346 status2 000170100046 0 000000000000 PC=006623
DBG(33115275280)> MTA CONO: MT CONO 343 start 0 0 0 000000000000 000000000000 PC=062535
DBG(33115275280)> MTA EXP: Setting status 000000000002
DBG(33115275283)> MTA CONI: MT CONI 342 status 000000 0 0 PC=062536
DBG(33115275414)> MTA CONI: MT CONI 342 status 000000 0 0 PC=071661
DBG(33115275417)> MTA CONI: MT CONI 346 status2 000170100046 0 000000000002 PC=071662
DBG(33115275515)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064035
DBG(33115275532)> MTA CONO: MT CONO 343 start 40200 0 420 000000040620 000000000000 PC=064064
DBG(33115275532)> MTA EXP: Setting status 000000000002

^Z
1017)   XCT 2   $^X.
DBG(33115275608)> MTA CONI: MT CONI 342 status 040620 0 420 PC=064326

So ITS starts talking to the tape drive, but nothing much else happens. I see no error conditions in the numbers above. I think ITS may be waiting for something to happen, but I don't know what.

larsbrinkhoff commented 5 years ago

Here's a kit: http://lars.nocrew.org/its/its724.zip

How to repeat:

  1. pdp10-ka start.simh
  2. its724 bin
  3. GO$G
  4. ^Z
  5. foo$u (wait for CR LF)
  6. dump^H
  7. list

Transcript:


$ ../BIN/pdp10-ka start.simh 
KA-10 simulator V4.0-0 Current        git commit id: +6b83852

its724 bin
GO$G

ITS 724 IN OPERATION
ITS.724. DDT.354.
1. USERS
foo$u
dum!

DUMP  .2     
TAPE REWOUND
_LIST
rcornwell commented 5 years ago

I'll take a peek at this. However you might want to add DETAIL into your debugging. This will give you indications as records are read off the tape. CMD will also tell you what the TM10 thinks it should do.

Have you made sure you have ODD parity bit set in the generated tape?

larsbrinkhoff commented 5 years ago

set mta debug gives me this:

sim> show mta debug
Debug=CMD;DATA;DETAIL;EXP;CONI;CONO;DATAIO;TRACE;DATA;POS;STR

The tape image looks like this:

0000000 124 000 000 000 177 177 174 100 100 100 100 100 001 100 100 100
0000020 121 031 020 130 121 122 100 100 100 100 100 100 177 177 172 100

Looks like odd parity, right?

rcornwell commented 5 years ago

Yes... I will check it later tonight.

larsbrinkhoff commented 5 years ago

Thanks. I added an its724.listing which is really just a disassembly of the binary. Also its.785 and mtape.112 for reference. They are close to ITS 724.

rcornwell commented 5 years ago

Pushed out a fix. The device does not time out, however list end in halt instruction. Note tape is 0 not 5.

larsbrinkhoff commented 5 years ago

Thanks. That gets us to the LIST DEV= prompt which is good. And one tape record is read.

I just see a ^M output by DUMP, so maybe it's stuck parsing the data... or something.

After the record is read, there's lots of DBG(18162663051)> MTA EXP: data late. That means data wasn't read out of the data buffer in time, right? Interrupts not being serviced?

larsbrinkhoff commented 5 years ago

Random thought: What if the transfer rate is too high for ITS 724? I tried increasing the sim_activate delay from 420 to 10000. But that didn't help at all.

larsbrinkhoff commented 5 years ago

Typing the LIST command gives us this backtrace:

  1. ALIST
  2. LAST
  3. LOUSE
  4. MAGOP
  5. .IOT triggers the HALT.

MAGOP first .OPENs the MT0 device. I get this:

DBG(21353326122)> MTA CONO: MT CONO 343 start 0 0 0 000000000000 000000000000 PC=062535
DBG(21353326122)> MTA EXP: Setting status 000000000002
DBG(21353326125)> MTA CONI: MT CONI 342 status 000000 0 0 PC=062536
DBG(21353326256)> MTA CONI: MT CONI 342 status 000000 0 0 PC=071661
DBG(21353326259)> MTA CONI: MT CONI 346 status2 000170100046 0 000000000002 PC=071662
DBG(21353326357)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064035
DBG(21353326374)> MTA CONO: MT CONO 343 start 40200 0 420 000000040620 000000000000 PC=064064
DBG(21353326374)> MTA EXP: Setting status 000000000102
DBG(21353326450)> MTA CONI: MT CONI 342 status 040620 0 420 PC=064326
DBG(21353326533)> MTA CONI: MT CONI 342 status 040620 0 420 PC=071661
DBG(21353326536)> MTA CONI: MT CONI 346 status2 000170100146 0 000000000102 PC=071662
DBG(21353326607)> MTA CONO: MT CONO 343 start 0 0 0 000000000000 000000000000 PC=062437
DBG(21353326607)> MTA EXP: Setting status 000000000002
DBG(21353326653)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064317
DBG(21353326667)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064326
DBG(21353327207)> MTA CONI: MT CONI 342 status 000000 0 0 PC=071661
DBG(21353327210)> MTA CONI: MT CONI 346 status2 000170100046 0 000000000002 PC=071662
DBG(21353327305)> MTA CONI: MT CONI 342 status 000000 0 0 PC=063041
DBG(21353327319)> MTA CONO: MT CONO 343 start 40200 0 420 000000040620 000000000000 PC=063047
DBG(21353327319)> MTA EXP: Setting status 000000000102
DBG(21353327322)> MTA CONI: MT CONI 346 status2 000170100146 0 000000000102 PC=063050
DBG(21353327340)> MTA CONI: MT CONI 342 status 040620 0 420 PC=063056
DBG(21353327344)> MTA CONO: MT CONO 343 start 0 0 0 000000000000 000000000000 PC=063057
DBG(21353327344)> MTA EXP: Setting status 000000000002
DBG(21353327395)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064326

And when calling .IOT:

DBG(7176172579)> MTA CONI: MT CONI 342 status 000000 0 0 PC=071661
DBG(7176172582)> MTA CONI: MT CONI 346 status2 000170100046 0 000000000002 PC=071662
DBG(7176173522)> MTA CONI: MT CONI 342 status 000000 0 0 PC=064035
DBG(7176173539)> MTA CONO: MT CONO 343 start 50200 0 20 000000050220 000000000000 PC=064067
DBG(7176173539)> MTA EXP: Setting status 000000000102
DBG(7176173637)> MTA CONI: MT CONI 342 status 050220 0 20 PC=064326
DBG(7176173720)> MTA CONI: MT CONI 342 status 050220 0 20 PC=071661
DBG(7176173723)> MTA CONI: MT CONI 346 status2 000170100146 0 000000000102 PC=071662
DBG(7176173871)> MTA CONO: MT CONO 343 start 42200 0 21 000000042221 000000000000 PC=064064
DBG(7176173937)> MTA CONI: MT CONI 342 status 042221 0 21 PC=064317
DBG(7176173947)> MTA CONI: MT CONI 342 status 042221 0 21 PC=064326
DBG(7176174871)> MTA STR: rd_lntf: st: 0, lnt: 84, pos: 92
DBG(7176174871)> MTA STR: MTA0 Record Read len: 00000054
DBG(7176174871)> MTA STR: 0000 7F 7F 7C 40 40 40 40 40 01 40 40 40 51 19 10 58 ..|@@@@@.@@@Q..X
DBG(7176174871)> MTA STR: 0010 51 52 40 40 40 40 40 40 7F 7F 7A 40 40 40 34 6D QR@@@@@@..z@@@4m
DBG(7176174871)> MTA STR: 0020 70 40 40 40 34 6D 70 40 40 40 34 6D 70 40 40 40 p@@@4mp@@@4mp@@@
DBG(7176174871)> MTA STR: 0030 40 40 40 40 40 40 0E 7C 4C 4A 10 2C 64 19 5D 26 @@@@@@.|LJ.,d.]&
DBG(7176174871)> MTA STR: 0040 73 5E 57 43 51 15 1F 5E 79 5B 4C 62 38 1A 45 43 s^WCQ..^y[Lb8.EC
DBG(7176174871)> MTA STR: 0050 40 58 70 46                                     @XpF
DBG(7176174871)> MTA DETAIL: MT0 read 84
DBG(7176178779)> MTA CONI: MT CONI 342 status 042221 0 21 PC=104531
DBG(7176178812)> same as above (1 time)
DBG(7176178858)> MTA CONI: MT CONI 346 status2 000174000005 0 000004000001 PC=104531
N
DBG(7176179927)> MTA EXP: data late
DBG(7176187090)> same as above (17 times)
larsbrinkhoff commented 5 years ago

Instruction history before the HALT:

104564  000000000003  000000    000000000003  000000000003  000004  242316000000  LSH 6,0(16)
104565  760200000000  000006    000000000003  760200000003  000004  434200000006  IOR 4,6
104566  254200002037  000004    000000000004  000000000004  000004  256000000004  XCT 0,4
000004  760200000003  000003    000000000003  000000000003  000004  760200000003  CONO 600,3
104567  000000000000  104354    600777000000  000000600777  000004  554707104214  HLRZ 16,104214(7)
104570  000000600777  300000    000000300000  300000000000  000004  607700300000  TLNN 16,300000
104571  254200002037  000013    000000000000  000000000001  000004  350000000013  AOS 0,13
104572  000000600777  000777    000000000777  000000000777  000004  405700000777  ANDI 16,777
104573  254200002037  000016    000000000777  000000001000  000004  350000000016  AOS 0,16
104574  254200002037  104444    000000002775  000000002776  000004  350000104444  AOS 0,104444
104575  000000001000  000777    000000000777  000000000001  000004  303700000777  CAILE 16,777
104576  000000001000  110212    000000001000  000000000777  000004  364700110212  SOJA 16,110212
110212  760200000003  104577    254200104577  254200104577  300004  254200104577  HALT 104577

This is in the DCSAOS subroutine in ITS. It was called from CHECK, which was called by SPUR:
;CHANNEL IN J SPURIOUS INTERRUPT ON

So apparently there's an interrupt ITS didn't like.

larsbrinkhoff commented 5 years ago

The spurious interrupt was due to me forgetting the MPX setting!

larsbrinkhoff commented 5 years ago

The next problem is that .IOT gets a read error:


DBG(7922413117)> MTA CONI: MT CONI 346 status2 000000100046 0 000000000002 PC=071662
DBG(7922414060)> MTA CONI: MT CONI 342 status 000007 0 0 PC=064035
DBG(7922414077)> MTA CONO: MT CONO 343 start 50200 0 20 000000050220 000000000000 PC=064067
DBG(7922414077)> MTA EXP: Setting status 000000000102
DBG(7922414175)> MTA CONI: MT CONI 342 status 050227 0 20 PC=064326
DBG(7922414258)> MTA CONI: MT CONI 342 status 050227 0 20 PC=071661
DBG(7922414261)> MTA CONI: MT CONI 346 status2 000000100146 0 000000000102 PC=071662
DBG(7922414412)> MTA CONO: MT CONO 343 start 42200 0 21 000000042221 000000000000 PC=064064
DBG(7922414478)> MTA CONI: MT CONI 342 status 042227 0 21 PC=064317
DBG(7922414488)> MTA CONI: MT CONI 342 status 042227 0 21 PC=064326
DBG(7922415412)> MTA STR: rd_lntf: st: 0, lnt: 84, pos: 92
DBG(7922415412)> MTA STR: MTA0 Record Read len: 00000054
DBG(7922415412)> MTA STR: 0000 7F 7F 7C 40 40 40 40 40 01 40 40 40 51 19 10 58 ..|@@@@@.@@@Q..X
DBG(7922415412)> MTA STR: 0010 51 52 40 40 40 40 40 40 7F 7F 7A 40 40 40 34 6D QR@@@@@@..z@@@4m
DBG(7922415412)> MTA STR: 0020 70 40 40 40 34 6D 70 40 40 40 34 6D 70 40 40 40 p@@@4mp@@@4mp@@@
DBG(7922415412)> MTA STR: 0030 40 40 40 40 40 40 0E 7C 4C 4A 10 2C 64 19 5D 26 @@@@@@.|LJ.,d.]&
DBG(7922415412)> MTA STR: 0040 73 5E 57 43 51 15 1F 5E 79 5B 4C 62 38 1A 45 43 s^WCQ..^y[Lb8.EC
DBG(7922415412)> MTA STR: 0050 40 58 70 46                                     @XpF
DBG(7922415412)> MTA DETAIL: MT0 read 84
DBG(7922417932)> MTA EXP: Setting status 0 000006001100
DBG(7922417977)> MTA CONI: MT CONI 342 status 042227 0 21 PC=071661
DBG(7922417980)> MTA CONI: MT CONI 346 status2 000006001106 0 000006001100 PC=071662
DBG(7922419035)> MTA CONO: MT CONO 343 start 42200 0 21 000000042221 000006000000 PC=064064
DBG(7922419101)> MTA CONI: MT CONI 342 status 042227 0 21 PC=064317
DBG(7922419111)> MTA CONI: MT CONI 342 status 042227 0 21 PC=064326
DBG(7922420037)> MTA STR: rd_lntf: st: 1, lnt: 0, pos: 96
DBG(7922420037)> MTA DETAIL: MT0 read error 1
DBG(7922420037)> MTA EXP: Setting status 1 000000010100
DBG(7922420082)> MTA CONI: MT CONI 342 status 042227 0 21 PC=071661
DBG(7922420085)> MTA CONI: MT CONI 346 status2 000000011146 0 000000010100 PC=071662
DBG(7922420277)> MTA CONO: MT CONO 343 start 0 0 0 000000000000 000000000000 PC=063772
DBG(7922420277)> MTA EXP: Setting status 000000000002
DBG(7922420331)> MTA CONI: MT CONI 342 status 000007 0 0 PC=064317
larsbrinkhoff commented 5 years ago

This has RLC_ERR set. Char count is 6.

DBG(7922417932)> MTA EXP: Setting status 0 000006001100

I think st 1 and error 1 is "tape mark". status gets EOF_FLAG. I think this is expected since the first tape file is just one record.

DBG(7922420037)> MTA STR: rd_lntf: st: 1, lnt: 0, pos: 96
DBG(7922420037)> MTA DETAIL: MT0 read error 1
DBG(7922420037)> MTA EXP: Setting status 1 000000010100

This has both EOF and RLC set.

DBG(7922420085)> MTA CONI: MT CONI 346 status2 000000011146 0 000000010100 PC=071662
larsbrinkhoff commented 5 years ago

RLC_ERR gets set here.

         if ((uptr->CNTRL & (06000|MT_STOP)) == 02000 && (mt_status & JOB_DONE) != 0)
              res |= RLC_ERR;

CNTRL is 042200, and mt_status is 000000010100.

larsbrinkhoff commented 5 years ago

Is it the case RLC means the tape record length doesn't match what the program tried to read? If so, this would be the normal operation of ITS reading 1024K blocks, but records may be shorter.

rcornwell commented 5 years ago

It would be nice to see the data transferred during these logs. What I do not see is ITS setting the STOP bit. This will cause the RLC error. Before you read the last word you need to issue a CONO to the second unit with the stop bit set.

larsbrinkhoff commented 5 years ago

This is the data. But it's just the first record from the tape, so no surprises here.

DBG(19875111201)> MTA STR: rd_lntf: st: 0, lnt: 84, pos: 92
DBG(19875111201)> MTA STR: MTA0 Record Read len: 00000054
DBG(19875111201)> MTA STR: 0000 7F 7F 7C 40 40 40 40 40 01 40 40 40 51 19 10 58 ..|@@@@@.@@@Q..X
DBG(19875111201)> MTA STR: 0010 51 52 40 40 40 40 40 40 7F 7F 7A 40 40 40 34 6D QR@@@@@@..z@@@4m
DBG(19875111201)> MTA STR: 0020 70 40 40 40 34 6D 70 40 40 40 34 6D 70 40 40 40 p@@@4mp@@@4mp@@@
DBG(19875111201)> MTA STR: 0030 40 40 40 40 40 40 0E 7C 4C 4A 10 2C 64 19 5D 26 @@@@@@.|LJ.,d.]&
DBG(19875111201)> MTA STR: 0040 73 5E 57 43 51 15 1F 5E 79 5B 4C 62 38 1A 45 43 s^WCQ..^y[Lb8.EC
DBG(19875111201)> MTA STR: 0050 40 58 70 46                                     @XpF            
DBG(19875111201)> MTA DETAIL: MT0 read 84

Shortly after this, ITS attempts another read and gets the EOF:

DBG(21002339491)> MTA STR: rd_lntf: st: 1, lnt: 0, pos: 96
larsbrinkhoff commented 5 years ago

What DUMP does is to read one single word from the tape device. However, .IOT returns without reading anything. This version of DUMP doesn't check the number of words read (which is a bug in itself). It checks the word it thinks it read and sees invalid data.

rcornwell commented 5 years ago

No I want to see the DATAIO as the words are transferred.

larsbrinkhoff commented 5 years ago

There are none. This is consistent with .IOT returning 0 words read. What I think may be happening is that ITS sees some combination of RLC, EOF, and EOT and gets confused.

larsbrinkhoff commented 5 years ago

Never mind! I had set mta type=b and ITS expects TM10A. I get a file listing now. Next, I'll test read and write.

larsbrinkhoff commented 5 years ago

Reading a file off the tape works.