PDP10, PDP11, Massbus VAXen, DISK: Rework PDP10 use of sim_disk

- Make all PDP11, VAX RP and RQ devices autosizing behave similarly
- Generalize the attach help to be specific to the device/system being
   attached
- Remove the sim_disk_pdp10_* calls which weren't correct or needed
   since sim_disk_attach_ex provides sector size which is used correctly
This commit is contained in:
Mark Pizzolato 2020-04-03 17:32:14 -07:00
parent b168114f61
commit 73df9b1c4e
7 changed files with 202 additions and 222 deletions

View file

@ -90,11 +90,9 @@
#define UNIT_V_AUTO (DKUF_V_UF + 4) /* autosize */
#define UNIT_V_UTS (DKUF_V_UF + 5) /* Up to speed */
#define UNIT_UTS (1u << UNIT_V_UTS)
#define UNIT_V_DUMMY (DKUF_V_UF + 6) /* dummy flag */
#define UNIT_WLK (1 << UNIT_V_WLK)
#define UNIT_DTYPE (UNIT_M_DTYPE << UNIT_V_DTYPE)
#define UNIT_AUTO (1 << UNIT_V_AUTO)
#define UNIT_DUMMY (1 << UNIT_V_DUMMY)
#define GET_DTYPE(x) (((x) >> UNIT_V_DTYPE) & UNIT_M_DTYPE)
#define UNIT_WPRT (UNIT_WLK | UNIT_RO) /* write protect */
@ -380,7 +378,8 @@ t_stat rp_detach (UNIT *uptr);
void set_rper (int16 flag, int32 drv);
void update_rpcs (int32 flags, int32 drv);
void rp_go (int32 drv, int32 fnc);
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rp_set_type (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rp_show_type (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat rp_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
const char *rp_description (DEVICE *dptr);
@ -453,49 +452,26 @@ MTAB rp_mod[] = {
NULL, NULL, NULL, "Write enable disk drive" },
{ UNIT_WLK, UNIT_WLK, "write locked", "LOCKED",
NULL, NULL, NULL, "Write lock disk drive" },
{ (UNIT_DTYPE+UNIT_ATT), (RM03_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM03", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP04_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP04", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RM80_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM80", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP06_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP06", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RM05_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM05", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP07_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP07", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM03_DTYPE << UNIT_V_DTYPE),
"RM03", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP04_DTYPE << UNIT_V_DTYPE),
"RP04", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM80_DTYPE << UNIT_V_DTYPE),
"RM80", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP06_DTYPE << UNIT_V_DTYPE),
"RP06", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM05_DTYPE << UNIT_V_DTYPE),
"RM05", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP07_DTYPE << UNIT_V_DTYPE),
"RP07", NULL, NULL },
{ (UNIT_AUTO+UNIT_ATT), UNIT_AUTO, "autosize", NULL, NULL },
{ UNIT_AUTO, UNIT_AUTO, NULL, "AUTOSIZE", NULL, NULL, NULL,
"Enables disk autosize on attach" },
{ UNIT_AUTO, 0, NULL, "NOAUTOSIZE", NULL, NULL, NULL,
"Disables disk autosize on attach" },
{ MTAB_XTD|MTAB_VUN, RM03_DTYPE, NULL, "RM03",
&rp_set_type, NULL, NULL, "Set RM03 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP04_DTYPE, NULL, "RP04",
&rp_set_type, NULL, NULL, "Set RP04 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RM80_DTYPE, NULL, "RM80",
&rp_set_type, NULL, NULL, "Set RM80 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP06_DTYPE, NULL, "RP06",
&rp_set_type, NULL, NULL, "Set RP06 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RM05_DTYPE, NULL, "RM05",
&rp_set_type, NULL, NULL, "Set RM05 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP07_DTYPE, NULL, "RP07",
&rp_set_type, NULL, NULL, "Set RP07 Disk Type" },
{ MTAB_XTD|MTAB_VUN, 0, "TYPE", NULL,
NULL, &rp_show_type, NULL, "Display device type" },
{ UNIT_AUTO, UNIT_AUTO, "autosize", "AUTOSIZE",
NULL, NULL, NULL, "Set type based on file size at attach" },
{ UNIT_AUTO, 0, "noautosize", "NOAUTOSIZE",
NULL, NULL, NULL, "Disable disk autosize on attach" },
{ MTAB_XTD|MTAB_VUN|MTAB_VALR, 0, "FORMAT", "FORMAT={SIMH|VHD|RAW}",
&sim_disk_set_fmt, &sim_disk_show_fmt, NULL, "Set/Display disk container format" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM03_DTYPE << UNIT_V_DTYPE),
NULL, "RM03", &rp_set_size, NULL, NULL, "Set RP04 Disk Type" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP04_DTYPE << UNIT_V_DTYPE),
NULL, "RP04", &rp_set_size, NULL, NULL, "Set RP04 Disk Type" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM80_DTYPE << UNIT_V_DTYPE),
NULL, "RM80", &rp_set_size, NULL, NULL, "Set RM80 Disk Type" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP06_DTYPE << UNIT_V_DTYPE),
NULL, "RP06", &rp_set_size, NULL, NULL, "Set RP06 Disk Type" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM05_DTYPE << UNIT_V_DTYPE),
NULL, "RM05", &rp_set_size, NULL, NULL, "Set RM05 Disk Type" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP07_DTYPE << UNIT_V_DTYPE),
NULL, "RP07", &rp_set_size, NULL, NULL, "Set RP07 Disk Type" },
&sim_disk_set_fmt, &sim_disk_show_fmt, NULL, "Display disk format" },
{ MTAB_XTD|MTAB_VDV, 0, "ADDRESS", NULL,
NULL, &show_addr, NULL },
{ MTAB_XTD|MTAB_VDV, 0, "VECTOR", NULL,
@ -508,7 +484,7 @@ DEVICE rp_dev = {
RP_NUMDR, 8, 30, 1, 8, 36,
NULL, NULL, &rp_reset,
&rp_boot, &rp_attach, &rp_detach,
&rp_dib, DEV_UBUS | DEV_DEBUG,
&rp_dib, DEV_UBUS | DEV_DEBUG | DEV_DISK,
0, rp_debug, NULL, NULL, &rp_help, sim_disk_attach_help, NULL,
&rp_description
};
@ -991,14 +967,14 @@ switch (uptr->FUNC) { /* case on function */
for (i = 0; i < fc10; i++)
dbuf[twc10 + i] = 0;
}
r = sim_disk_pdp10_wrsect (uptr, da/RP_NUMWD, (uint8 *)dbuf,
NULL, (twc10 + fc10 + RP_NUMWD - 1)/RP_NUMWD);
r = sim_disk_wrsect (uptr, da/RP_NUMWD, (uint8 *)dbuf,
NULL, (twc10 + fc10 + RP_NUMWD - 1)/RP_NUMWD);
} /* end if */
else { /* read, wchk, readh */
t_seccnt sectsread;
r = sim_disk_pdp10_rdsect (uptr, da/RP_NUMWD, (uint8 *)dbuf,
&sectsread, (wc10 + RP_NUMWD - 1)/RP_NUMWD);
r = sim_disk_rdsect (uptr, da/RP_NUMWD, (uint8 *)dbuf,
&sectsread, (wc10 + RP_NUMWD - 1)/RP_NUMWD);
awc10 = sectsread * RP_NUMWD;
for ( ; awc10 < wc10; awc10++)
dbuf[awc10] = 0;
@ -1172,30 +1148,18 @@ return SCPE_OK;
t_stat rp_attach (UNIT *uptr, CONST char *cptr)
{
int32 i, p;
t_stat r;
static const char *drives[] = {"RM03", "RP04", "RM80", "RP06", "RM05", "RP07", NULL};
uptr->capac = drv_tab[GET_DTYPE (uptr->flags)].size;
r = sim_disk_pdp10_attach (uptr, cptr, (uptr->flags & UNIT_AUTO) == 0, DBG_DSK,
r = sim_disk_attach_ex (uptr, cptr, RP_NUMWD * sizeof (d10), sizeof (d10), TRUE, DBG_DSK,
drv_tab[GET_DTYPE (uptr->flags)].name,
0, (uptr->flags & UNIT_AUTO) ? drives : NULL);
0, 0, (uptr->flags & UNIT_AUTO) ? drives : NULL);
if (r != SCPE_OK)
return r;
sim_cancel (uptr);
uptr->flags &= ~UNIT_UTS;
sim_activate_after (uptr, SPINUP_DLY);
if ((uptr->flags & UNIT_AUTO) == 0) /* autosize? */
return SCPE_OK;
p = (int32)sim_disk_size (uptr);
for (i = 0; drv_tab[i].sect != 0; i++) {
if (p <= (drv_tab[i].size * (int) sizeof (d10))) {
uptr->flags = (uptr->flags & ~UNIT_DTYPE) | (i << UNIT_V_DTYPE);
uptr->capac = drv_tab[i].size;
return SCPE_OK;
}
}
/* File is larger than max known disk. This should probably fail. */
return SCPE_OK;
}
@ -1223,15 +1187,26 @@ update_rpcs (0, drv); /* request intr */
return sim_disk_detach (uptr);
}
/* Set size command validation routine */
/* Set type command validation routine */
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
t_stat rp_set_type (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{
int32 dtype = GET_DTYPE (val);
if ((val < 0) || (cptr && *cptr))
return SCPE_ARG;
if (uptr->flags & UNIT_ATT)
return SCPE_ALATT;
uptr->capac = drv_tab[dtype].size;
uptr->flags = (uptr->flags & ~UNIT_DTYPE) | (val << UNIT_V_DTYPE);
uptr->capac = (t_addr)drv_tab[val].size;
return SCPE_OK;
}
/* Show unit type */
t_stat rp_show_type (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{
fprintf (st, "%s", drv_tab[GET_DTYPE (uptr->flags)].name);
return SCPE_OK;
}

View file

@ -578,7 +578,8 @@ void rp_set_er (int16 flg, int32 drv);
void rp_clr_as (int32 mask);
void rp_update_ds (uint16 flg, int32 drv);
t_stat rp_go (int32 drv);
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rp_set_type (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rp_show_type (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat rp_set_bad (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
int32 rp_abort (void);
t_stat rp_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
@ -621,7 +622,7 @@ REG rp_reg[] = {
{ BRDATADF (DA, rpda, DEV_RDX, 16, RP_NUMDR, "desired surface, sector", rp_da_bits) },
{ BRDATADF (DS, rpds, DEV_RDX, 16, RP_NUMDR, "drive status", rp_ds_bits) },
{ BRDATADF (ER1, rper1, DEV_RDX, 16, RP_NUMDR, "drive errors", rp_er1_bits) },
{ BRDATAD (HR, rmhr, DEV_RDX, 16, RP_NUMDR, "holding register") },
{ BRDATAD (HR, rmhr, DEV_RDX, 16, RP_NUMDR, "holding register") },
{ BRDATADF (OF, rpof, DEV_RDX, 16, RP_NUMDR, "offset", rp_of_bits) },
{ BRDATADF (DC, rpdc, DEV_RDX, 16, RP_NUMDR, "desired cylinder", rp_dc_bits) },
{ BRDATADF (ER2, rper2, DEV_RDX, 16, RP_NUMDR, "error status 2", rp_er2_bits) },
@ -629,13 +630,13 @@ REG rp_reg[] = {
{ BRDATADF (EC1, rpec1, DEV_RDX, 16, RP_NUMDR, "ECC syndrome 1", rp_ec1_bits) },
{ BRDATADF (EC2, rpec2, DEV_RDX, 16, RP_NUMDR, "ECC syndrome 2", rp_ec2_bits) },
{ BRDATADF (MR, rpmr, DEV_RDX, 16, RP_NUMDR, "maintenance register", rp_mr_bits) },
{ BRDATAD (MR2, rmmr2, DEV_RDX, 16, RP_NUMDR, "maintenance register 2 (RM only)") },
{ DRDATAD (STIME, rp_swait, 24, "seek time, per cylinder"), REG_NZ + PV_LEFT },
{ DRDATAD (RTIME, rp_rwait, 24, "rotational delay"), REG_NZ + PV_LEFT },
{ URDATA (CAPAC, rp_unit[0].capac, 10, T_ADDR_W, 0,
{ BRDATAD (MR2, rmmr2, DEV_RDX, 16, RP_NUMDR, "maintenance register 2 (RM only)") },
{ DRDATAD (STIME, rp_swait, 24, "seek time, per cylinder"), REG_NZ + PV_LEFT },
{ DRDATAD (RTIME, rp_rwait, 24, "rotational delay"), REG_NZ + PV_LEFT },
{ URDATA (CAPAC, rp_unit[0].capac, 10, T_ADDR_W, 0,
RP_NUMDR, PV_LEFT | REG_HRO) },
{ FLDATAD (STOP_IOE, rp_stopioe, 0, "stop on I/O error") },
{ GRDATA (CTRLTYPE, rp_dib.lnt, DEV_RDX, 16, 0), REG_HRO },
{ FLDATAD (STOP_IOE, rp_stopioe, 0, "stop on I/O error") },
{ GRDATA (CTRLTYPE, rp_dib.lnt, DEV_RDX, 16, 0), REG_HRO },
{ NULL }
};
@ -648,47 +649,26 @@ MTAB rp_mod[] = {
NULL, NULL, NULL, "Write lock disk drive" },
{ UNIT_DUMMY, 0, NULL, "BADBLOCK",
&rp_set_bad, NULL, NULL, "write bad block table on last track" },
{ MTAB_XTD|MTAB_VUN, RM03_DTYPE, NULL, "RM03",
&rp_set_type, NULL, NULL, "Set RM03 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP04_DTYPE, NULL, "RP04",
&rp_set_type, NULL, NULL, "Set RP04 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RM80_DTYPE, NULL, "RM80",
&rp_set_type, NULL, NULL, "Set RM80 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP06_DTYPE, NULL, "RP06",
&rp_set_type, NULL, NULL, "Set RP06 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RM05_DTYPE, NULL, "RM05",
&rp_set_type, NULL, NULL, "Set RM05 Disk Type" },
{ MTAB_XTD|MTAB_VUN, RP07_DTYPE, NULL, "RP07",
&rp_set_type, NULL, NULL, "Set RP07 Disk Type" },
{ MTAB_XTD|MTAB_VUN, 0, "TYPE", NULL,
NULL, &rp_show_type, NULL, "Display device type" },
{ UNIT_AUTO, UNIT_AUTO, "autosize", "AUTOSIZE",
NULL, NULL, NULL, "Set type based on file size at attach" },
{ UNIT_AUTO, 0, "noautosize", "NOAUTOSIZE",
NULL, NULL, NULL, "Disable disk autosize on attach" },
{ MTAB_XTD|MTAB_VUN|MTAB_VALR, 0, "FORMAT", "FORMAT={SIMH|VHD|RAW}",
&sim_disk_set_fmt, &sim_disk_show_fmt, NULL, "Display disk format" },
{ (UNIT_DTYPE+UNIT_ATT), (RM03_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM03", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP04_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP04", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RM80_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM80", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP06_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP06", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RM05_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RM05", NULL, NULL },
{ (UNIT_DTYPE+UNIT_ATT), (RP07_DTYPE << UNIT_V_DTYPE) + UNIT_ATT,
"RP07", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM03_DTYPE << UNIT_V_DTYPE),
"RM03", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP04_DTYPE << UNIT_V_DTYPE),
"RP04", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM80_DTYPE << UNIT_V_DTYPE),
"RM80", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP06_DTYPE << UNIT_V_DTYPE),
"RP06", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RM05_DTYPE << UNIT_V_DTYPE),
"RM05", NULL, NULL },
{ (UNIT_AUTO+UNIT_DTYPE+UNIT_ATT), (RP07_DTYPE << UNIT_V_DTYPE),
"RP07", NULL, NULL },
{ (UNIT_AUTO+UNIT_ATT), UNIT_AUTO, "autosize", NULL, NULL },
{ UNIT_AUTO, UNIT_AUTO, NULL, "AUTOSIZE",
NULL, NULL, NULL, "set type based on file size at ATTACH" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM03_DTYPE << UNIT_V_DTYPE), NULL, "RM03",
&rp_set_size, NULL, NULL, "Set type to RM03" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP04_DTYPE << UNIT_V_DTYPE), NULL, "RP04",
&rp_set_size, NULL, NULL, "Set type to RP04" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM80_DTYPE << UNIT_V_DTYPE), NULL, "RM80",
&rp_set_size, NULL, NULL, "Set type to RM80" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP06_DTYPE << UNIT_V_DTYPE), NULL, "RP06",
&rp_set_size, NULL, NULL, "Set type to RP06" },
{ (UNIT_AUTO+UNIT_DTYPE), (RM05_DTYPE << UNIT_V_DTYPE), NULL, "RM05",
&rp_set_size, NULL, NULL, "Set type to RM05" },
{ (UNIT_AUTO+UNIT_DTYPE), (RP07_DTYPE << UNIT_V_DTYPE), NULL, "RP07",
&rp_set_size, NULL, NULL, "Set type to RP07" },
&sim_disk_set_fmt, &sim_disk_show_fmt, NULL, "Set/Display disk format" },
{ 0 }
};
@ -1418,15 +1398,26 @@ if (!sim_is_running) /* from console? */
return sim_disk_detach (uptr);
}
/* Set size command validation routine */
/* Set type command validation routine */
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
t_stat rp_set_type (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{
int32 dtype = GET_DTYPE (val);
if ((val < 0) || (cptr && *cptr))
return SCPE_ARG;
if (uptr->flags & UNIT_ATT)
return SCPE_ALATT;
uptr->capac = drv_tab[dtype].size;
uptr->flags = (uptr->flags & ~UNIT_DTYPE) | (val << UNIT_V_DTYPE);
uptr->capac = (t_addr)drv_tab[val].size;
return SCPE_OK;
}
/* Show unit type */
t_stat rp_show_type (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{
fprintf (st, "%s", drv_tab[GET_DTYPE (uptr->flags)].name);
return SCPE_OK;
}

View file

@ -1086,8 +1086,8 @@ MTAB rq_mod[] = {
&rq_set_plug, &rq_show_plug, NULL, "Set/Display Unit plug value" },
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, NULL, "DRIVES=val (4-254)",
&rq_set_drives, NULL, NULL, "Set Number of Drives" },
{ UNIT_NOAUTO, UNIT_NOAUTO, "noautosize", "NOAUTOSIZE", NULL, NULL, NULL, "Disables disk autosize on attach" },
{ UNIT_NOAUTO, 0, "autosize", "AUTOSIZE", NULL, NULL, NULL, "Enables disk autosize on attach" },
{ UNIT_NOAUTO, UNIT_NOAUTO, "noautosize", "NOAUTOSIZE", NULL, NULL, NULL, "Disable disk autosize on attach" },
{ UNIT_NOAUTO, 0, "autosize", "AUTOSIZE", NULL, NULL, NULL, "Enable disk autosize on attach" },
{ MTAB_XTD|MTAB_VUN|MTAB_VALR, 0, "FORMAT", "FORMAT={SIMH|VHD|RAW}",
&sim_disk_set_fmt, &sim_disk_show_fmt, NULL, "Set/Display disk format" },
#if defined (VM_PDP11)

Binary file not shown.

View file

@ -433,8 +433,9 @@ typedef uint32 t_addr;
#define SCPE_SIGTERM (SCPE_BASE + 48) /* SIGTERM has been received */
#define SCPE_FSSIZE (SCPE_BASE + 49) /* File System size larger than disk size */
#define SCPE_RUNTIME (SCPE_BASE + 50) /* Run Time Limit Exhausted */
#define SCPE_INCOMPVHD (SCPE_BASE + 51) /* Incompatible VHD Container */
#define SCPE_MAX_ERR (SCPE_BASE + 50) /* Maximum SCPE Error Value */
#define SCPE_MAX_ERR (SCPE_BASE + 51) /* Maximum SCPE Error Value */
#define SCPE_KFLAG 0x10000000 /* tti data flag */
#define SCPE_BREAK 0x20000000 /* tti break flag */
#define SCPE_NOMESSAGE 0x40000000 /* message display supression flag */

View file

@ -53,14 +53,6 @@ Public routines:
sim_disk_data_trace debug support
sim_disk_test unit test routine
Guest-specific routines for PDP-10 which uses 1024 byte sectors and
requires mapping functions to allow access to the underlying 512 byte
sectors provided by the sim_disk routines
sim_disk_pdp10_attach attach disk unit
sim_disk_pdp10_rdsect read PDP-10 disk sectors
sim_disk_pdp10_wrsect write PDP-10 disk sectors
Internal routines:
sim_os_disk_open_raw platform specific open raw device
@ -282,8 +274,8 @@ static t_offset sim_vhd_disk_size (FILE *f);
static t_stat sim_vhd_disk_rdsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects);
static t_stat sim_vhd_disk_wrsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectswritten, t_seccnt sects);
static t_stat sim_vhd_disk_clearerr (UNIT *uptr);
static t_stat sim_vhd_disk_set_dtype (FILE *f, const char *dtype);
static const char *sim_vhd_disk_get_dtype (FILE *f);
static t_stat sim_vhd_disk_set_dtype (FILE *f, const char *dtype, uint32 SectorSize, uint32 xfer_element_size);
static const char *sim_vhd_disk_get_dtype (FILE *f, uint32 *SectorSize, uint32 *xfer_element_size);
static t_stat sim_os_disk_implemented_raw (void);
static FILE *sim_os_disk_open_raw (const char *rawdevicename, const char *openmode);
static int sim_os_disk_close_raw (FILE *f);
@ -306,11 +298,11 @@ struct sim_disk_fmt {
};
static struct sim_disk_fmt fmts[] = {
{ "AUTO", 0, DKUF_F_AUTO, NULL},
{ "SIMH", 0, DKUF_F_STD, NULL},
{ "RAW", 0, DKUF_F_RAW, sim_os_disk_implemented_raw},
{ "VHD", 0, DKUF_F_VHD, sim_vhd_disk_implemented},
{ NULL, 0, 0, NULL}
{ "AUTO detect", 0, DKUF_F_AUTO, NULL},
{ "SIMH", 0, DKUF_F_STD, NULL},
{ "RAW", 0, DKUF_F_RAW, sim_os_disk_implemented_raw},
{ "VHD", 0, DKUF_F_VHD, sim_vhd_disk_implemented},
{ NULL, 0, 0, NULL}
};
/* Set disk format */
@ -321,10 +313,10 @@ uint32 f;
if (uptr == NULL)
return SCPE_IERR;
if (cptr == NULL)
if ((cptr == NULL) || (*cptr == '\0'))
return SCPE_ARG;
for (f = 0; fmts[f].name; f++) {
if (fmts[f].name && (strcmp (cptr, fmts[f].name) == 0)) {
if (fmts[f].name && (MATCH_CMD (cptr, fmts[f].name) == 0)) {
if ((fmts[f].impl_fnc) && (fmts[f].impl_fnc() != SCPE_OK))
return SCPE_NOFNC;
uptr->flags = (uptr->flags & ~DKUF_FMT) |
@ -2031,13 +2023,13 @@ for (i = 0; checks[i] != NULL; i++) {
return ret_val;
}
t_stat sim_disk_attach (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontautosize,
t_stat sim_disk_attach (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontchangecapac,
uint32 dbit, const char *dtype, uint32 pdp11tracksize, int completion_delay)
{
return sim_disk_attach_ex (uptr, cptr, sector_size, xfer_element_size, dontautosize, dbit, dtype, pdp11tracksize, completion_delay, NULL);
return sim_disk_attach_ex (uptr, cptr, sector_size, xfer_element_size, dontchangecapac, dbit, dtype, pdp11tracksize, completion_delay, NULL);
}
t_stat sim_disk_attach_ex (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontautosize,
t_stat sim_disk_attach_ex (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontchangecapac,
uint32 dbit, const char *dtype, uint32 pdp11tracksize, int completion_delay, const char **drivetypes)
{
struct disk_context *ctx;
@ -2079,7 +2071,7 @@ if (sim_switches & SWMASK ('D')) { /* create difference dis
vhd = sim_vhd_disk_create_diff (gbuf, cptr);
if (vhd) {
sim_vhd_disk_close (vhd);
return sim_disk_attach (uptr, gbuf, sector_size, xfer_element_size, dontautosize, dbit, dtype, pdp11tracksize, completion_delay);
return sim_disk_attach (uptr, gbuf, sector_size, xfer_element_size, dontchangecapac, dbit, dtype, pdp11tracksize, completion_delay);
}
return sim_messagef (SCPE_ARG, "Unable to create differencing VHD: %s\n", gbuf);
}
@ -2098,7 +2090,7 @@ if (sim_switches & SWMASK ('C')) { /* create vhd disk & cop
sim_switches |= SWMASK ('R') | SWMASK ('E');
sim_quiet = TRUE;
/* First open the source of the copy operation */
r = sim_disk_attach (uptr, cptr, sector_size, xfer_element_size, dontautosize, dbit, dtype, pdp11tracksize, completion_delay);
r = sim_disk_attach (uptr, cptr, sector_size, xfer_element_size, dontchangecapac, dbit, dtype, pdp11tracksize, completion_delay);
sim_quiet = saved_sim_quiet;
if (r != SCPE_OK) {
sim_switches = saved_sim_switches;
@ -2228,7 +2220,7 @@ else
t_stat r;
sim_vhd_disk_close (vhd);
r = sim_disk_attach (uptr, Parent, sector_size, xfer_element_size, dontautosize, dbit, dtype, pdp11tracksize, completion_delay);
r = sim_disk_attach (uptr, Parent, sector_size, xfer_element_size, dontchangecapac, dbit, dtype, pdp11tracksize, completion_delay);
free (Parent);
return r;
}
@ -2328,13 +2320,27 @@ else { /* normal */
} /* end if null */
} /* end else */
if (DK_GET_FMT (uptr) == DKUF_F_VHD) {
if ((created) && dtype)
sim_vhd_disk_set_dtype (uptr->fileref, dtype);
if (dtype && strcmp (dtype, sim_vhd_disk_get_dtype (uptr->fileref))) {
char cmd[32];
uint32 sector_size, xfer_element_size;
sprintf (cmd, "%s%d %s", dptr->name, (int)(uptr-dptr->units), sim_vhd_disk_get_dtype (uptr->fileref));
set_cmd (0, cmd);
if ((created) && dtype)
sim_vhd_disk_set_dtype (uptr->fileref, dtype, ctx->sector_size, ctx->xfer_element_size);
if (dtype && strcmp (dtype, sim_vhd_disk_get_dtype (uptr->fileref, &sector_size, &xfer_element_size))) {
char cmd[32];
t_stat r = SCPE_OK;
if (((sector_size == 0) || (sector_size == ctx->sector_size)) &&
((xfer_element_size == 0) || (xfer_element_size == ctx->xfer_element_size))) {
sprintf (cmd, "%s%d %s", dptr->name, (int)(uptr-dptr->units), sim_vhd_disk_get_dtype (uptr->fileref, NULL, NULL));
r = set_cmd (0, cmd);
if (r != SCPE_OK)
r = sim_messagef (r, "Can't set %s%d to drive type %s\n", dptr->name, (int)(uptr-dptr->units), sim_vhd_disk_get_dtype (uptr->fileref, NULL, NULL));
}
else
r = sim_messagef (SCPE_INCOMPVHD, "VHD incompatible with %s simulator\n", sim_name);
if (r != SCPE_OK) {
sim_disk_detach (uptr); /* report error now */
return r;
}
}
}
uptr->flags = uptr->flags | UNIT_ATT;
@ -2468,9 +2474,11 @@ filesystem_size = get_filesystem_size (uptr);
container_size = size_function (uptr->fileref);
current_unit_size = ((t_offset)uptr->capac)*ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1);
if (container_size && (container_size != (t_offset)-1)) {
if (dontautosize) {
if (dontchangecapac) {
t_addr saved_capac = uptr->capac;
if (filesystem_size == (t_offset)-1) /* No file system found? */
filesystem_size = container_size; /* Assume full container */
if (filesystem_size != (t_offset)-1) {
const char *drive_type = NULL;
@ -2610,22 +2618,43 @@ static struct example_fields {
const char *dsize3;
const char *dtype4;
const char *dsize4;
} ex_data[2] = {
{"RQ", "RD54", "159MB", "RX50", "409KB", "RA81", "456MB", "RA92", "1505MB"},
{"RP", "autosize", "39MW", "autosize", "39MW", "RP07", "110MW", "RM03", "15MW"},
} ex_data[] = {
{"RQ", "RD54", "159MB", "RX50", "409KB", "RA81", "456MB", "RA92", "1505MB"},
{"RP", "RM03", "33MW", "RM03", "33MW", "RP07", "258MW", "RM03", "15MW"},
{"RP", "RM03", "39MW", "RM03", "39MW", "RP07", "110MW", "RM03", "15MW"},
};
struct example_fields *ex = &ex_data[0];
if (strcmp (dptr->name, "RP") == 0)
ex = &ex_data[1];
if (strstr (sim_name, "-10")) {
ex = &ex_data[2];
if (strstr (sim_name, "PDP") == NULL)
ex->dname = "RPA";
}
fprintf (st, "%s Disk Attach Help\n\n", dptr->name);
fprintf (st, "Disk container files can be one of 3 different types:\n\n");
fprintf (st, " SIMH A disk is an unstructured binary file of the size appropriate\n");
fprintf (st, " for the disk drive being simulated\n");
fprintf (st, " VHD Virtual Disk format which is described in the \"Microsoft\n");
fprintf (st, " Virtual Hard Disk (VHD) Image Format Specification\". The\n");
fprintf (st, " VHD implementation includes support for 1) Fixed (Preallocated)\n");
fprintf (st, " disks, 2) Dynamically Expanding disks, and 3) Differencing disks.\n");
fprintf (st, " RAW platform specific access to physical disk or CDROM drives\n\n");
fprintf (st, "Disk container files can be one of several different types:\n\n");
if (strstr (sim_name, "-10") == NULL) {
fprintf (st, " SIMH A disk is an unstructured binary file of the size appropriate\n");
fprintf (st, " for the disk drive being simulated accessed by C runtime APIs\n");
fprintf (st, " VHD Virtual Disk format which is described in the \"Microsoft\n");
fprintf (st, " Virtual Hard Disk (VHD) Image Format Specification\". The\n");
fprintf (st, " VHD implementation includes support for 1) Fixed (Preallocated)\n");
fprintf (st, " disks, 2) Dynamically Expanding disks, and 3) Differencing disks.\n");
fprintf (st, " RAW platform specific access to physical disk or CDROM drives\n\n");
}
else {
fprintf (st, " SIMH A disk is an unstructured binary file of 64bit integers\n"
" access by C runtime APIs\n");
fprintf (st, " VHD A disk is an unstructured binary file of 64bit integers\n"
" contained in a VHD container\n");
fprintf (st, " RAW A disk is an unstructured binary file of 64bit integers\n"
" accessed by direct read/write APIs\n");
fprintf (st, " DBD9 Compatible with KLH10 is a packed big endian word\n");
fprintf (st, " DLD9 Compatible with KLH10 is a packed little endian word\n\n");
}
fprintf (st, "Virtual (VHD) Disks supported conform to \"Virtual Hard Disk Image Format\n");
fprintf (st, "Specification\", Version 1.0 October 11, 2006.\n");
fprintf (st, "Dynamically expanding disks never change their \"Virtual Size\", but they don't\n");
@ -2692,23 +2721,17 @@ fprintf (st, " -M Merge a Differencing VHD into its parent VHD disk\
fprintf (st, " -O Override consistency checks when attaching differencing disks\n");
fprintf (st, " which have unexpected parent disk GUID or timestamps\n\n");
fprintf (st, " -U Fix inconsistencies which are overridden by the -O switch\n");
if (strstr (sim_name, "PDP10") == NULL) {
if (strstr (sim_name, "-10") == NULL) {
fprintf (st, " -Y Answer Yes to prompt to overwrite last track (on disk create)\n");
fprintf (st, " -N Answer No to prompt to overwrite last track (on disk create)\n");
}
if (strstr (sim_name, "PDP10-")) {
ex = &ex_data[1];
ex->dname = "RPA";
}
if (strcmp (dptr->name, "RP") == 0)
ex = &ex_data[1];
fprintf (st, "Examples:\n");
fprintf (st, " sim> show %s\n", ex->dname);
fprintf (st, " %s, address=20001468-2000146B*, no vector, 4 units\n", ex->dname);
fprintf (st, " %s0, %s, not attached, write enabled, %s, autosize, SIMH format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s1, %s, not attached, write enabled, %s, autosize, SIMH format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s2, %s, not attached, write enabled, %s, autosize, SIMH format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s3, %s, not attached, write enabled, %s, autosize, SIMH format\n", ex->dname, ex->dsize2, ex->dtype2);
fprintf (st, " %s0, %s, not attached, write enabled, %s, autosize, AUTO detect format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s1, %s, not attached, write enabled, %s, autosize, AUTO detect format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s2, %s, not attached, write enabled, %s, autosize, AUTO detect format\n", ex->dname, ex->dsize, ex->dtype);
fprintf (st, " %s3, %s, not attached, write enabled, %s, autosize, AUTO detect format\n", ex->dname, ex->dsize2, ex->dtype2);
fprintf (st, " sim> # attach an existing VHD and determine its size and type automatically\n");
fprintf (st, " sim> attach %s0 %s.vhd\n", ex->dname, ex->dtype3);
fprintf (st, " sim> show %s0\n", ex->dname);
@ -2719,7 +2742,7 @@ fprintf (st, " sim> attach %s2 -f vhd %s.vhd\n", ex->dname, ex->dtype4);
fprintf (st, " %s2: creating new file\n", ex->dname);
fprintf (st, " sim> show %s2\n", ex->dname);
fprintf (st, " %s2, %s, attached to %s.vhd, write enabled, %s, autosize, VHD format\n", ex->dname, ex->dsize4, ex->dtype4, ex->dtype4);
fprintf (st, " sim> # examine the size consumed by the %s VHD file", ex->dsize4);
fprintf (st, " sim> # examine the size consumed by the %s VHD file\n", ex->dsize4);
fprintf (st, " sim> dir %s.vhd\n", ex->dtype4);
fprintf (st, " Directory of H:\\Data\n\n");
fprintf (st, " 04/14/2011 12:57 PM 5,120 %s.vhd\n", ex->dtype4);
@ -2728,15 +2751,15 @@ fprintf (st, " sim> # create a differencing vhd (%s-1-Diff.vhd) with %s.vhd as
fprintf (st, " sim> attach %s3 -d %s-1-Diff.vhd %s.vhd\n", ex->dname, ex->dtype4, ex->dtype4);
fprintf (st, " sim> # create a VHD (%s-1.vhd) which is a copy of an existing disk\n", ex->dtype4);
fprintf (st, " sim> attach %s3 -c %s-1.vhd %s.vhd\n", ex->dname, ex->dtype4, ex->dtype4);
fprintf (st, " %s3: creating new virtual disk '%s-1.vhd'\n", ex->dname, ex->dsize4);
fprintf (st, " %s3: creating new virtual disk '%s-1.vhd'\n", ex->dname, ex->dtype4);
fprintf (st, " %s3: Copied %s. 99%% complete.\n", ex->dname, ex->dsize4);
fprintf (st, " %s3: Copied %s. Done.\n", ex->dname, ex->dsize4);
fprintf (st, " sim> show %s3\n", ex->dname);
fprintf (st, " %s3, %s, attached to %s-1.vhd, write enabled, %s, autosize, VHD format\n", ex->dname, ex->dsize3, ex->dtype3, ex->dtype3);
fprintf (st, " sim> dir %s*\n", ex->dtype3);
fprintf (st, " %s3, %s, attached to %s-1.vhd, write enabled, %s, autosize, VHD format\n", ex->dname, ex->dsize4, ex->dtype4, ex->dtype4);
fprintf (st, " sim> dir %s*\n", ex->dtype4);
fprintf (st, " Directory of H:\\Data\n\n");
fprintf (st, " 04/14/2011 01:12 PM 5,120 %s-1.vhd\n", ex->dtype3);
fprintf (st, " 04/14/2011 12:58 PM 5,120 %s.vhd\n", ex->dtype3);
fprintf (st, " 04/14/2011 01:12 PM 5,120 %s-1.vhd\n", ex->dtype4);
fprintf (st, " 04/14/2011 12:58 PM 5,120 %s.vhd\n", ex->dtype4);
fprintf (st, " 2 File(s) 10,240 bytes\n");
fprintf (st, " sim> show %s2\n", ex->dname);
fprintf (st, " %s2, %s, not attached, write enabled, %s, autosize, VHD format\n", ex->dname, ex->dsize4, ex->dtype4);
@ -2907,37 +2930,6 @@ if (sim_deb && (dptr->dctrl & reason)) {
}
}
/* Guest specific Disk I/O support */
#define PDP10_SECTORS 2 /* PDP-10 sectors are 1024 bytes */
t_stat sim_disk_pdp10_attach (UNIT *uptr, const char *cptr, t_bool dontautosize,
uint32 dbit, const char *dtype, int completion_delay, const char **drivetypes)
{
return sim_disk_attach_ex (uptr, cptr, 512 * PDP10_SECTORS, sizeof (t_uint64), dontautosize, dbit, dtype, 0, completion_delay, drivetypes);
}
t_stat sim_disk_pdp10_rdsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects)
{
t_seccnt sectors;
t_stat r = sim_disk_rdsect (uptr, lba * PDP10_SECTORS, buf, &sectors, sects * PDP10_SECTORS);
if (sectsread)
*sectsread = sectors / PDP10_SECTORS;
return r;
}
t_stat sim_disk_pdp10_wrsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectswritten, t_seccnt sects)
{
t_seccnt sectors;
t_stat r = sim_disk_wrsect (uptr, lba * PDP10_SECTORS, buf, &sectors, sects * PDP10_SECTORS);
if (sectswritten)
*sectswritten = sectors / PDP10_SECTORS;
return r;
}
/* OS Specific RAW Disk I/O support */
#if defined _WIN32
@ -3888,10 +3880,12 @@ typedef struct _VHD_Footer {
name as a nul terminated string.
*/
uint8 DriveType[16];
uint32 DriveSectorSize;
uint32 DriveTransferElementSize;
/*
This field contains zeroes. It is 400 bytes in size.
This field contains zeroes. It is 392 bytes in size.
*/
uint8 Reserved[400];
uint8 Reserved[392];
} VHD_Footer;
/*
@ -4361,13 +4355,15 @@ static t_stat sim_vhd_disk_implemented (void)
return SCPE_OK;
}
static t_stat sim_vhd_disk_set_dtype (FILE *f, const char *dtype)
static t_stat sim_vhd_disk_set_dtype (FILE *f, const char *dtype, uint32 SectorSize, uint32 xfer_element_size)
{
VHDHANDLE hVHD = (VHDHANDLE)f;
int Status = 0;
memset (hVHD->Footer.DriveType, '\0', sizeof hVHD->Footer.DriveType);
memcpy (hVHD->Footer.DriveType, dtype, ((1+strlen (dtype)) < sizeof (hVHD->Footer.DriveType)) ? (1+strlen (dtype)) : sizeof (hVHD->Footer.DriveType));
hVHD->Footer.DriveSectorSize = NtoHl (SectorSize);
hVHD->Footer.DriveTransferElementSize = NtoHl (xfer_element_size);
hVHD->Footer.Checksum = 0;
hVHD->Footer.Checksum = NtoHl (CalculateVhdFooterChecksum (&hVHD->Footer, sizeof(hVHD->Footer)));
@ -4413,10 +4409,14 @@ if (Status)
return SCPE_OK;
}
static const char *sim_vhd_disk_get_dtype (FILE *f)
static const char *sim_vhd_disk_get_dtype (FILE *f, uint32 *SectorSize, uint32 *xfer_element_size)
{
VHDHANDLE hVHD = (VHDHANDLE)f;
if (SectorSize)
*SectorSize = NtoHl (hVHD->Footer.DriveSectorSize);
if (xfer_element_size)
*xfer_element_size = NtoHl (hVHD->Footer.DriveTransferElementSize);
return (char *)(&hVHD->Footer.DriveType[0]);
}
@ -5082,6 +5082,8 @@ hVHD->Dynamic.Checksum = NtoHl (CalculateVhdFooterChecksum (&hVHD->Dynamic, size
hVHD->Footer.Checksum = 0;
hVHD->Footer.DiskType = NtoHl (VHD_DT_Differencing);
memcpy (hVHD->Footer.DriveType, ParentFooter.DriveType, sizeof (hVHD->Footer.DriveType));
hVHD->Footer.DriveSectorSize = ParentFooter.DriveSectorSize;
hVHD->Footer.DriveTransferElementSize = ParentFooter.DriveTransferElementSize;
hVHD->Footer.Checksum = NtoHl (CalculateVhdFooterChecksum (&hVHD->Footer, sizeof(hVHD->Footer)));
if (WriteFilePosition (hVHD->File,

View file

@ -68,10 +68,25 @@ typedef void (*DISK_PCALLBACK)(UNIT *unit, t_stat status);
/* Prototypes */
t_stat sim_disk_attach (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontautosize,
uint32 debugbit, const char *drivetype, uint32 pdp11_tracksize, int completion_delay);
t_stat sim_disk_attach_ex (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontautosize,
uint32 dbit, const char *dtype, uint32 pdp11tracksize, int completion_delay, const char **drivetypes);
t_stat sim_disk_attach (UNIT *uptr,
const char *cptr,
size_t sector_size, size_t xfer_element_size,
t_bool dontchangecapac,
uint32 debugbit,
const char *drivetype,
uint32 pdp11_tracksize,
int completion_delay);
t_stat sim_disk_attach_ex (UNIT *uptr,
const char *cptr,
size_t sector_size,
size_t xfer_element_size,
t_bool dontchangecapac, /* if false just change uptr->capac as needed */
uint32 dbit, /* debug bit */
const char *dtype, /* drive type */
uint32 pdp11tracksize, /* BAD144 track */
int completion_delay, /* Minimum Delay for asynch I/O completion */
const char **drivetypes); /* list of drive types (from smallest to largest) */
/* to try and fit the container/file system into */
t_stat sim_disk_detach (UNIT *uptr);
t_stat sim_disk_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
t_stat sim_disk_rdsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects);
@ -97,10 +112,6 @@ t_bool sim_disk_vhd_support (void);
t_bool sim_disk_raw_support (void);
void sim_disk_data_trace (UNIT *uptr, const uint8 *data, size_t lba, size_t len, const char* txt, int detail, uint32 reason);
t_stat sim_disk_test (DEVICE *dptr);
t_stat sim_disk_pdp10_attach (UNIT *uptr, const char *cptr, t_bool dontautosize, uint32 dbit,
const char *dtype, int completion_delay, const char **drivetypes);
t_stat sim_disk_pdp10_rdsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects);
t_stat sim_disk_pdp10_wrsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectswritten, t_seccnt sects);
#ifdef __cplusplus
}