Skip to content

Commit

Permalink
DISK: Cleanup attach behaviors add better support for containers with…
Browse files Browse the repository at this point in the history
… meta data

At this time:
- The ZAP command exists to remove meta data from containers that
   have it.  Container files processed by the ZAP command will generally
   be restored to the size it was before the addition of the meta data
   and the file time stamps will be unchanged.
- Newly created containers get meta data.
- At attach time, containers that don't have meta data, but have
   recognized file systems that fit within the drive it is being
   attached to get meta data added without changing the file timestamps.
- Containers that don't have meta data and don't have a recognized
   file system that is <= the drive size are attached without comment
   and without adding meta data as long as the drive is NOT set to
   autosize (controllers that support multiple drive types all default to
   autosize, which can explicitly be disabled on a drive by drive basis).
- Containers that don't have meta data which are > the drive size can
   only be attached read only.
- Containers with meta data can not be attached to a different
   controller at all if the container size is smaller than the drive on the
   other controller.
- Containers that have meta data can be freely be attached to the
   controller that they were attached to when they got the meta data.
   If a file system is detected, it will be reported.  Otherwise if no
   recognized file system is found, the attach will be silent.  File
   system detection reporting can be suppressed with -Q on the attach
   command.
- Containers with meta data can only be attached read only to a different
   controller if the container is larger than the drive it is being
   attached to.
In the future:
- In general, containers with meta data (or recognized file systems)
   will be attachable to MSCP and SCSI controllers, as long as reasonable
   sector sizes and file system not requiring interleaving have been found.
- Containers without meta data will only be attachable if autosize
   is disabled and the container is <= the size of the drive.
- Explicitly setting a drive type on a unit will implicitly disable
   autosizing.  If a user wants to set the default drive for a unit
   and still allow autosizing they must explicitly set the unit to
   autosize after setting the drive type.

Relevant to: #1065, #1059, #1094, #1100, #1118, #1117
  • Loading branch information
markpizz committed Feb 8, 2022
1 parent a4054f3 commit 5015d6a
Show file tree
Hide file tree
Showing 6 changed files with 486 additions and 150 deletions.
7 changes: 4 additions & 3 deletions PDP11/pdp11_rk.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
#define RK_NUMDR 8 /* drives/controller */
#define RK_M_NUMDR 07
#define RK_SIZE (RK_NUMCY * RK_NUMSF * RK_NUMSC * RK_NUMWD)
#define RK_RSRVSEC (3 * RK_NUMSF * RK_NUMSC) /* reserved (unused) disk area */
/* words/drive */
#define RK_CTLI 1 /* controller int */
#define RK_SCPI(x) (2u << (x)) /* drive int */
Expand Down Expand Up @@ -912,9 +913,9 @@ t_stat rk_attach (UNIT *uptr, CONST char *cptr)
{
t_stat r;

r = sim_disk_attach_ex (uptr, cptr, RK_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
"RK05", 0, 0, NULL);
r = sim_disk_attach_ex2 (uptr, cptr, RK_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
"RK05", 0, 0, NULL, RK_RSRVSEC);
if (r != SCPE_OK) /* error? */
return r;
return SCPE_OK;
Expand Down
7 changes: 5 additions & 2 deletions PDP11/pdp11_rq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2959,10 +2959,13 @@ t_stat rq_attach (UNIT *uptr, CONST char *cptr)
{
MSC *cp = rq_ctxmap[uptr->cnum];
t_stat r;
t_bool dontchangecapac = (uptr->flags & UNIT_NOAUTO);

if (drv_tab[GET_DTYPE (uptr->flags)].flgs & RQDF_RO)
if (drv_tab[GET_DTYPE (uptr->flags)].flgs & RQDF_RO) {
sim_switches |= SWMASK ('R');
r = sim_disk_attach_ex (uptr, cptr, RQ_NUMBY, sizeof (uint16), (uptr->flags & UNIT_NOAUTO), DBG_DSK,
dontchangecapac = FALSE;
}
r = sim_disk_attach_ex (uptr, cptr, RQ_NUMBY, sizeof (uint16), dontchangecapac, DBG_DSK,
drv_tab[GET_DTYPE (uptr->flags)].name, 0, 0, (uptr->flags & UNIT_NOAUTO) ? NULL : drv_types);
if (r != SCPE_OK)
return r;
Expand Down
Binary file not shown.

0 comments on commit 5015d6a

Please sign in to comment.