PDP11, All VAX: Fix TU58 device (TDC) failure when not ATTACHED

This commit is contained in:
Mark Pizzolato 2017-01-05 09:36:17 -08:00
parent 8661cf1a06
commit b935a173e5
2 changed files with 9 additions and 3 deletions

View file

@ -921,7 +921,7 @@ switch (opcode) {
case TD_OPDAT: case TD_OPDAT:
if (ctlr->p_state != TD_WRITE1) { /* expecting data? */ if (ctlr->p_state != TD_WRITE1) { /* expecting data? */
sim_printf("TU58 protocol error 1\n"); sim_debug (TDDEB_ERR, ctlr->dptr, "td_process_packet() Opcode=%s(%d) - TU58 protocol error 1 - Not Expecting Data\n", opcode_name, opcode);
return; return;
} }
if (ctlr->ibptr < 2) { /* whole packet read? */ if (ctlr->ibptr < 2) { /* whole packet read? */
@ -934,7 +934,7 @@ switch (opcode) {
case TD_OPCMD: case TD_OPCMD:
if (ctlr->p_state != TD_IDLE) { /* expecting command? */ if (ctlr->p_state != TD_IDLE) { /* expecting command? */
sim_printf("TU58 protocol error 2\n"); sim_debug (TDDEB_ERR, ctlr->dptr, "td_process_packet() Opcode=%s(%d) - TU58 protocol error 2 - Not Expecting Command\n", opcode_name, opcode);
return; return;
} }
if (ctlr->ibptr < 2) { /* whole packet read? */ if (ctlr->ibptr < 2) { /* whole packet read? */
@ -1021,6 +1021,10 @@ switch (opcode) {
sim_debug (TDDEB_TRC, ctlr->dptr, "td_process_packet(OPBOO) Unit=%d\n", ctlr->ibuf[4]); sim_debug (TDDEB_TRC, ctlr->dptr, "td_process_packet(OPBOO) Unit=%d\n", ctlr->ibuf[4]);
ctlr->unitno = ctlr->ibuf[1]; ctlr->unitno = ctlr->ibuf[1];
fbuf = (int8 *)ctlr->uptr[ctlr->unitno].filebuf; fbuf = (int8 *)ctlr->uptr[ctlr->unitno].filebuf;
if (fbuf == NULL) { /* attached? */
sim_debug (TDDEB_ERR, ctlr->dptr, "td_process_packet(OPBOO) Unit=%d - NOT ATTACHED\n", ctlr->ibuf[4]);
break;
}
ctlr->block = 0; ctlr->block = 0;
ctlr->txsize = 0; ctlr->txsize = 0;
ctlr->p_state = TD_BOOTSTRAP; ctlr->p_state = TD_BOOTSTRAP;
@ -1043,7 +1047,7 @@ switch (opcode) {
break; break;
default: default:
//sim_printf("TU58: Unknown opcode %d\n", opcode); sim_debug (TDDEB_TRC, ctlr->dptr, "td_process_packet(%s) Unit=%d Unknown Opcode: %d\n", opcode_name, ctlr->ibuf[4], opcode);
break; break;
} }
} }

View file

@ -68,6 +68,7 @@ t_stat td_wr_o_buf (CTLR *ctlr, int32 data);
#define TDDEB_INT 00100 /* interrupts */ #define TDDEB_INT 00100 /* interrupts */
#define TDDEB_PKT 00200 /* packet */ #define TDDEB_PKT 00200 /* packet */
#define TDDEB_DAT 00400 /* data */ #define TDDEB_DAT 00400 /* data */
#define TDDEB_ERR 01000 /* errors */
static DEBTAB td_deb[] = { static DEBTAB td_deb[] = {
{ "OPS", TDDEB_OPS, "transactions" }, { "OPS", TDDEB_OPS, "transactions" },
@ -81,6 +82,7 @@ static DEBTAB td_deb[] = {
{ "INT", TDDEB_INT, "interrupts" }, { "INT", TDDEB_INT, "interrupts" },
{ "TRC", TDDEB_TRC, "trace" }, { "TRC", TDDEB_TRC, "trace" },
{ "DAT", TDDEB_DAT, "data" }, { "DAT", TDDEB_DAT, "data" },
{ "ERR", TDDEB_ERR, "errors" },
{ NULL, 0 } { NULL, 0 }
}; };