Commit graph

211 commits

Author SHA1 Message Date
Mark Pizzolato
9f929ae312 DISK: Fix Coverity identified problems
Replace memcpy with memmove for overlapping buffer moves.
VHD differencing disk parent filename fix
fix sizing of SIMH format disk drives
Fix memory leak after initializing a disk with a pattern
Fix bad 144 block initialization for RB and CS devices
2017-03-10 15:59:37 -08:00
Mark Pizzolato
760ce434f6 DISK: Add 256 byte sector support to Ultrix file system detection logic 2017-02-08 11:08:46 -08:00
Mark Pizzolato
5a0970fefb DISK: Support file system type/size checking for disks without 512 byte sectors 2017-02-07 16:28:01 -08:00
Mark Pizzolato
76dda8a01e PDP11, VAX: Fix SET RPn BADBLOCK behavior and auto sizing.
BAD144 info was written correctly if the user answered Y when the disk
image was created, but would not work if SET RPn BADBLOCK was
entered later.

Auto sizing would be potentially wrong if a disk had been created
without writing the BAD144 data.  Now, if the disk contains a file system
that information along with the physical container's size is used to
properly auto size the disk.
2017-02-07 13:02:21 -08:00
Mark Pizzolato
7050a1aef5 DISK: Added disk auto size detection for DEC ODS1 structured disks 2017-02-06 00:04:53 -08:00
Mark Pizzolato
f006aaa398 DISK: Added Ultrix disk partition detection to auto size RQ or RP disks.
Thanks to Henry Bent for info that made this possible.
2017-02-04 19:56:54 -08:00
Mark Pizzolato
0461008991 DISK: Always autosize disk to exactly the size of known file system data
Previously, disk capacity was increased if the drive was smaller than the
contained file system(s).  Now the drive capacity will be increased or
decreased to reflect the contained file system(s) size.
2017-01-08 15:28:17 -08:00
Mark Pizzolato
7c2d20f26f SCP: Make sim_cancel more efficient by stopping search as soon as canceled 2016-12-24 09:49:32 -08:00
Mark Pizzolato
9a69fa8b49 DISK: Remove $ from all variable names for clean compiles on all gcc versions 2016-12-02 15:05:53 -08:00
Mark Pizzolato
b98ece819b DISK: Extended and corrected autosize logic for disk attach.
Previously only the actual size of the container file was used when
attaching a disk.  This was correct only when the size of the container
file actually aligned with the simulated disk drive.  disks created with
sim_disk_attach automatically write to the last sector of a simulated
disk file when the disk is created.  Therefore, auto sizing worked correctly
for any disk created with sim_disk_attach.

Disk images created with simh prior to 4.X would only write to the
portions of the disk drive when the simulated system writes data.  These
disk images would only be properly sized if the simulated operation of
the disk had actually written to the last block of the disk.  Auto sizing of
these disks would usually size the resulting disk incorrectly and strange
behaviors might occur when using such an incorrectly auto sized disk.

Fixes #357
2016-11-29 18:53:52 -08:00
Mark Pizzolato
165c37acee DISK: Add -U attach option, to fix VHD differencing inconsistencies
-O allows overriding for testing purposes.
-U allows overridden checks to update and fix the inconsistencies

As discussed in #352
2016-11-28 03:35:01 -08:00
Mark Pizzolato
df3fbc3fb4 DISK: Fix -O option for differencing disks 2016-11-26 15:41:10 -08:00
Mark Pizzolato
3511b5e4e3 DISK: Fix -O functionality to override VHD differencing disk consistency checks 2016-11-26 07:06:19 -08:00
Mark Pizzolato
4f1f439174 DISK: Fix auto detect format attach logic for non VHD disks #356 2016-11-25 16:25:43 -08:00
Mark Pizzolato
df80f22152 DISK: Add better error reporting when differencing VHD attach fails 2016-11-21 21:30:46 -08:00
Mark Pizzolato
39d2944ede TIMER: Add support for catchup clock ticks and cleaned up asynchronous clocks
Asynchronous clocks are now built for all simulators which are built with
SIM_ASYNCH_IO defined.  The default behavior has asynchronous clocks
disabled since this is still experimental, but it can be enabled with
SET TIMER ASYNC.

Catchup clock ticks are now available, but since they're experimental,
they aren't enabled by default.  Catchup ticks are only available if the
simulators clock device calls sim_rtcn_tick_ack to acknowledge processing
of clock ticks.  The VAX simulators have been modified to leverage this.
Catchup clock ticks can be enabled with SET TIMER CATCHUP

Additionally, an idle threshold is provided which can be used to
influence when clock calibration may be suppressed.  The default is not
to suppress calibration activities.

The various timer behaviors are visible with the SHOW TIMER command.

The state of the operating timer facilities is visible with: SHOW CLOCK

Timer events which are queued are visible with the SHOW QUEUE command.
2016-11-16 23:50:53 -08:00
Mark Pizzolato
a24aba69ae VIDEO: Added priority boost to thread performing SDL processing and updates
Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
2016-06-11 09:52:33 -07:00
Mark Pizzolato
7a7b4de971 DISK: Fix MinGW build when compiling under g++ 2016-05-18 15:36:13 -07:00
Mark Pizzolato
e8ce83073f DISK: Allow building with g++ on Windows with MinGW 2016-05-17 22:58:32 -07:00
Mark Pizzolato
64716dad74 makefile: Fix MinGW build to allow C++ compiles 2016-05-16 16:17:22 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
32440a4138 PDP11, VAX: Fix memory leak when preparing DEC Std 144 bad block table on new disk images 2016-01-22 11:31:22 -08:00
Mark Pizzolato
5a99bcf185 SCP: Assure that files attached honor the unit Read-Only flag in addition to -R switches. 2016-01-12 09:52:14 -08:00
Mark Pizzolato
f1d9e749f6 DISK: Add disk content validation checking
When creating a new disk image the new disk image can be populated with
unique data in each sector.  The data is the logical block address of the sector
in a 4 byte little-endian value.  This is enabled when the -I switch is specified
on the ATTACH command.  To leverage this, a -K flag is interpreted on the
ATTACH command which will validate the entire disk contents actually
contains the expected value at attach time and also will validate that any data
written to the disk during simulator operation also contains the same logical
block address values.
2015-12-06 16:26:11 -08:00
Mark Pizzolato
f60390ce89 Compiler suggested cleanup
Cast the results of unit pointer subtraction to int so it can be printed with a %d format specifier.
2015-11-25 05:21:55 -08:00
Mark Pizzolato
73d7aee71f SCP: Add printf style format argument validation for all functions which take printf arguments.
These include: sim_printf(), sim_messagef(), Fprint() and sim_debug().

Fix current use of these functions which had invalid arguments.
2015-10-09 04:12:25 -07:00
Mark Pizzolato
d69b34e410 DISK: Support for both RAW disk and file size determination on *nix platforms 2015-06-30 14:21:02 -07:00
Mark Pizzolato
435ea69b20 DISK, TAPE: Make an -F switch specified on a disk/tape attach only change the device format until the unit is detached at which time the unit format will revert to the default format. Fix #219 2015-06-29 14:53:37 -07:00
Mark Pizzolato
133572908f SCP: Add natural Windows support for RAW device names. Fixes issue raised in #67.
Also avoid confusion when processing -F switch while also copying/creating a VHD
2015-06-28 14:14:19 -07:00
Mark Pizzolato
1548777278 SCP: Fix dangling perror details 2015-04-03 20:11:21 -07:00
Mark Pizzolato
41978eca80 All: Convert from C runtime library perror() to sim_perror so that all messages will arrive in the same place(s). 2015-04-03 19:56:37 -07:00
Mark Pizzolato
46d7bfc660 SCP: Fix sim_disk to avoid potential reference to uninitialized context structure. Fix #194 2015-03-19 13:52:33 -07:00
Mark Pizzolato
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
995ab8f1e2 More General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-24 14:37:37 -07:00
Mark Pizzolato
7087f1e1c6 Compiler suggested cleanup 2014-09-17 17:10:13 -07:00
Mark Pizzolato
f355749eb5 SCP: Provide a way to display an arbitrary buffer contents as hex in debug output 2014-09-17 09:08:12 -07:00
Mark Pizzolato
0dff1076a0 VAX, PDP11: Fix VHD support to save the correct updated part of the Block Allocation Table (BAT) when new blocks are added to a VHD. 2014-09-03 13:21:38 -07:00
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
4db30c13dd PDP11, VAX: Avoid strcpy use on overlapping buffers when creating and referencing VHDs. 2014-03-18 00:44:37 -07:00
Mark Pizzolato
3b1b7d6aaf PDP11, VAX: Fix VHD Differencing disk parent locator descriptors and removed deprecated descriptor types 2014-03-17 08:43:54 -07:00
Mark Pizzolato
b2134a01cf PDP11, VAX: Fix failure to create differencing VHDs when the parent VHD is larger than 2GB. 2014-03-16 08:33:15 -07:00
Mark Pizzolato
98ac7af6fa PDP11, VAX: Fix differencing virtual disk corruption during creation problems 2014-03-16 01:11:35 -07:00
Mark Pizzolato
02cb5c2d88 Compiler suggested cleanups.
Mostly silencing noise warnings, but bugs were found in sim_console.c and pdp11_dmc.c
2014-02-14 17:07:45 -08:00
Mark Pizzolato
2e85e74699 SCP: Various cleanups.
- Avoid assignments of void * values.  Cast all memory allocation return values to appropriate types.
- Add output to sim_log where missing in various places.
- Fixed issue with lost file positions after a restore for devices which leverage the UNIT_SEQ flag.
2013-11-20 09:13:27 -08:00
Mark Pizzolato
c9844951f7 PDP11/VAX: Make sure that semi-unique drive serial numbers have a zero msb to avoid issues in some operating systems. 2013-09-10 16:27:00 -07:00
Mark Pizzolato
786cda7c1b PDP11/VAX: Use semi-unique drive serial numbers when writing BAD144 bad block info to newly created disk images
The 32 bit drive serial number is determined by hashing the newly create filename.
2013-09-09 03:39:00 -07:00
Mark Pizzolato
e18d7e86e4 PDP11/VAX: Use unique drive serial numbers when writing BAD144 bad block info to newly created disk images 2013-09-08 19:42:46 -07:00
Mark Pizzolato
2bfaf46781 AIX Platform support 2013-05-23 11:33:36 -07:00
Mark Pizzolato
2c941c86d2 Fix to allow raw disk access even if Large File support isn't available on the host 2013-04-15 12:19:33 -07:00