mirror of
https://github.com/simh/simh.git
synced 2026-01-26 20:12:23 +00:00
SIMH: Fix spelling errors in comments and strings
This commit is contained in:
committed by
Mark Pizzolato
parent
32d6b09c8e
commit
c7df248f09
260
sim_disk.c
260
sim_disk.c
@@ -28,7 +28,7 @@
|
||||
This is the place which hides processing of various disk formats,
|
||||
as well as OS-specific direct hardware access.
|
||||
|
||||
25-Jan-11 MP Initial Implemementation
|
||||
25-Jan-11 MP Initial Implementation
|
||||
|
||||
Public routines:
|
||||
|
||||
@@ -311,8 +311,8 @@ return NULL;
|
||||
processing events for any unit. It is only called when an asynchronous
|
||||
thread has called sim_activate() to activate a unit. The job of this
|
||||
routine is to put the unit in proper condition to digest what may have
|
||||
occurred in the asynchrconous thread.
|
||||
|
||||
occurred in the asynchronous thread.
|
||||
|
||||
Since disk processing only handles a single I/O at a time to a
|
||||
particular disk device (due to using stdio for the SimH Disk format
|
||||
and stdio doesn't have an atomic seek+(read|write) operation),
|
||||
@@ -576,7 +576,7 @@ switch (DK_GET_FMT (uptr)) { /* case on format */
|
||||
sim_switches = 0;
|
||||
sim_quiet = 1;
|
||||
strcpy (path, uptr->filename);
|
||||
sim_disk_attach (uptr, path, ctx->sector_size, ctx->xfer_encode_size,
|
||||
sim_disk_attach (uptr, path, ctx->sector_size, ctx->xfer_encode_size,
|
||||
FALSE, ctx->dbit, NULL, 0, 0);
|
||||
sim_quiet = saved_quiet;
|
||||
sim_switches = saved_switches;
|
||||
@@ -874,7 +874,7 @@ while (tbc) {
|
||||
if (i < tbc) /* fill */
|
||||
memset (&buf[i], 0, tbc-i);
|
||||
if ((i == 0) && /* Reading at or past EOF? */
|
||||
feof (uptr->fileref))
|
||||
feof (uptr->fileref))
|
||||
i = tbc; /* return 0's which have already been filled in buffer */
|
||||
sectbytes = (i / ctx->sector_size) * ctx->sector_size;
|
||||
if (i > sectbytes)
|
||||
@@ -1123,7 +1123,7 @@ if (f == DKUF_F_RAW) {
|
||||
if (tbuf == NULL)
|
||||
return SCPE_MEM;
|
||||
/* Partial Sector writes require a read-modify-write sequence for the partial sectors */
|
||||
if (soffset)
|
||||
if (soffset)
|
||||
sim_os_disk_read (uptr, ssaddr, tbuf, NULL, ctx->storage_sector_size);
|
||||
sim_os_disk_read (uptr, sladdr, tbuf + (size_t)(sladdr - ssaddr), NULL, ctx->storage_sector_size);
|
||||
sim_buf_copy_swapped (tbuf + soffset,
|
||||
@@ -1235,13 +1235,13 @@ static t_stat _sim_disk_rdsect_interleave (UNIT *uptr, t_lba lba, uint8 *buf, t_
|
||||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||
t_lba sectno = lba, psa;
|
||||
t_stat status;
|
||||
|
||||
|
||||
if (sectsread)
|
||||
*sectsread = 0;
|
||||
|
||||
do {
|
||||
uint16 i, track, sector;
|
||||
|
||||
|
||||
/*
|
||||
* Map an LBA address into a physical sector address
|
||||
*/
|
||||
@@ -1394,7 +1394,7 @@ typedef struct _ODS2_FileHeader
|
||||
|
||||
typedef union _ODS2_Retreval
|
||||
{
|
||||
struct
|
||||
struct
|
||||
{
|
||||
unsigned fm2___fill : 14; /* type specific data */
|
||||
unsigned fm2_v_format : 2; /* format type code */
|
||||
@@ -1528,31 +1528,31 @@ if ((_DEC_rdsect (uptr, 512 / ctx->sector_size, (uint8 *)&Home, §s_read, siz
|
||||
goto Return_Cleanup;
|
||||
CheckSum1 = ODSChecksum (&Home, (uint16)((((char *)&Home.hm2_w_checksum1)-((char *)&Home.hm2_l_homelbn))/2));
|
||||
CheckSum2 = ODSChecksum (&Home, (uint16)((((char *)&Home.hm2_w_checksum2)-((char *)&Home.hm2_l_homelbn))/2));
|
||||
if ((Home.hm2_l_homelbn == 0) ||
|
||||
(Home.hm2_l_alhomelbn == 0) ||
|
||||
(Home.hm2_l_altidxlbn == 0) ||
|
||||
((Home.hm2_b_struclev != 2) && (Home.hm2_b_struclev != 5)) ||
|
||||
(Home.hm2_b_strucver == 0) ||
|
||||
(Home.hm2_w_cluster == 0) ||
|
||||
(Home.hm2_w_homevbn == 0) ||
|
||||
(Home.hm2_w_alhomevbn == 0) ||
|
||||
(Home.hm2_w_ibmapvbn == 0) ||
|
||||
(Home.hm2_l_ibmaplbn == 0) ||
|
||||
(Home.hm2_w_resfiles >= Home.hm2_l_maxfiles) ||
|
||||
(Home.hm2_w_ibmapsize == 0) ||
|
||||
(Home.hm2_w_resfiles < 5) ||
|
||||
if ((Home.hm2_l_homelbn == 0) ||
|
||||
(Home.hm2_l_alhomelbn == 0) ||
|
||||
(Home.hm2_l_altidxlbn == 0) ||
|
||||
((Home.hm2_b_struclev != 2) && (Home.hm2_b_struclev != 5)) ||
|
||||
(Home.hm2_b_strucver == 0) ||
|
||||
(Home.hm2_w_cluster == 0) ||
|
||||
(Home.hm2_w_homevbn == 0) ||
|
||||
(Home.hm2_w_alhomevbn == 0) ||
|
||||
(Home.hm2_w_ibmapvbn == 0) ||
|
||||
(Home.hm2_l_ibmaplbn == 0) ||
|
||||
(Home.hm2_w_resfiles >= Home.hm2_l_maxfiles) ||
|
||||
(Home.hm2_w_ibmapsize == 0) ||
|
||||
(Home.hm2_w_resfiles < 5) ||
|
||||
(Home.hm2_w_checksum1 != CheckSum1) ||
|
||||
(Home.hm2_w_checksum2 != CheckSum2))
|
||||
goto Return_Cleanup;
|
||||
if ((_DEC_rdsect (uptr, (Home.hm2_l_ibmaplbn+Home.hm2_w_ibmapsize+1) * (512 / ctx->sector_size),
|
||||
(uint8 *)&Header, §s_read, sizeof (Header) / ctx->sector_size, physsectsz)) ||
|
||||
if ((_DEC_rdsect (uptr, (Home.hm2_l_ibmaplbn+Home.hm2_w_ibmapsize+1) * (512 / ctx->sector_size),
|
||||
(uint8 *)&Header, §s_read, sizeof (Header) / ctx->sector_size, physsectsz)) ||
|
||||
(sects_read != (sizeof (Header) / ctx->sector_size)))
|
||||
goto Return_Cleanup;
|
||||
CheckSum1 = ODSChecksum (&Header, 255);
|
||||
if (CheckSum1 != *(((uint16 *)&Header)+255)) /* Verify Checksum on BITMAP.SYS file header */
|
||||
goto Return_Cleanup;
|
||||
Retr = (ODS2_Retreval *)(((uint16*)(&Header))+Header.fh2_b_mpoffset);
|
||||
/* The BitMap File has a single extent, which may be preceeded by a placement descriptor */
|
||||
/* The BitMap File has a single extent, which may be preceded by a placement descriptor */
|
||||
if (Retr->fm2_r_word0_bits.fm2_v_format == 0)
|
||||
Retr = (ODS2_Retreval *)(((uint16 *)Retr)+1); /* skip placement descriptor */
|
||||
switch (Retr->fm2_r_word0_bits.fm2_v_format)
|
||||
@@ -1574,12 +1574,12 @@ if ((_DEC_rdsect (uptr, ScbLbn * (512 / ctx->sector_size), (uint8 *)&Scb, §s
|
||||
CheckSum1 = ODSChecksum (&Scb, 255);
|
||||
if (CheckSum1 != *(((uint16 *)&Scb)+255)) /* Verify Checksum on Storage Control Block */
|
||||
goto Return_Cleanup;
|
||||
if ((Scb.scb_w_cluster != Home.hm2_w_cluster) ||
|
||||
if ((Scb.scb_w_cluster != Home.hm2_w_cluster) ||
|
||||
(Scb.scb_b_strucver != Home.hm2_b_strucver) ||
|
||||
(Scb.scb_b_struclev != Home.hm2_b_struclev))
|
||||
goto Return_Cleanup;
|
||||
sim_messagef (SCPE_OK, "%s: '%s' Contains ODS%d File system\n", sim_uname (uptr), sim_relative_path (uptr->filename), Home.hm2_b_struclev);
|
||||
sim_messagef (SCPE_OK, "%s: Volume Name: %12.12s Format: %12.12s Sectors In Volume: %u\n",
|
||||
sim_messagef (SCPE_OK, "%s: Volume Name: %12.12s Format: %12.12s Sectors In Volume: %u\n",
|
||||
sim_uname (uptr), Home.hm2_t_volname, Home.hm2_t_format, Scb.scb_l_volsize);
|
||||
ret_val = ((t_offset)Scb.scb_l_volsize) * 512;
|
||||
|
||||
@@ -1612,12 +1612,12 @@ if ((_DEC_rdsect (uptr, 512 / ctx->sector_size, (uint8 *)&Home, §s_read, siz
|
||||
goto Return_Cleanup;
|
||||
CheckSum1 = ODSChecksum (&Home, (uint16)((((char *)&Home.hm1_w_checksum1)-((char *)&Home.hm1_w_ibmapsize))/2));
|
||||
CheckSum2 = ODSChecksum (&Home, (uint16)((((char *)&Home.hm1_w_checksum2)-((char *)&Home.hm1_w_ibmapsize))/2));
|
||||
if ((Home.hm1_w_ibmapsize == 0) ||
|
||||
(Home.hm1_l_ibmaplbn == 0) ||
|
||||
(Home.hm1_w_maxfiles == 0) ||
|
||||
(Home.hm1_w_cluster != 1) ||
|
||||
((Home.hm1_w_structlev != HM1_C_LEVEL1) && (Home.hm1_w_structlev != HM1_C_LEVEL2)) ||
|
||||
(Home.hm1_l_ibmaplbn == 0) ||
|
||||
if ((Home.hm1_w_ibmapsize == 0) ||
|
||||
(Home.hm1_l_ibmaplbn == 0) ||
|
||||
(Home.hm1_w_maxfiles == 0) ||
|
||||
(Home.hm1_w_cluster != 1) ||
|
||||
((Home.hm1_w_structlev != HM1_C_LEVEL1) && (Home.hm1_w_structlev != HM1_C_LEVEL2)) ||
|
||||
(Home.hm1_l_ibmaplbn == 0) ||
|
||||
(Home.hm1_w_checksum1 != CheckSum1) ||
|
||||
(Home.hm1_w_checksum2 != CheckSum2))
|
||||
goto Return_Cleanup;
|
||||
@@ -1639,7 +1639,7 @@ if (Scb->scb_b_bitmapblks < 127)
|
||||
else
|
||||
ret_val = (((t_offset)Scb->scb_r_blocks[0].scb_w_freeblks << 16) + Scb->scb_r_blocks[0].scb_w_freeptr) * 512;
|
||||
sim_messagef (SCPE_OK, "%s: '%s' Contains an ODS1 File system\n", sim_uname (uptr), sim_relative_path (uptr->filename));
|
||||
sim_messagef (SCPE_OK, "%s: Volume Name: %12.12s Format: %12.12s Sectors In Volume: %u\n",
|
||||
sim_messagef (SCPE_OK, "%s: Volume Name: %12.12s Format: %12.12s Sectors In Volume: %u\n",
|
||||
sim_uname (uptr), Home.hm1_t_volname, Home.hm1_t_format, (uint32)(ret_val / 512));
|
||||
Return_Cleanup:
|
||||
uptr->capac = saved_capac;
|
||||
@@ -1678,7 +1678,7 @@ if ((_DEC_rdsect (uptr, 31 * (512 / ctx->sector_size), sector_buf, §s_read,
|
||||
(sects_read != (512 / ctx->sector_size)))
|
||||
goto Return_Cleanup;
|
||||
|
||||
if ((Label->pt_magic != PT_MAGIC) ||
|
||||
if ((Label->pt_magic != PT_MAGIC) ||
|
||||
(Label->pt_valid != PT_VALID))
|
||||
goto Return_Cleanup;
|
||||
|
||||
@@ -1765,7 +1765,7 @@ saved_capac = uptr->capac;
|
||||
uptr->capac = temp_capac;
|
||||
|
||||
while (sim_disk_rdsect(uptr, (t_lba)(sectfactor * cur_pos / sizeof (*Desc)), (uint8 *)Desc, §sread, sectfactor) == DKSE_OK) {
|
||||
if ((sectsread != sectfactor) ||
|
||||
if ((sectsread != sectfactor) ||
|
||||
(Desc->Version != 1) ||
|
||||
(0 != memcmp (Desc->Identifier, "CD001", sizeof (Desc->Identifier))))
|
||||
break;
|
||||
@@ -1805,14 +1805,14 @@ typedef struct BSD_211_disklabel {
|
||||
uint8 d_type; /* drive type */
|
||||
uint8 d_subtype; /* controller/d_type specific */
|
||||
char d_typename[16]; /* type name, e.g. "eagle" */
|
||||
/*
|
||||
/*
|
||||
* d_packname contains the pack identifier and is returned when
|
||||
* the disklabel is read off the disk or in-core copy.
|
||||
* d_boot0 is the (optional) name of the primary (block 0) bootstrap
|
||||
* as found in /mdec. This is returned when using
|
||||
* getdiskbyname(3) to retrieve the values from /etc/disktab.
|
||||
*/
|
||||
char d_packname[16]; /* pack identifier */
|
||||
char d_packname[16]; /* pack identifier */
|
||||
/* disk geometry: */
|
||||
uint16 d_secsize; /* # of bytes per sector */
|
||||
uint16 d_nsectors; /* # of data sectors per track */
|
||||
@@ -1901,7 +1901,7 @@ if ((_DEC_rdsect (uptr, 1, sector_buf, §s_read, 512 / ctx->sector_size, phys
|
||||
goto Return_Cleanup;
|
||||
|
||||
/* Confirm the Label magic numbers */
|
||||
if ((WORDSWAP(Label->d_magic) != BSD_DISKMAGIC) ||
|
||||
if ((WORDSWAP(Label->d_magic) != BSD_DISKMAGIC) ||
|
||||
(WORDSWAP(Label->d_magic2) != BSD_DISKMAGIC))
|
||||
goto Return_Cleanup;
|
||||
|
||||
@@ -1944,14 +1944,14 @@ typedef struct NetBSD_disklabel {
|
||||
uint16 d_type; /* drive type */
|
||||
uint16 d_subtype; /* controller/d_type specific */
|
||||
char d_typename[16]; /* type name, e.g. "eagle" */
|
||||
/*
|
||||
/*
|
||||
* d_packname contains the pack identifier and is returned when
|
||||
* the disklabel is read off the disk or in-core copy.
|
||||
* d_boot0 is the (optional) name of the primary (block 0) bootstrap
|
||||
* as found in /mdec. This is returned when using
|
||||
* getdiskbyname(3) to retrieve the values from /etc/disktab.
|
||||
*/
|
||||
char d_packname[16]; /* pack identifier */
|
||||
char d_packname[16]; /* pack identifier */
|
||||
/* disk geometry: */
|
||||
uint32 d_secsize; /* # of bytes per sector */
|
||||
uint32 d_nsectors; /* # of data sectors per track */
|
||||
@@ -2045,7 +2045,7 @@ if ((_DEC_rdsect (uptr, 0, (uint8 *)sector_buf, §s_read, 512 / ctx->sector_s
|
||||
goto Return_Cleanup;
|
||||
|
||||
/* Confirm the Label magic numbers */
|
||||
if ((Label->d_magic != BSD_DISKMAGIC) ||
|
||||
if ((Label->d_magic != BSD_DISKMAGIC) ||
|
||||
(Label->d_magic2 != BSD_DISKMAGIC))
|
||||
goto Return_Cleanup;
|
||||
|
||||
@@ -2549,7 +2549,7 @@ for (context.dcshift = 0; context.dcshift < 8; context.dcshift++) {
|
||||
}
|
||||
|
||||
sim_messagef(SCPE_OK, "%s: '%s' Contains a RSTS File system\n", sim_uname (uptr), sim_relative_path (uptr->filename));
|
||||
sim_messagef(SCPE_OK, "%s: Pack ID: %6.6s Revision Level: %3s Pack Clustersize: %d\n",
|
||||
sim_messagef(SCPE_OK, "%s: Pack ID: %6.6s Revision Level: %3s Pack Clustersize: %d\n",
|
||||
sim_uname (uptr), context.packid, fmt, context.pcs);
|
||||
sim_messagef(SCPE_OK, "%s: Last Unallocated Sector In File System: %u\n", sim_uname (uptr), (uint32)((ret_val / 512) - 1));
|
||||
goto cleanup_done;
|
||||
@@ -2642,7 +2642,7 @@ if (strncmp((char *)&home->hb_b_sysid, HB_C_SYSID, strlen(HB_C_SYSID)) == 0) {
|
||||
|
||||
if (strncmp((char *)&home->hb_b_sysid, HB_C_VMSSYSID, strlen(HB_C_VMSSYSID)) == 0)
|
||||
return RT11_SINGLEPART;
|
||||
|
||||
|
||||
return RT11_NOPART;
|
||||
}
|
||||
|
||||
@@ -2675,7 +2675,7 @@ for (part = 0; part < RT11_MAXPARTITIONS; part++) {
|
||||
*/
|
||||
if ((part != 0) && (physsectsz != 0))
|
||||
break;
|
||||
|
||||
|
||||
base = part << 16;
|
||||
|
||||
if (_DEC_rdsect(uptr, (base + RT11_HOME) * (512 / ctx->sector_size), (uint8 *)&Home, §s_read, 512 / ctx->sector_size, physsectsz) ||
|
||||
@@ -2817,22 +2817,22 @@ for (i = 0; checks[i] != NULL; i++)
|
||||
if ((ret_val = checks[i] (uptr, 0, isreadonly)) != (t_offset)-1) {
|
||||
/* ISO files that haven't already been determined to be ISO 9660
|
||||
* which contain a known file system are also marked read-only
|
||||
* now. This fits early DEC distribution CDs that were created
|
||||
* now. This fits early DEC distribution CDs that were created
|
||||
* before ISO 9660 was standardized and operating support was added.
|
||||
*/
|
||||
if ((isreadonly != NULL) &&
|
||||
if ((isreadonly != NULL) &&
|
||||
(*isreadonly == FALSE) &&
|
||||
(NULL != match_ext (uptr->filename, "ISO")))
|
||||
*isreadonly = TRUE;
|
||||
return ret_val;
|
||||
}
|
||||
/*
|
||||
* The only known interleaved disk devices have either 256 byte
|
||||
* or 128 byte sector sizes. If additional interleaved file
|
||||
/*
|
||||
* The only known interleaved disk devices have either 256 byte
|
||||
* or 128 byte sector sizes. If additional interleaved file
|
||||
* system scenarios with different sector sizes come up they
|
||||
* should be added here.
|
||||
*/
|
||||
|
||||
|
||||
for (i = 0; checks[i] != NULL; i++) {
|
||||
ctx->sector_size = 256;
|
||||
if ((ret_val = checks[i] (uptr, ctx->sector_size, isreadonly)) != (t_offset)-1)
|
||||
@@ -2845,7 +2845,7 @@ if (ret_val != (t_offset)-1) {
|
||||
ctx->data_ileave = RX0xINTER;
|
||||
ctx->data_ileave_skew = RX0xISKEW;
|
||||
if (ctx->sector_size != saved_sector_size)
|
||||
sim_messagef (SCPE_OK, "%s: with an unexpected sector size of %u bytes instead of %u bytes\n",
|
||||
sim_messagef (SCPE_OK, "%s: with an unexpected sector size of %u bytes instead of %u bytes\n",
|
||||
sim_uname (uptr), ctx->sector_size, saved_sector_size);
|
||||
}
|
||||
ctx->sector_size = saved_sector_size;
|
||||
@@ -2945,8 +2945,8 @@ if (f) {
|
||||
if ((NtoHl (f->MediaID) == 0) ||
|
||||
((sim_disk_find_type (uptr, (char *)f->DriveType) != NULL) &&
|
||||
(NtoHl (f->Geometry) != sim_disk_drvtype_geometry (sim_disk_find_type (uptr, (char *)f->DriveType), NtoHl (f->SectorCount)))) ||
|
||||
((NtoHl (f->ElementEncodingSize) == 1) &&
|
||||
((0 == memcmp (f->DriveType, "RZ", 2)) ||
|
||||
((NtoHl (f->ElementEncodingSize) == 1) &&
|
||||
((0 == memcmp (f->DriveType, "RZ", 2)) ||
|
||||
(0 == memcmp (f->DriveType, "RR", 2))))) {
|
||||
f->ElementEncodingSize = NtoHl (2);
|
||||
if ((uptr->flags & UNIT_RO) == 0)
|
||||
@@ -2994,18 +2994,18 @@ if (f) {
|
||||
" AccessFormat: %u\n"
|
||||
" CreationTime: %s",
|
||||
sim_uname (uptr), uptr->filename,
|
||||
f->CreatingSimulator, f->DriveType, NtoHl(f->SectorSize), NtoHl (f->SectorCount),
|
||||
f->CreatingSimulator, f->DriveType, NtoHl(f->SectorSize), NtoHl (f->SectorCount),
|
||||
_disk_tranfer_encoding (NtoHl (f->ElementEncodingSize)), f->FooterVersion, f->AccessFormat, f->CreationTime);
|
||||
if (f->DeviceName[0] != '\0')
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
" DeviceName: %s\n", (char *)f->DeviceName);
|
||||
if (f->DataWidth != 0)
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
" DataWidth: %d bits\n", NtoHl(f->DataWidth));
|
||||
if (f->MediaID != 0)
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
" MediaID: 0x%08X (%s)\n", NtoHl(f->MediaID), sim_disk_decode_mediaid (NtoHl(f->MediaID)));
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
sim_debug_unit (ctx->dbit, uptr,
|
||||
" HighwaterSector: %u\n", (uint32)(ctx->highwater/ctx->sector_size));
|
||||
}
|
||||
}
|
||||
@@ -3096,7 +3096,7 @@ if (uptr->flags & UNIT_RO)
|
||||
return SCPE_RO;
|
||||
if (ctx == NULL)
|
||||
return SCPE_IERR;
|
||||
if ((uptr->drvtyp != NULL) &&
|
||||
if ((uptr->drvtyp != NULL) &&
|
||||
((uptr->drvtyp->flags & DRVFL_DETAUTO) != 0) &&
|
||||
((uptr->flags & DKUF_NOAUTOSIZE) == 0))
|
||||
store_disk_footer (uptr, uptr->drvtyp->name);
|
||||
@@ -3182,7 +3182,7 @@ if ((uptr->flags & DKUF_NOAUTOSIZE) != 0) { /* unit autosize disable
|
||||
else {
|
||||
if (drivetypes == NULL) { /* Drive type list unspecified? */
|
||||
int i;
|
||||
|
||||
|
||||
drvtypes = (DRVTYP *)dptr->type_ctx; /* Use device specific types (if any) */
|
||||
if (drvtypes != NULL) {
|
||||
for (i = 0; drvtypes[i].name; i++) {
|
||||
@@ -3299,7 +3299,7 @@ if (sim_switches & SWMASK ('C')) { /* create new disk conta
|
||||
errno = 0;
|
||||
sim_messagef (SCPE_OK, "%s: Copying %u sectors each %u bytes in size\n", sim_uname (uptr), (uint32)total_sectors, (uint32)sector_size);
|
||||
if (source_capac > target_capac) {
|
||||
sim_messagef (SCPE_OK, "%s: The source %s%scontainer is %u sectors larger than\n",
|
||||
sim_messagef (SCPE_OK, "%s: The source %s%scontainer is %u sectors larger than\n",
|
||||
sim_uname (uptr), source_drvtyp ? source_drvtyp->name : "", source_drvtyp ? " " : "", (t_lba)(((source_capac - target_capac)*capac_factor)/(sector_size/((dptr->flags & DEV_SECTORS) ? 512 : 1))));
|
||||
sim_messagef (SCPE_OK, "%s: the destination %s%sdisk container.\n",
|
||||
sim_uname (uptr), uptr->drvtyp ? uptr->drvtyp->name : "", uptr->drvtyp ? " " : "");
|
||||
@@ -3366,7 +3366,7 @@ if (sim_switches & SWMASK ('C')) { /* create new disk conta
|
||||
uptr->fileref = saved_unit_fileref;
|
||||
uptr->flags = saved_unit_flags;
|
||||
if (r == SCPE_OK) {
|
||||
if ((sects_read != verify_read) ||
|
||||
if ((sects_read != verify_read) ||
|
||||
(0 != memcmp (copy_buf, verify_buf, verify_read*sector_size)))
|
||||
r = SCPE_IOERR;
|
||||
}
|
||||
@@ -3505,7 +3505,7 @@ strlcpy (uptr->filename, cptr, CBUFSIZE); /* save name */
|
||||
ctx->sector_size = (uint32)sector_size; /* save sector_size */
|
||||
ctx->capac_factor = ((dptr->dwidth / dptr->aincr) >= 32) ? 8 : ((dptr->dwidth / dptr->aincr) == 16) ? 2 : 1; /* save capacity units (quadword: 8, word: 2, byte: 1) */
|
||||
ctx->xfer_encode_size = (uint32)xfer_encode_size; /* save xfer_encode_size */
|
||||
ctx->media_id = (uptr->drvtyp != NULL) ?
|
||||
ctx->media_id = (uptr->drvtyp != NULL) ?
|
||||
uptr->drvtyp->MediaId : 0; /* save initial device type media id */
|
||||
ctx->dptr = dptr; /* save DEVICE pointer */
|
||||
ctx->dbit = dbit; /* save debug bit */
|
||||
@@ -3627,7 +3627,7 @@ if ((DK_GET_FMT (uptr) == DKUF_F_VHD) || (ctx->footer)) {
|
||||
if ((container_sector_size != 0) && (sector_size != container_sector_size))
|
||||
r = sim_messagef (SCPE_OPENERR, "%s: Incompatible Container Sector Size %d\n", sim_uname (uptr), container_sector_size);
|
||||
else {
|
||||
if (dontchangecapac &&
|
||||
if (dontchangecapac &&
|
||||
((((t_lba)(ctx->container_size/sector_size) > current_unit_sectors)) ||
|
||||
((container_sectors != 0) && (container_sectors != current_unit_sectors)))) {
|
||||
r = sim_messagef (SCPE_OK, "%s: Container has %u sectors, drive has: %u sectors\n", sim_uname (uptr), container_sectors, current_unit_sectors);
|
||||
@@ -3694,7 +3694,7 @@ if ((created) && (!copied)) {
|
||||
t_lba lba;
|
||||
t_lba total_lbas = (t_lba)((((t_offset)uptr->capac)*ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1))/ctx->sector_size);
|
||||
|
||||
for (lba = 0; (r == SCPE_OK) && (lba < total_lbas); lba += 128) {
|
||||
for (lba = 0; (r == SCPE_OK) && (lba < total_lbas); lba += 128) {
|
||||
t_seccnt sectors = ((lba + 128) <= total_lbas) ? 128 : total_lbas - lba;
|
||||
|
||||
r = sim_disk_wrsect (uptr, lba, secbuf, NULL, sectors);
|
||||
@@ -3750,7 +3750,7 @@ if (sim_switches & SWMASK ('I')) { /* Initialize To Sector Addr
|
||||
free (init_buf);
|
||||
sim_disk_detach (uptr); /* report error now */
|
||||
(void)remove (cptr); /* remove the created file */
|
||||
return sim_messagef (SCPE_OPENERR, "Error initializing each sector with its address: %s\n",
|
||||
return sim_messagef (SCPE_OPENERR, "Error initializing each sector with its address: %s\n",
|
||||
(r == SCPE_OK) ? sim_error_text (r) : "sectors written not what was requested");
|
||||
}
|
||||
sim_messagef (SCPE_OK, "%s: Set To Sector Address %u/%u sectors. %d%% complete.\r", sim_uname (uptr), (uint32)(lba + sects_written), (uint32)total_sectors, (int)((((float)lba)*100)/total_sectors));
|
||||
@@ -3781,7 +3781,7 @@ if (sim_switches & SWMASK ('K')) {
|
||||
r = sim_disk_rdsect (uptr, lba, verify_buf, §s_verify, sects);
|
||||
if (r == SCPE_OK) {
|
||||
if (sects != sects_verify)
|
||||
sim_printf ("\n%s: Verification Error when reading lbn %d(0x%X) of %d(0x%X) Requested %u sectors, read %u sectors.\n",
|
||||
sim_printf ("\n%s: Verification Error when reading lbn %d(0x%X) of %d(0x%X) Requested %u sectors, read %u sectors.\n",
|
||||
sim_uname (uptr), (int)lba, (int)lba, (int)total_sectors, (int)total_sectors, sects, sects_verify);
|
||||
for (sect = 0; sect < sects_verify; sect++) {
|
||||
t_lba offset;
|
||||
@@ -3852,7 +3852,7 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
uptr->capac = (t_addr)(container_size/(ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? ctx->sector_size : 1)));
|
||||
capac1 = strdup (sprint_capac (dptr, uptr));
|
||||
uptr->capac = saved_capac;
|
||||
r = sim_messagef (r, "%s: The disk container '%s' is larger than simulated device (%s > %s)\n",
|
||||
r = sim_messagef (r, "%s: The disk container '%s' is larger than simulated device (%s > %s)\n",
|
||||
sim_uname (uptr), cptr, capac1, sprint_capac (dptr, uptr));
|
||||
free (capac1);
|
||||
sim_disk_detach (uptr);
|
||||
@@ -3865,7 +3865,7 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
/* Prefer capacity change over drive type change for the same drive type container */
|
||||
if ((!dontchangecapac) &&
|
||||
(((uptr->flags & UNIT_RO) != 0) ||
|
||||
((ctx->footer != NULL) &&
|
||||
((ctx->footer != NULL) &&
|
||||
((uptr->drvtyp == NULL) ||
|
||||
(strcasecmp (uptr->drvtyp->name, (char *)ctx->footer->DriveType) == 0))))) { /* autosize by changing capacity */
|
||||
if (filesystem_size != (t_offset)-1) { /* Known file system data size AND */
|
||||
@@ -3900,11 +3900,11 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
int32 saved_switches = sim_switches;
|
||||
uint32 saved_RO = (uptr->flags & UNIT_RO);
|
||||
|
||||
if ((drvtypes != NULL) &&
|
||||
if ((drvtypes != NULL) &&
|
||||
(DRVFL_GET_IFTYPE(drvtypes) == DRVFL_TYPE_SCSI) && (drvtypes->devtype == SCSI_TAPE))
|
||||
continue;
|
||||
uptr->flags &= ~UNIT_ATT; /* temporarily mark as un-attached */
|
||||
if ((size_settable_drive_type != NULL) &&
|
||||
if ((size_settable_drive_type != NULL) &&
|
||||
(strcasecmp (size_settable_drive_type->name, drive) == 0))
|
||||
snprintf (cmd, sizeof (cmd), "%s %s=%u", sim_uname (uptr), drive, (uint32)(filesystem_size / size_settable_drive_type->sectsize));
|
||||
else
|
||||
@@ -3935,7 +3935,7 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
autosized = TRUE;
|
||||
}
|
||||
/* After potentially changing the drive type, are we OK now? */
|
||||
if (dontchangecapac &&
|
||||
if (dontchangecapac &&
|
||||
(filesystem_size != (t_offset)-1) &&
|
||||
(filesystem_size > current_unit_size)) {
|
||||
t_stat r = ((uptr->flags & UNIT_RO) == 0) ? SCPE_FSSIZE : SCPE_OK;
|
||||
@@ -3944,7 +3944,7 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
uptr->capac = (t_addr)(filesystem_size/(ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? ctx->sector_size : 1)));
|
||||
capac1 = strdup (sprint_capac (dptr, uptr));
|
||||
uptr->capac = saved_capac;
|
||||
r = sim_messagef (r, "%s: The file system in the disk container %s is larger than simulated device (%s > %s)\n",
|
||||
r = sim_messagef (r, "%s: The file system in the disk container %s is larger than simulated device (%s > %s)\n",
|
||||
sim_uname (uptr), cptr, capac1, sprint_capac (dptr, uptr));
|
||||
free (capac1);
|
||||
if ((uptr->flags & UNIT_RO) == 0)
|
||||
@@ -3964,7 +3964,7 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
uptr->capac = (t_addr)(container_size/(ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? ctx->sector_size : 1)));
|
||||
capac1 = strdup (sprint_capac (dptr, uptr));
|
||||
uptr->capac = saved_capac;
|
||||
r = sim_messagef (r, "%s: non expandable %s%sdisk container '%s' is smaller than simulated device (%s < %s)\n",
|
||||
r = sim_messagef (r, "%s: non expandable %s%sdisk container '%s' is smaller than simulated device (%s < %s)\n",
|
||||
sim_uname (uptr), container_dtype, (*container_dtype != '\0') ? " " : "", cptr, capac1, sprint_capac (dptr, uptr));
|
||||
free (capac1);
|
||||
sim_disk_detach (uptr);
|
||||
@@ -3987,8 +3987,8 @@ if (container_size && (container_size != (t_offset)-1) &&
|
||||
container_dtype = ctx->footer ? (const char *)ctx->footer->DriveType : "";
|
||||
sim_switches = saved_switches;
|
||||
if (r == SCPE_OK)
|
||||
r = sim_messagef (SCPE_OK, "%s: %s%sdisk container '%s' is larger than simulated device (%s > %s) Read Only Forced\n",
|
||||
sim_uname (uptr), container_dtype, (*container_dtype != '\0') ? " " : "", cptr,
|
||||
r = sim_messagef (SCPE_OK, "%s: %s%sdisk container '%s' is larger than simulated device (%s > %s) Read Only Forced\n",
|
||||
sim_uname (uptr), container_dtype, (*container_dtype != '\0') ? " " : "", cptr,
|
||||
capac1, sprint_capac (dptr, uptr));
|
||||
free (capac1);
|
||||
return r;
|
||||
@@ -4013,8 +4013,8 @@ if ((uptr->flags & UNIT_RO) == 0) { /* Opened Read/Write? */
|
||||
sim_quiet = saved_quiet;
|
||||
}
|
||||
if (dtype && ((uptr->drvtyp == NULL) ? TRUE : ((uptr->drvtyp->flags & DRVFL_DETAUTO) == 0)) && ((uptr->flags & DKUF_NOAUTOSIZE) == 0) &&
|
||||
(created ||
|
||||
((ctx->footer == NULL) && (autosized || (current_unit_size == container_size))) ||
|
||||
(created ||
|
||||
((ctx->footer == NULL) && (autosized || (current_unit_size == container_size))) ||
|
||||
(!created && (ctx->container_size == 0) && (ctx->footer == NULL))))
|
||||
store_disk_footer (uptr, (uptr->drvtyp == NULL) ? dtype : uptr->drvtyp->name);
|
||||
|
||||
@@ -4028,9 +4028,9 @@ if (uptr->flags & UNIT_BUFABLE) { /* buffer in memory? */
|
||||
t_stat r = SCPE_OK;
|
||||
|
||||
if (uptr->flags & UNIT_MUSTBUF) { /* dyn alloc? */
|
||||
uptr->filebuf = calloc ((size_t)current_unit_size,
|
||||
uptr->filebuf = calloc ((size_t)current_unit_size,
|
||||
ctx->xfer_encode_size); /* allocate */
|
||||
uptr->filebuf2 = calloc ((size_t)current_unit_size,
|
||||
uptr->filebuf2 = calloc ((size_t)current_unit_size,
|
||||
ctx->xfer_encode_size); /* allocate copy */
|
||||
if ((uptr->filebuf == NULL) || /* either failed? */
|
||||
(uptr->filebuf2 == NULL)) {
|
||||
@@ -4097,7 +4097,7 @@ if ((uptr->flags & UNIT_BUF) && (uptr->filebuf)) {
|
||||
uint32 cap = (uptr->hwmark + uptr->dptr->aincr - 1) / uptr->dptr->aincr;
|
||||
t_offset current_unit_size = ((t_offset)uptr->capac)*ctx->capac_factor*((uptr->dptr->flags & DEV_SECTORS) ? ctx->sector_size : 1);
|
||||
|
||||
if (((uptr->flags & UNIT_RO) == 0) &&
|
||||
if (((uptr->flags & UNIT_RO) == 0) &&
|
||||
(memcmp (uptr->filebuf, uptr->filebuf2, (size_t)current_unit_size) != 0)) {
|
||||
sim_messagef (SCPE_OK, "%s: writing buffer to file: %s\n", sim_uname (uptr), uptr->filename);
|
||||
sim_disk_wrsect (uptr, 0, (uint8 *)uptr->filebuf, NULL, (cap + ctx->sector_size - 1) / ctx->sector_size);
|
||||
@@ -4397,9 +4397,9 @@ return SCPE_OK;
|
||||
/* Factory bad block table creation routine
|
||||
|
||||
This routine writes a DEC standard 144 compliant bad block table on the
|
||||
last track of the specified unit as described in:
|
||||
last track of the specified unit as described in:
|
||||
EL-00144_B_DEC_STD_144_Disk_Standard_for_Recording_and_Handling_Bad_Sectors_Nov76.pdf
|
||||
The bad block table consists of 10 repetitions of the same table,
|
||||
The bad block table consists of 10 repetitions of the same table,
|
||||
formatted as follows:
|
||||
|
||||
words 0-1 pack id number
|
||||
@@ -4678,9 +4678,9 @@ if (strchr (openmode, 'r'))
|
||||
DesiredAccess |= GENERIC_READ;
|
||||
if (strchr (openmode, 'w') || strchr (openmode, '+'))
|
||||
DesiredAccess |= GENERIC_WRITE;
|
||||
/* SCP Command Line parsing replaces \\ with \ presuming this is an
|
||||
escape sequence. This only affecdts RAW device names and UNC paths.
|
||||
We handle the RAW device name case here by prepending paths beginning
|
||||
/* SCP Command Line parsing replaces \\ with \ presuming this is an
|
||||
escape sequence. This only affects RAW device names and UNC paths.
|
||||
We handle the RAW device name case here by prepending paths beginning
|
||||
with \.\ with an extra \. */
|
||||
if ((!memcmp ("\\.\\", rawdevicename, 3)) ||
|
||||
(!memcmp ("/./", rawdevicename, 3))) {
|
||||
@@ -4692,7 +4692,7 @@ else
|
||||
Handle = CreateFileA (tmpname, DesiredAccess, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS|FILE_FLAG_WRITE_THROUGH, NULL);
|
||||
free (tmpname);
|
||||
if (Handle != INVALID_HANDLE_VALUE) {
|
||||
if ((sim_os_disk_info_raw ((FILE *)Handle, NULL, NULL, &is_cdrom)) ||
|
||||
if ((sim_os_disk_info_raw ((FILE *)Handle, NULL, NULL, &is_cdrom)) ||
|
||||
((DesiredAccess & GENERIC_WRITE) && is_cdrom)) {
|
||||
CloseHandle (Handle);
|
||||
errno = EACCES;
|
||||
@@ -6182,7 +6182,7 @@ static FILE *sim_vhd_disk_open (const char *szVHDPath, const char *DesiredAccess
|
||||
0);
|
||||
if (Status)
|
||||
goto Cleanup_Return;
|
||||
if ((0 != memcmp (hVHD->Dynamic.ParentUniqueID, ParentFooter.UniqueID, sizeof (ParentFooter.UniqueID))) ||
|
||||
if ((0 != memcmp (hVHD->Dynamic.ParentUniqueID, ParentFooter.UniqueID, sizeof (ParentFooter.UniqueID))) ||
|
||||
(ParentModifiedTimeStamp != hVHD->Dynamic.ParentTimeStamp)) {
|
||||
if (sim_switches & SWMASK ('O')) { /* OVERRIDE consistency checks? */
|
||||
if ((sim_switches & SWMASK ('U')) && /* FIX (UPDATE) consistency checks AND */
|
||||
@@ -6964,7 +6964,7 @@ if (NtoHl (hVHD->Footer.DiskType) == VHD_DT_Fixed) {
|
||||
}
|
||||
/* We are now dealing with a Dynamically expanding or differencing disk */
|
||||
DynamicBlockSize = NtoHl (hVHD->Dynamic.BlockSize);
|
||||
if ((DynamicBlockSize == 0) ||
|
||||
if ((DynamicBlockSize == 0) ||
|
||||
((DynamicBlockSize & (DynamicBlockSize - 1)) != 0)) {
|
||||
errno = ERANGE;
|
||||
return SCPE_IOERR;
|
||||
@@ -7095,7 +7095,7 @@ if (NtoHl(hVHD->Footer.DiskType) == VHD_DT_Fixed) {
|
||||
}
|
||||
/* We are now dealing with a Dynamically expanding or differencing disk */
|
||||
DynamicBlockSize = NtoHl (hVHD->Dynamic.BlockSize);
|
||||
if ((DynamicBlockSize == 0) ||
|
||||
if ((DynamicBlockSize == 0) ||
|
||||
((DynamicBlockSize & (DynamicBlockSize - 1)) != 0)) {
|
||||
errno = ERANGE;
|
||||
return SCPE_IOERR;
|
||||
@@ -7184,9 +7184,9 @@ while (BytesToWrite && (r == SCPE_OK)) {
|
||||
goto Fatal_IO_Error;
|
||||
/* Since a large VHD can have a pretty large BAT, and we've only changed one longword bat entry
|
||||
in the current BAT, we write just the aligned sector which contains the updated BAT entry */
|
||||
BATUpdateBufferAddress = (uint8 *)hVHD->BAT - (size_t)NtoHll(hVHD->Dynamic.TableOffset) +
|
||||
BATUpdateBufferAddress = (uint8 *)hVHD->BAT - (size_t)NtoHll(hVHD->Dynamic.TableOffset) +
|
||||
(size_t)((((size_t)&hVHD->BAT[BlockNumber]) - (size_t)hVHD->BAT + (size_t)NtoHll(hVHD->Dynamic.TableOffset)) & ~(VHD_DATA_BLOCK_ALIGNMENT-1));
|
||||
/* If the starting of the BAT isn't on a VHD_DATA_BLOCK_ALIGNMENT boundary and we've just updated
|
||||
/* If the starting of the BAT isn't on a VHD_DATA_BLOCK_ALIGNMENT boundary and we've just updated
|
||||
a BAT entry early in the array, the buffer computed address might be before the start of the
|
||||
BAT table. If so, only write the BAT data needed */
|
||||
if (BATUpdateBufferAddress < (uint8 *)hVHD->BAT) {
|
||||
@@ -7356,7 +7356,7 @@ if ((sim_scp_dev.dctrl & SIM_DBG_INIT) && sim_deb) {
|
||||
else
|
||||
strlcpy (help, "NULL", sizeof (help));
|
||||
}
|
||||
sim_debug (SIM_DBG_INIT, &sim_scp_dev, "{%s, 0x%X, %s, %s,\n", mask, mptr->match,
|
||||
sim_debug (SIM_DBG_INIT, &sim_scp_dev, "{%s, 0x%X, %s, %s,\n", mask, mptr->match,
|
||||
pstring, mstring);
|
||||
sim_debug (SIM_DBG_INIT, &sim_scp_dev, " %s, %s,\n",
|
||||
mptr->valid ? "Validator-Routine" : "NULL", mptr->disp ? "Display-Routine" : "NULL");
|
||||
@@ -7375,18 +7375,18 @@ sim_debug (SIM_DBG_INIT, &sim_scp_dev, "sim_disk_init()\n");
|
||||
for (i = 0; NULL != (dptr = sim_devices[i]); i++) {
|
||||
DRVTYP *drive;
|
||||
static MTAB autos[] = {
|
||||
{ MTAB_XTD|MTAB_VUN, 1, NULL, "AUTOSIZE",
|
||||
{ MTAB_XTD|MTAB_VUN, 1, NULL, "AUTOSIZE",
|
||||
&sim_disk_set_autosize, NULL, NULL, "Enable disk autosize on attach" },
|
||||
{ MTAB_XTD|MTAB_VUN, 0, NULL, "NOAUTOSIZE",
|
||||
{ MTAB_XTD|MTAB_VUN, 0, NULL, "NOAUTOSIZE",
|
||||
&sim_disk_set_autosize, NULL, NULL, "Disable disk autosize on attach" },
|
||||
{ MTAB_XTD|MTAB_VUN, 0, "AUTOSIZE", NULL,
|
||||
{ MTAB_XTD|MTAB_VUN, 0, "AUTOSIZE", NULL,
|
||||
NULL, &sim_disk_show_autosize, NULL, "Display disk autosize on attach setting" }};
|
||||
static MTAB autoz[] = {
|
||||
{ MTAB_XTD|MTAB_VUN, 1, NULL, "AUTOZAP",
|
||||
{ MTAB_XTD|MTAB_VUN, 1, NULL, "AUTOZAP",
|
||||
&sim_disk_set_autozap, NULL, NULL, "Enable disk metadata removal on detach" },
|
||||
{ MTAB_XTD|MTAB_VUN, 0, NULL, "NOAUTOZAP",
|
||||
{ MTAB_XTD|MTAB_VUN, 0, NULL, "NOAUTOZAP",
|
||||
&sim_disk_set_autozap, NULL, NULL, "Disable disk metadata removal on detach" },
|
||||
{ MTAB_XTD|MTAB_VUN, 0, "AUTOZAP", NULL,
|
||||
{ MTAB_XTD|MTAB_VUN, 0, "AUTOZAP", NULL,
|
||||
NULL, &sim_disk_show_autozap, NULL, "Display disk autozap on detach setting" }};
|
||||
MTAB *mtab = dptr->modifiers;
|
||||
MTAB *nmtab = NULL;
|
||||
@@ -7417,7 +7417,7 @@ for (i = 0; NULL != (dptr = sim_devices[i]); i++) {
|
||||
(drive[drives].devtype != SCSI_TAPE)) &&
|
||||
((drive[drives].flags & DRVFL_QICTAPE) == 0) &&
|
||||
(drive[drives].size > (drive[drives].sect * drive[drives].surf * drive[drives].cyl))) {
|
||||
stat = sim_messagef (SCPE_IERR, "Device %s drive type %s has unreasonable geometry values:\n",
|
||||
stat = sim_messagef (SCPE_IERR, "Device %s drive type %s has unreasonable geometry values:\n",
|
||||
dptr->name, drive[drives].name);
|
||||
stat = sim_messagef (SCPE_IERR, "Total Sectors: %u > (%u Cyls * %u Heads * %u sectors)\n",
|
||||
drive[drives].size, drive[drives].cyl, drive[drives].surf, drive[drives].sect);
|
||||
@@ -7428,10 +7428,10 @@ for (i = 0; NULL != (dptr = sim_devices[i]); i++) {
|
||||
/* find device type modifier entries */
|
||||
for (j = 0; mtab[j].mask != 0; j++) {
|
||||
++modifiers;
|
||||
if (((mtab[j].pstring != NULL) &&
|
||||
if (((mtab[j].pstring != NULL) &&
|
||||
((strcasecmp (mtab[j].pstring, "AUTOSIZE") == 0) ||
|
||||
(strcasecmp (mtab[j].pstring, "NOAUTOSIZE") == 0))) ||
|
||||
((mtab[j].mstring != NULL) &&
|
||||
((mtab[j].mstring != NULL) &&
|
||||
((strcasecmp (mtab[j].mstring, "AUTOSIZE") == 0) ||
|
||||
(strcasecmp (mtab[j].mstring, "NOAUTOSIZE") == 0)))) {
|
||||
if ((mtab[j].mask & (MTAB_XTD|MTAB_VUN)) == 0)
|
||||
@@ -7445,42 +7445,42 @@ for (i = 0; NULL != (dptr = sim_devices[i]); i++) {
|
||||
(mtab[j].mask == (MTAB_XTD|MTAB_VUN)))
|
||||
show_type_entry = j;
|
||||
for (k = 0; drive[k].name != NULL; k++) {
|
||||
if ((mtab[j].mstring == NULL) ||
|
||||
if ((mtab[j].mstring == NULL) ||
|
||||
(strncasecmp (mtab[j].mstring, drive[k].name, strlen (drive[k].name))))
|
||||
continue;
|
||||
validator = mtab[j].valid;
|
||||
break;
|
||||
}
|
||||
if ((k == drives) &&
|
||||
((mtab[j].mask != (MTAB_XTD|MTAB_VUN)) ||
|
||||
(mtab[j].pstring == NULL) ||
|
||||
((mtab[j].mask != (MTAB_XTD|MTAB_VUN)) ||
|
||||
(mtab[j].pstring == NULL) ||
|
||||
(strcasecmp (mtab[j].pstring, "TYPE") != 0)))
|
||||
continue;
|
||||
++setters;
|
||||
}
|
||||
sim_debug (SIM_DBG_INIT, &sim_scp_dev, "%d Smart Autosizers, %d Modifiers, %d Setters, %d Dumb Autosizers\n",
|
||||
sim_debug (SIM_DBG_INIT, &sim_scp_dev, "%d Smart Autosizers, %d Modifiers, %d Setters, %d Dumb Autosizers\n",
|
||||
smart_autosizers, modifiers, setters, dumb_autosizers);
|
||||
nmtab = (MTAB *)calloc (2 + ((smart_autosizers == 0) * (sizeof (autos)/sizeof (autos[0]))) + (1 + (sizeof (autos)/sizeof (autos[0]))) * (drives + aliases + (modifiers - (setters + dumb_autosizers))), sizeof (MTAB));
|
||||
l = 0;
|
||||
for (j = 0; mtab[j].mask != 0; j++) {
|
||||
if ((((mtab[j].pstring != NULL) &&
|
||||
if ((((mtab[j].pstring != NULL) &&
|
||||
((strcasecmp (mtab[j].pstring, "AUTOSIZE") == 0) ||
|
||||
(strcasecmp (mtab[j].pstring, "NOAUTOSIZE") == 0))) ||
|
||||
((mtab[j].mstring != NULL) &&
|
||||
((mtab[j].mstring != NULL) &&
|
||||
((strcasecmp (mtab[j].mstring, "AUTOSIZE") == 0) ||
|
||||
(strcasecmp (mtab[j].mstring, "NOAUTOSIZE") == 0)))) &&
|
||||
((mtab[j].mask & (MTAB_XTD|MTAB_VUN)) == 0))
|
||||
continue; /* skip dumb autosizers */
|
||||
for (k = 0; drive[k].name != NULL; k++) {
|
||||
if ((mtab[j].mstring == NULL) ||
|
||||
if ((mtab[j].mstring == NULL) ||
|
||||
(strncasecmp (mtab[j].mstring, drive[k].name, strlen (drive[k].name))))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if ((k == drives) &&
|
||||
((validator == NULL) || (validator != mtab[j].valid)) &&
|
||||
((mtab[j].mask != (MTAB_XTD|MTAB_VUN)) ||
|
||||
(mtab[j].pstring == NULL) ||
|
||||
((validator == NULL) || (validator != mtab[j].valid)) &&
|
||||
((mtab[j].mask != (MTAB_XTD|MTAB_VUN)) ||
|
||||
(mtab[j].pstring == NULL) ||
|
||||
(strcasecmp (mtab[j].pstring, "TYPE") != 0))) {
|
||||
deb_MTAB (&mtab[j]);
|
||||
nmtab[l++] = mtab[j];
|
||||
@@ -7631,7 +7631,7 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */
|
||||
return TRUE; /* can't stat assume attached */
|
||||
}
|
||||
free (fullpath);
|
||||
if ((statb.st_dev != filestat.st_dev) ||
|
||||
if ((statb.st_dev != filestat.st_dev) ||
|
||||
(statb.st_ino != filestat.st_ino) ||
|
||||
(statb.st_mode != filestat.st_mode) ||
|
||||
(statb.st_nlink != filestat.st_nlink) ||
|
||||
@@ -7652,7 +7652,7 @@ free (fullname);
|
||||
return FALSE; /* Not attached */
|
||||
}
|
||||
|
||||
static void sim_disk_info_entry (const char *directory,
|
||||
static void sim_disk_info_entry (const char *directory,
|
||||
const char *filename,
|
||||
t_offset FileSize,
|
||||
const struct stat *filestat,
|
||||
@@ -7693,7 +7693,7 @@ if (info->flag) { /* zap disk type */
|
||||
if ((container_size != (t_offset)-1) && (container_size > (t_offset)sizeof (*f)) &&
|
||||
(sim_fseeko (container, container_size - sizeof (*f), SEEK_SET) == 0) &&
|
||||
(sizeof (*f) == sim_fread (f, 1, sizeof (*f), container))) {
|
||||
if ((memcmp (f->Signature, "simh", 4) == 0) &&
|
||||
if ((memcmp (f->Signature, "simh", 4) == 0) &&
|
||||
(f->Checksum == NtoHl (eth_crc32 (0, f, sizeof (*f) - sizeof (f->Checksum))))) {
|
||||
uint8 *sector_data;
|
||||
uint8 *zero_sector;
|
||||
@@ -7701,7 +7701,7 @@ if (info->flag) { /* zap disk type */
|
||||
size_t sector_size = NtoHl (f->SectorSize);
|
||||
t_offset highwater = (((t_offset)NtoHl (f->Highwater[0])) << 32) | ((t_offset)NtoHl (f->Highwater[1]));
|
||||
|
||||
if (sector_size > 16384) /* arbitray upper limit */
|
||||
if (sector_size > 16384) /* arbitrary upper limit */
|
||||
sector_size = 16384;
|
||||
/* determine whole sectors in original container size */
|
||||
/* By default we chop off the disk footer and trailing */
|
||||
@@ -7810,13 +7810,13 @@ if (info->flag == 0) { /* DISKINFO */
|
||||
"%s AccessFormat: %s%s\n"
|
||||
"%s CreationTime: %s",
|
||||
indent, sim_relative_path (uptr->filename),
|
||||
indent, f->CreatingSimulator,
|
||||
indent, f->DriveType,
|
||||
indent, NtoHl(f->SectorSize),
|
||||
indent, NtoHl (f->SectorCount),
|
||||
indent, _disk_tranfer_encoding (NtoHl (f->ElementEncodingSize)),
|
||||
indent, fmts[f->AccessFormat].name,
|
||||
((parent_path_function == NULL) || (*parent_path_function (container) == '\0')) ? "" : " - Differencing Disk",
|
||||
indent, f->CreatingSimulator,
|
||||
indent, f->DriveType,
|
||||
indent, NtoHl(f->SectorSize),
|
||||
indent, NtoHl (f->SectorCount),
|
||||
indent, _disk_tranfer_encoding (NtoHl (f->ElementEncodingSize)),
|
||||
indent, fmts[f->AccessFormat].name,
|
||||
((parent_path_function == NULL) || (*parent_path_function (container) == '\0')) ? "" : " - Differencing Disk",
|
||||
indent, f->CreationTime);
|
||||
if (ctime (&filestat->st_mtime))
|
||||
sim_printf ("%s ModifyTime: %s", indent, ctime (&filestat->st_mtime));
|
||||
@@ -7894,7 +7894,7 @@ MediaId
|
||||
Is defined in the MSCP Basic Disk Functions Manual, page 4-37 to 4-38:
|
||||
|
||||
The media type identifier is a 32-bit number, and it's coded like this:
|
||||
The high 25 bits are 5 characters, each coded with 5 bits. The low 7
|
||||
The high 25 bits are 5 characters, each coded with 5 bits. The low 7
|
||||
bits is a binary coded 2 digits.
|
||||
|
||||
Looking at it, you have:
|
||||
@@ -7902,12 +7902,12 @@ D0,D1,A0,A1,A2,N
|
||||
|
||||
For an RA81, it would be:
|
||||
|
||||
D0,D1 is the preferred device type name for the unit. In our case,
|
||||
D0,D1 is the preferred device type name for the unit. In our case,
|
||||
that would be "DU".
|
||||
A0,A1,A2 is the name of the media used on the unit. In our case "RA".
|
||||
N is the value of the two decimal digits, so 81 for this example.
|
||||
|
||||
And for letters, the coding is that A=1, B=2 and so on. 0 means the
|
||||
And for letters, the coding is that A=1, B=2 and so on. 0 means the
|
||||
character is not used.
|
||||
|
||||
So, again, for an RA81, we would get:
|
||||
@@ -8027,7 +8027,7 @@ if ((uptr->drvtyp != NULL) &&
|
||||
(uptr->drvtyp->devtype != drives[val].devtype)) {
|
||||
sim_tape_set_fmt (uptr, 0, "SIMH", NULL);
|
||||
sim_disk_set_fmt (uptr, 0, "AUTO", NULL);
|
||||
sim_tape_set_chunk_mode (uptr, ((drives[val].devtype == SCSI_TAPE) &&
|
||||
sim_tape_set_chunk_mode (uptr, ((drives[val].devtype == SCSI_TAPE) &&
|
||||
(drives[val].flags & DRVFL_QICTAPE)) ? drives[val].sectsize : 0);
|
||||
}
|
||||
uptr->drvtyp = &drives[val];
|
||||
@@ -8102,7 +8102,7 @@ static char typestr[80];
|
||||
|
||||
if (uptr->drvtyp) {
|
||||
if ((uptr->drvtyp->flags & DRVFL_SETSIZE) != 0) {
|
||||
uint32 totsectors = (uint32)(((uptr->dptr->flags & DEV_SECTORS) == 0)
|
||||
uint32 totsectors = (uint32)(((uptr->dptr->flags & DEV_SECTORS) == 0)
|
||||
? (uptr->capac / uptr->drvtyp->sectsize)
|
||||
: uptr->capac);
|
||||
snprintf (typestr, sizeof (typestr), "-L %s=%u", uptr->drvtyp->name, totsectors);
|
||||
@@ -8256,7 +8256,7 @@ if (!(uptr->flags & UNIT_RO)) { /* Only test drives open Read/Write - Read Only
|
||||
|
||||
for (i = 0; i < uint32s_per_sector; i++)
|
||||
if (c->data[i + sector_to_check * uint32s_per_sector] != (lba + sector_to_check)) {
|
||||
sim_printf ("Sector %u(0x%X) has unexpected data at offset 0x%X: 0x%08X\n",
|
||||
sim_printf ("Sector %u(0x%X) has unexpected data at offset 0x%X: 0x%08X\n",
|
||||
lba + sector_to_check, lba + sector_to_check, i, c->data[i + sector_to_check * uint32s_per_sector]);
|
||||
unexpected_data = TRUE;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user