Commit graph

212 commits

Author SHA1 Message Date
Peter Schorn
0f6bcb9682 SIMH: Fix spelling errors in comments and strings 2024-07-11 12:29:53 +02:00
Tony Lawrence
b23cde9c5d DISK: Do not allow to emit any "footers"
This is the initial iteration of cleaning up simh of appending the
"footers" to disk images:  it does not allow to emit any new "footers",
yet it does not change the behavior as to how any existing "footers"
are treated internally.  Also, even though sim_disk.c currently builds
the "footer" for any attached disk container, with this patch, it is
only kept in-memory, and never gets written to (appended / updated)
the actual container.
2023-10-24 16:26:26 -04:00
Robert de Bath
d4f85d01bd DISK: Fix VHD to Ensure that the CHS capacity exceeds the disk length
If the total sectors exceeds 127Gb this is not possible, but normal
simh disks are smaller and the largest user settable size via RAUSER
is just under 1Tb.  The excessive size case (>127Gb) will have a CHS
of 0xFFFF10FF.

simh never cares about the CHS Disk Geometry value in the VHD footer
data structure, but other applications which do care about the CHS
value using the previously incorrect value as the capacity of the disk
even though the Current Size indicated in the footer may have been
larger.
2023-09-03 18:39:17 -10:00
Olaf Seibert
86ffe4bec2 sim_disk.c: only free filebuf if it was allocated here too.
PDP11/pdp11_rq.c re-uses ->filebuf as a sector buffer (under the #defined
name rqxb) and allocates it as such. If an RQ disk is detached and
another attached, this buffer would be lost and the pointer reset to
NULL. sim_disk.c would only allocate the buffer if UNIT_BUFABLE is set,
which means to buffer the whole disk. Since this rightly isn't set on RQ
disks, the pointer would remain NULL and segfaults would ensue.  See
open-simh issue 274.
add comment about safe re-use of filebuf
2023-07-16 16:38:19 -04:00
Paul Koning
068b0f37b4 DISK: rename CreateVirtualDisk
This fixes issue #52, name conflict when building in MinGW.
2022-11-29 12:04:56 -05:00
Mark Pizzolato
b8015349e2 DISK: Add progress indications for ZAP -Z 2022-04-01 12:37:11 -07:00
Mark Pizzolato
6cac5c9eae DISK: Force Read Only for all ISO container attach operations
ISO files and real CDs exist which don't have ISO 9660 file structure.
These do contain ODS2 file systems since they were produced before
ISO 9660 was standardized and certainly before OS support for ISO
9660 was added.  As such, any file named .iso or .ISO will always be
attached read-only since CDs are never naturally writable devices.
2022-03-25 16:25:28 -07:00
Paul Koning
44bdb8a9d6 DISK: Fix off by one error in reporting RSTS file structure info
Updates the previous commit to do it better, by not changing
the return value of get_rsts_filesystem_size -- it still returns
the size, at least our best guess of it (for RSTS it's not possible
to get it correct in every case, but it will be correct for
most scenarios).
2022-03-21 17:08:36 -04:00
Paul Koning
efb83fa831 DISK: Fix off by one error in reporting RSTS file structure info
This fixes issue #1106 -- the last sector number reported was
off by one (sector past the last free sector).
2022-03-21 13:43:30 -04:00
Mark Pizzolato
e0700d3b7c DISK: Add support for ISO 9660 file system detection
Any attach of an ISO 9660 file system is done Read Only since that
file system is logically non-writable.

Related to #1094
2022-03-19 17:18:54 -07:00
Mark Pizzolato
aa637f58c0 DISK: Properly support attach time disk copy to a larger container 2022-03-17 07:28:11 -07:00
Mark Pizzolato
6ad8a528d7 DISK: Fix a few Coverity issues 2022-03-10 16:44:57 -08:00
Mark Pizzolato
06c696385f SCP: Coverity inspired changes 2022-03-06 02:11:57 -08:00
Mark Pizzolato
eac0e5680b DISK: Add SET NOAUTOSIZE - disable autosize when attaching existing containers
This is a global command possibly for folks who have configurations which
always explicitly specify the drive type they want a particular unit to be
before they attach a container to the unit.  The side effect of this will
be to avoid the addition of drive type describing meta data to disk
containers.
2022-02-14 15:06:34 -08:00
Mark Pizzolato
3949f62e89 SCP: Use sim_messagef for all error paths in attach_unit and sim_disk_attach 2022-02-14 04:00:04 -08:00
Mark Pizzolato
b557eaf6e2 DISK: Add support for attach/detach of memory buffered drives (UNIT_MUSTBUF) 2022-02-13 22:51:48 -08:00
Mark Pizzolato
e6c4b01f2e DISK: Provide coherent messages when container encountering incompatibility 2022-02-11 02:06:45 -08:00
Mark Pizzolato
92b1efe50f DISK: Clarify minor changes to sim_disk API in the documentation 2022-02-10 07:10:08 -08:00
Mark Pizzolato
a94a9ac28f DISK: Allow for attach time copies of dissimilar sized disk containers 2022-02-09 08:33:38 -08:00
Mark Pizzolato
b8903f303f DISK: Add highwater support to the container meta data
The highwater support records the furthest logical sector in a disk
container that has been written by the simulator when accessing
the device.
2022-02-08 19:07:00 -08:00
Mark Pizzolato
5015d6ae14 DISK: Cleanup attach behaviors add better support for containers with 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
2022-02-07 22:55:23 -08:00
Mark Pizzolato
a4054f33b8 SCP: Add command argument passed into library unit test routines 2022-02-07 04:21:16 -08:00
Mark Pizzolato
39f2ab96cc DISK: Add logic to avoid zapping an attach container file
- ZAP with -Z switch now trims all zero sectors, where the default is
   to trim zero sectors added beyond the container file size when the
   meta data was added.
- Remove file system wording from the skipping autosizing message.
2022-01-22 10:13:29 -08:00
Mark Pizzolato
99c5f2a763 DISK: Record original container file size in footer restore size during removal 2022-01-20 17:24:45 -08:00
Mark Pizzolato
121b0323a6 DISK: Disallow attach of unrecognized disk container > size of the current unit
Containers without recognized file systems already won't autosize, but now
you can't attach a container which is larger than the current drive type
presuming there is useful data beyond the size of the current drive type.
2021-12-15 16:54:04 -08:00
Mark Pizzolato
c5cd38afbf SCP, makefile: Rename build conditional HAVE_DLOPEN to SIM_HAVE_DLOPEN
Some dependent packages on some platforms may also define HAVE_DLOPEN
and that definition may have different syntax or semantics.  This change
avoids the potential symbol conflict.

As reported in #1098
2021-12-04 17:44:57 -08:00
Mark Pizzolato
b4fa00cebf DISK: Properly allow/disallow containers of reasonable/unreasonavle sizes
As reported in #1065
2021-10-31 04:32:54 -07:00
Mark Pizzolato
e6611c61b3 DISK: Preserve container dates when adding or removing container meta data 2021-10-31 04:24:25 -07:00
Mark Pizzolato
feec1da242 DISK, TAPE: Add optional library specific DEVICE context structure
- add disk and tape library initialization routines
- cleanup snprintf arguments
- truncate disk container trailing zero sectors when zapping
2021-09-20 12:28:11 -07:00
Mark Pizzolato
64b1223468 DISK: Add sim_disk_erase API 2021-08-17 15:35:51 -07:00
Mark Pizzolato
f95b20e1f3 SCP: Cleanup potential compiler warnings 2021-08-13 09:09:53 -07:00
Mark Pizzolato
502ebeafc3 DISK: Clarify comments for logic generating attach error messages
as discussed in #1064
2021-08-13 02:35:29 -07:00
Mark Pizzolato
fdd871da65 DISK: Clean up attach time error messages
- Fix 'non expandable' error message to avoid potential extra space as
   mentioned in #1065
- Reasonably report open errors as mentioned in #1064
2021-08-07 19:15:33 -07:00
Mark Pizzolato
a779de82aa DISK: Enrich ATTACH time error message to include C runtime error text
Standardize format and wording of error reporting messages

As discussed in #1064
2021-08-07 12:56:20 -07:00
Mark Pizzolato
a5b7ebe44b DISK: Assure that all reads past EOF read as 0 data, even partial sector reads 2021-01-27 12:47:36 -08:00
John Forecast
18d6247cb7 DISK: Add file system detection on interleaved device file system images
- DEC filesystems on RX01 and RX02 devices interleave data
- Add additional RT11 file system detection for images created by exchange
  on VMS.
2021-01-23 21:02:52 -08:00
Mark Pizzolato
8c42a3436c VAXen with SCSI: Allow some cross controller read only drive access 2020-12-29 11:14:34 -08:00
Mark Pizzolato
52fbdcd1f0 DISK: Fix Compiler warning 2020-10-13 05:23:02 -07:00
Mark Pizzolato
187ee83f07 DISK: Use memset and strlcpy rather than strncpy for fixed size strings 2020-10-11 15:33:23 -07:00
Mark Pizzolato
31606161ce SCP: Avoid potential compiler warnings
Essentially all are non-functional problems but silencing them is a good idea
2020-10-09 05:09:41 -07:00
Mark Pizzolato
c3f28e33e9 DISK: Extend DISKINFO command to work on wildcard file specifications 2020-08-11 07:29:10 -07:00
Peter Coghlan
2f79d796cf DISK: Initialize return values to 0 for unimplemented OS and VHD functions 2020-06-10 07:46:26 -07:00
Mark Pizzolato
5bec9d58dd DISK: Avoid trying to change drive type when it is already correct. 2020-05-02 13:34:26 -07:00
Mark Pizzolato
0b3e415b8e DISK: Cleanup compiler warnings 2020-04-30 02:59:30 -07:00
Mark Pizzolato
7082e212ea DISK: Avoid autosizing if file system can't be determined
Add DISKINFO command to display information about a disk container file.
2020-04-29 13:21:12 -07:00
Mark Pizzolato
aa380517fa DISK: Add support for arbitrary sector sizes in all container formats 2020-04-29 12:21:08 -07:00
Mark Pizzolato
580b388917 DISK: Add ATTACH copy option to create a SIMH or VHD copy
- Fail ATTACH when container type doesn't match drive type and autosizing
  is disabled.
- Be sure to write data at the end of a VHD container right up to the end of
  the disk.
2020-04-22 08:55:36 -07:00
Mark Pizzolato
d225629b9a DISK: Always open VHD containers as VHD without regard to the selected format 2020-04-20 21:22:12 -07:00
Mark Pizzolato
e872682d3c DISK: Major rework to support VHD's with other than 512 byte sectors
- Added rigorous disk test routine to exercise all supported disk container
  formats with various sector sizes and storage element sizes
- Extended logic to validate disk container simulated device consistency
  with the simulator and/or controller accessing it.
2020-04-17 17:34:28 -07:00
Mark Pizzolato
07682806a5 DISK: Fix size detection and validation for VHD disks 2020-04-13 10:05:46 -07:00