Commit graph

142 commits

Author SHA1 Message Date
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
Mark Pizzolato
4bd72e666c Compiler and static analyzer fixes from Peter Schorn. 2013-04-13 16:59:54 -07:00
Mark Pizzolato
8acb3b29e3 Fixed disk creation logic to avoid writing a zero sector to the first and last sector of a newly created disk if the disk's contents were copied from another disk. This solves the last details in issue #35 2013-04-07 12:43:54 -07:00
Mark Pizzolato
5727ad1a27 Added a -V option to a VHD copy operation to cause a verify pass which will confirm all of the expected data has made it to the target virtual disk 2013-03-25 04:32:06 -07:00
Mark Pizzolato
249f40e4bc Compiler indicated cleanup (FreeBSD on PPC) 2013-03-23 15:55:13 -07:00
Mark Pizzolato
ba2070f1f6 Fix handle leak if a memory allocation error occurred during a VHD create with Copy 2013-03-20 07:06:47 -07:00
Mark Pizzolato
e7c2adbbc4 Fixed bug affecting pdp11_rq disks introduced when adding greater than 2GB disk support to PDP11 simulator 2013-03-19 01:36:09 -07:00
Mark Pizzolato
0605b6dff4 Added support for building on Solaris with the Sun C compiler 2013-03-17 16:50:57 -07:00
Mark Pizzolato
2e5b0d54c6 Generalized the sim_disk layer to support large file disk devices (simh, VHD and RAW formats) with out requiring USE_ADDR64, and enhanced the pdp11_rq device to use this capability. 2013-03-17 12:02:43 -07:00
Mark Pizzolato
3dea6056e6 Remove compiler warnings generated by newer clang compiler 2013-03-13 16:38:30 -07:00
Mark Pizzolato
d5ca542102 Changed use of compile #defines which start with a _ character to not do this since defined symbols starting with _ are reserved to local compiler/runtime implementations in the C language. This addresses issue #32 2013-03-12 11:07:58 -07:00
Mark Pizzolato
bc40f6abde Removed recently linked dependence of VHD support on Large File support. VHDs can be supported without large file support up to the limits a system without large file support (i.e. 2GB). Fixes issue #35 2013-03-05 12:15:29 -08:00
Mark Pizzolato
4ff56d6c15 Changed all internal #ifdef's which were conditional on __linux to be conditional on either __linux or __linux__. Some platforms (PPC) don't define __linux when gcc is invoked with -std=c99. 2013-02-20 21:57:02 -08:00
Mark Pizzolato
952f29e205 Force include of unistd.h on linux 2013-02-19 09:59:56 -08:00
Mark Pizzolato
3d3f757991 Added display of VHD and RAW disk access capabilities to the output of SHOW VERSION 2013-02-19 09:44:23 -08:00
Mark Pizzolato
119ca2f03a Fixed display of percentage progress when copying or merging a VHD to avoid overflow 2013-02-15 13:54:55 -08:00
Mark Pizzolato
448ee4ad3c Fixed open issues on corrupt or inconsistent differencing disks to properly return error status.
Fixed error paths to report errors when copying a differencing disk.
Fixed structure alignment issues to produce dynamic VHDs which are compatible with Windows 7's disk management.
Fixed performance optimization which attempted to optimize dynamic disk BAT updates as dynamic disks grew.
Added -O attach option for to override consistency checks for differencing disks which may have unexpected parent GUID or timestamp values.
2013-02-11 09:48:36 -08:00
Mark Pizzolato
c4251bd53b Fixed GCC compiler identified warning. 2013-01-26 12:14:43 -08:00
Mark Pizzolato
9dcf5dc25e Added examples to the sim_disk attach help 2013-01-25 00:23:58 -08:00
Mark Pizzolato
e3207c2009 Compiler suggested cleanups 2013-01-23 05:07:44 -08:00