1
0
mirror of https://github.com/simh/simh.git synced 2026-03-05 18:59:08 +00:00

PDP11, VAX730, VAX750: Fix TU58 device support (TDC and console TD devices)

- Cleanup TD console device attach logic
- Properly initialize the TDC devices

Fix #1220
This commit is contained in:
Mark Pizzolato
2025-08-28 08:46:48 -10:00
parent 903bf30280
commit b305252bff
5 changed files with 40 additions and 48 deletions

View File

@@ -526,10 +526,6 @@ static const char *tdc_regnam[] =
#define TD_NUMCTLR 16 /* #controllers */
#define TD_NUMBLK 512 /* blocks/tape */
#define TD_NUMBY 512 /* bytes/block */
#define TD_SIZE (TD_NUMBLK * TD_NUMBY) /* bytes/tape */
#define TD_OPDAT 001 /* Data */
#define TD_OPCMD 002 /* Command */
@@ -1350,6 +1346,7 @@ int ctl;
static t_bool td_enabled_reset = FALSE;
static t_bool td_regs_inited = FALSE;
sim_debug (TDDEB_INT, dptr, "td_reset()\n");
if (!td_regs_inited) {
int regs;
int reg;
@@ -1402,36 +1399,34 @@ else {
if (!td_enabled_reset) {
char num[16];
for (ctl=0; ctl<TD_NUMCTLR; ctl++) {
ctlr = &td_ctlr[ctl];
ctlr->dptr = &tdc_dev;
ctlr->uptr = td_unit + 2*ctl;
ctlr->rx_set_int = tdi_set_int;
ctlr->tx_set_int = tdo_set_int;
td_unit[2*ctl+0].action = &td_svc;
td_unit[2*ctl+0].flags = UNIT_FIX|UNIT_ATTABLE|UNIT_BUFABLE|UNIT_MUSTBUF|UNIT_DIS;
sim_disk_set_drive_type_by_name (&td_unit[2*ctl+0], "TU58");
td_unit[2*ctl+0].up7 = ctlr;
td_unit[2*ctl+1].action = &td_svc;
td_unit[2*ctl+1].flags = UNIT_FIX|UNIT_ATTABLE|UNIT_BUFABLE|UNIT_MUSTBUF|UNIT_DIS;
sim_disk_set_drive_type_by_name (&td_unit[2*ctl+1], "TU58");
td_unit[2*ctl+1].up7 = ctlr;
td_reset_ctlr (ctlr);
sim_cancel (&td_unit[2*ctl]);
sim_cancel (&td_unit[2*ctl+1]);
}
for (ctl=0; ctl<td_ctrls; ctl++) {
td_unit[2*ctl+0].flags &= ~UNIT_DIS;
td_unit[2*ctl+1].flags &= ~UNIT_DIS;
}
td_enabled_reset = TRUE;
/* make sure to bound the number of DLI devices */
sprintf (num, "%d", td_ctrls);
td_set_ctrls (dptr->units, 0, num, NULL);
}
}
sim_debug (TDDEB_INT, dptr, "td_reset()\n");
for (ctl=0; ctl<TD_NUMCTLR; ctl++) {
ctlr = &td_ctlr[ctl];
ctlr->dptr = &tdc_dev;
ctlr->uptr = td_unit + 2*ctl;
ctlr->rx_set_int = tdi_set_int;
ctlr->tx_set_int = tdo_set_int;
td_unit[2*ctl+0].action = &td_svc;
td_unit[2*ctl+0].flags = UNIT_FIX|UNIT_ATTABLE|UNIT_BUFABLE|UNIT_MUSTBUF|UNIT_DIS;
sim_disk_set_drive_type_by_name (&td_unit[2*ctl+0], "TU58");
td_unit[2*ctl+0].up7 = ctlr;
td_unit[2*ctl+1].action = &td_svc;
td_unit[2*ctl+1].flags = UNIT_FIX|UNIT_ATTABLE|UNIT_BUFABLE|UNIT_MUSTBUF|UNIT_DIS;
sim_disk_set_drive_type_by_name (&td_unit[2*ctl+1], "TU58");
td_unit[2*ctl+1].up7 = ctlr;
td_reset_ctlr (ctlr);
sim_cancel (&td_unit[2*ctl]);
sim_cancel (&td_unit[2*ctl+1]);
}
for (ctl=0; ctl<td_ctrls; ctl++) {
td_unit[2*ctl+0].flags &= ~UNIT_DIS;
td_unit[2*ctl+1].flags &= ~UNIT_DIS;
}
return auto_config (tdc_dev.name, td_ctrls); /* auto config */
}
@@ -1515,13 +1510,6 @@ ctlr->tx_set_int = tx_set_int;
return td_reset_ctlr (ctlr);
}
static t_stat td_attach (UNIT *uptr, CONST char *cptr)
{
return sim_disk_attach (uptr, cptr, TD_NUMBY,
sizeof (uint16), TRUE, 0,
"TU58", 0, 0);
}
/* Device bootstrap */
#if defined (VM_PDP11)

View File

@@ -87,6 +87,13 @@ static DEBTAB td_deb[] = {
{ NULL, 0 }
};
/* TU58 definitions */
#define TD_NUMBLK 512 /* blocks/tape */
#define TD_NUMBY 512 /* bytes/block */
#define TD_SIZE (TD_NUMBLK * TD_NUMBY) /* bytes/tape */
#define TD_DRV(d) \
{ 128, 4, 1, 512, #d, 512 }
@@ -95,4 +102,11 @@ static DRVTYP drv_tab[] = {
{ 0 }
};
static t_stat td_attach (UNIT *uptr, CONST char *cptr)
{
return sim_disk_attach (uptr, cptr, TD_NUMBY,
sizeof (uint16), TRUE, 0,
"TU58", 0, 0);
}
#endif /* _PDP11_TD_H */

View File

@@ -138,6 +138,7 @@ Simulator binaries for x86 Linus, x86 macOS, and Windows for all recent changes
- MSCP Media-Id information and drive geometry information is available for all attached disk containers.
- VAX Instruction history can be recorded to disk both for all instructions executed as well as every n instructions.
- VAX Unibus simulators (780, 750, 730, 8600, 8200) run DEC supplied diagnostics at the speed of the original systems and also run the privileged instruction diagnostic that was supported on the original systems.
- Reliable emulation of TU58 devices in PDP11 and Unibus VAX systems and consistent console TU58 on the VAX730 and VAX750.
### All relevant changes in Bob Supnik's simh v3.12-4 release have been merged into this repo

View File

@@ -114,10 +114,6 @@ static BITFIELD tmr_iccs_bits [] = {
/* TU58 definitions */
#define TD_NUMBLK 512 /* blocks/tape */
#define TD_NUMBY 512 /* bytes/block */
#define TD_SIZE (TD_NUMBLK * TD_NUMBY) /* bytes/tape */
#define TD_OPDAT 001 /* Data */
#define TD_OPCMD 002 /* Command */
#define TD_OPINI 004 /* INIT */
@@ -397,7 +393,7 @@ DEVICE td_dev = {
"TD", td_unit, td_reg, td_mod,
2, DEV_RDX, 20, 1, DEV_RDX, 8,
NULL, NULL, &td_reset,
NULL, NULL, NULL,
NULL, &td_attach, NULL,
NULL, DEV_DEBUG | DEV_DISK, 0, td_deb, NULL, NULL, NULL, NULL, NULL,
&td_description, NULL, &drv_tab
};

View File

@@ -145,13 +145,6 @@ static BITFIELD tmr_iccs_bits [] = {
ENDBITS
};
/* TU58 definitions */
#define TD_NUMBLK 512 /* blocks/tape */
#define TD_NUMBY 512 /* bytes/block */
#define TD_SIZE (TD_NUMBLK * TD_NUMBY) /* bytes/tape */
int32 tti_csr = 0; /* control/status */
uint32 tti_buftime; /* time input character arrived */
@@ -389,7 +382,7 @@ DEVICE td_dev = {
"TD", &td_unit, td_reg, td_mod,
1, DEV_RDX, 20, 1, DEV_RDX, 8,
NULL, NULL, &td_reset,
NULL, NULL, NULL,
NULL, &td_attach, NULL,
NULL, DEV_DEBUG | DEV_DISK, 0, td_deb, NULL, NULL, NULL, NULL, NULL,
&td_description, NULL, &drv_tab
};