Commit graph

122 commits

Author SHA1 Message Date
Peter Schorn
0f6bcb9682 SIMH: Fix spelling errors in comments and strings 2024-07-11 12:29:53 +02:00
B. Scott Michel
a275c71170 SCP: Reduce compiler warnings on LP64 platforms
(Note: Reducing compiler warnings across all, but primarily LP64
platforms, is a long term objective.)

Reduce compiler warnings on LP64 platforms (macOS, Windows) and 32-bit
builds (Win32). Prefer 'size_t' for pointer arithmetic, array indexing
and extents; 'int' hasn't been used for these purposes for many years
and across many ANSI standards. N.B. that conversions from int or int32
to size_t cause the compiler to zero-extend the value, which is
inefficient.

Refactor printf() format modifiers into sim_printf_fmts.h. Add the
SIZE_T_FMT modifier for better portability, especially on LP64 platforms
where size_t is unsigned long and sizeof(size_t) > sizeof(int).

3B2: Fix known size_t printf() format.
2024-02-01 12:51:32 -05:00
Bob Supnik
4562408a5f Common code: various bugfixes; Mac "Classic" and OS/2 support has been removed 2023-01-31 14:49:35 -05:00
Mark Pizzolato
61c1af846f TAPE: export sim_tape_error_text 2022-03-14 15:28:39 -07:00
Mark Pizzolato
0116987fc7 TAPE: Added additional switch descriptions for attach time help 2022-02-12 20:11:28 -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
ca4a63929a TAPE: Add more advanced test cases and fixes various ANSI cases
Mostly from Larry Baker
2021-09-30 21:02:43 -07:00
Larry Baker
df851ebf1a TAPE: Add useful verbose output during ANSI tape testing 2021-09-28 14:36:28 -07:00
Mark Pizzolato
fc0ce0f5fb TAPE: Avoid redundant records when creating ANSI binary fixed tape files
As reported by Larry Baker
2021-09-28 14:29:38 -07:00
Mark Pizzolato
7bb96070f1 TAPE: Fix test logic to properly detach tested unit
As reported by Larry Baker
2021-09-27 21:39:58 -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
09db504f65 TAPE: Avoid XCode false positive analysis warning 2021-08-23 12:09:43 -07:00
Mark Pizzolato
f95b20e1f3 SCP: Cleanup potential compiler warnings 2021-08-13 09:09:53 -07:00
Mark Pizzolato
4a41021be9 TAPE: Various fixes and additions
- Cleanup Compiler warnings
- Validate FIXED binary data as a multiple of the record size
- Add file classification tests
2020-10-19 17:25:17 -07:00
Larry Baker
117157e088 TAPE: Cleanup and various fixes
- Use tape->block_size uniformly for FIXED record length/block size
- Change tape_classify_file_contents() so the max_record_size for text
  files does not include the line endings (fixes FIXED -B 80 failure when
  reading 80- character card-images, fixes invalid ANSI HDR2 Record
  Length for ANSI-VMS, ANSI-RSX11, and ANSI-VAR -B 512 when
  reading 508-character lines)
- Distinguish RMS Record Size from ANSI Record Length: RMS Record
  Size does not include the ANSI 'D' Record Format Record Control Word
  (RCW); ANSI Record Length does
- Verify the ANSI Record Length is legal for text files
- Verify that the ANSI -B block size is large enough
- Write ANSI Record Length in HDR2 label, write RMS Record Size in
  HDR3 label; whether they are the same or not depends on the ANSI
  Record Format
- Pad ANSI short binary records with zeros (ANSI 'F' records must
  all be the HDR2 Record Length)
2020-10-19 17:19:48 -07:00
Larry Baker
d8004ccaf6 TAPE: Cleanup, minor bug fixes and robustness additions
- Minimum -B is 14 (shorter records on mag tapes are considered noise)
- Maximum -B is 65535 (DEC tape controllers have a 16-bit byte count register)
- Remove redundant setting of TAR default record size
- Notify the user when the -E option is being ignored
- Use the UNIT_RO format flag to set the SIMH ReadOnly attach option
- Use three tape marks to mark the end of a volume for RT-11 and RSTS
  (ANSI and DOS11 formats); the third tape mark is harmless on RSX-11
  and VMS, which only write two
- TAR -B must be a multiple of 512 (tar specifies the mag tape block size
  in number of 512-byte records)
- The TAR file must exist
- Use a conditional test with the "is a MEMORY_TAPE image" invariant in
  sim_tape.h to select the correct tape unit attach failure message
- Always print a tape attach summary message, like SIMH does for disks;
  simplify and fix some of the other messages there
- Remove unnecessary memset()'s in dos11_copy_ascii_file()
- Fix a 16-bit integer overflow in the DOS label date calculation
2020-09-22 12:35:34 -07:00
Larry Baker
6f207b22a5 TAPE: Minor cleanup and comments here and there. 2020-08-24 18:45:08 -07:00
Larry Baker
67c3ba1e6a TAPE: Clean up library test file removal 2020-08-20 17:35:03 -07:00
Mark Pizzolato
d92aaef9b0 TAPE: Avoid potential uninitialized variable reference 2020-08-16 06:41:33 -07:00
Larry Baker
4041894b67 TAPE: Fix potential crash in library unit tests
Improper declaration of state variables referenced in setjmp/longjmp.
2020-08-15 16:21:02 -07:00
Larry Baker
c062c7589d TAPE: Enhanced file type detection performance and cleaned up stylistic details 2020-06-14 14:10:55 -07:00
Mark Pizzolato
b9297e185f TAPE: Fix ANSI EOF1 to correctly indicate the block count
- when the file ends on a block boundary, the block count was
  off by one.
- always use the max_record_size in ANSI labels independent of
  the ansi-type.
2020-05-26 09:47:10 -07:00
Mark Pizzolato
4443789fd0 TAPE: Cleanup wording in comments 2020-05-16 03:20:43 -07:00
John Forecast
f8a369e6d4 TAPE: Add DOS11 tape support for dynamic tape containing local files 2020-04-02 10:20:47 -07:00
Mark Pizzolato
519ef27def DISK, TAPE: Remove compiler and Coverity warnings 2019-11-24 10:55:25 -08:00
Mark Pizzolato
190baf897c TAPE: Rework tape image error processing to avoid potential TOCTOU (Coverity) 2019-11-17 12:09:19 -08:00
Mark Pizzolato
318b0e32bb TAPE: Report file access errors when attaching in-memory ANSI tapes 2019-11-16 00:39:01 -08:00
Mark Pizzolato
7c1c04d9a9 SCP: Clear Coverity identified warnings 2019-11-14 21:38:45 -08:00
Mark Pizzolato
aff3346eae TAPE: Correct wording in status message 2019-10-16 13:43:08 -07:00
Mark Pizzolato
fac5bc96fb TAPE: Tolerate SIMH format tape images that contain gaps during validation.
- Add gap data to tape tests

As discussed in #756
2019-10-16 00:25:51 -07:00
Mark Pizzolato
2840e3b67f SCP: Fix Coverity identified issues/noise 2019-07-15 00:04:40 -07:00
Mark Pizzolato
81472b5807 TAPE: Add an explicit ANSI-VAR format to generically present text files 2019-07-01 08:11:46 -07:00
Mark Pizzolato
6908c1e46c TAPE: Add support for FIXED record size unlabeled tape of binary and text files 2019-07-01 08:11:20 -07:00
Mark Pizzolato
e49617cd0c TAPE: Add ability to copy a tape to a SIMH format tape image
This is an implicit tape conversion tool from any supported format to
SIMH format.
2019-07-01 08:10:36 -07:00
Mark Pizzolato
47bac1f665 TAPE: Fix edge cases for AWS format tapes and default TAR block size
- Add more AWS test cases
- Add better position validation when scanning a tape image
- Properly clear SIGINT flag for interrupt during a tape attach
2019-06-29 07:39:23 -07:00
Mark Pizzolato
09bbcb29d2 TAPE: Fix P7B reverse read logic for large records
The earlier optimization to address P7B reverse read performance
didn't properly back up under some circumstances.

As potentially reported in #707
2019-06-08 13:52:27 -07:00
Mark Pizzolato
a24119aff7 TAPE: Fix RSTS file date (preserving Y2K bug) and form feed is text 2019-05-14 20:38:46 -07:00
Mark Pizzolato
db26349bd7 TAPE: Add system specific ANSI tape formats VMS, RSX, RSTS and RT11
These formats are named ANSI-VMS, ANSI-RSX11, ANSI-RSTS and ANSI-RT11
2019-05-14 01:04:18 -07:00
Mark Pizzolato
52a31597ec TAPE: Add ANSIFILES tape format 2019-05-07 05:26:20 -07:00
Mark Pizzolato
0c39921fb7 TAPE: Full speed performance of tape image validation scan
- Force the detection point of a tape structure error to be the logical EOM
  on the tape.
- Enable SIGINT abort of a possibly long running validation scan
- Add -L detail record structure option at ATTACH time
- Add extra garbage at end of generated test data files
2019-04-16 18:20:25 -07:00
Mark Pizzolato
0d894613f9 TAPE: Improve attach time tape scan performance 2019-04-11 21:01:10 -07:00
Mark Pizzolato
9dbc800e58 TAPE: Make sure that all tape record lengths are properly typed.
- Add Tape Format help options that include recently added format types to
  MTAB entries.
2019-04-10 14:26:20 -07:00
Mark Pizzolato
f12bc70470 TAPE: Add support for TAR tape format 2019-04-06 02:00:53 -07:00
Mark Pizzolato
436f1dbbbe TAPE: Reworked reverse read of P7B tapes to avoid seeking on every byte
- Added string density support for MTAB generation
2019-04-05 00:00:24 -07:00
Mark Pizzolato
e6490223eb TAPE: Fix P7B record length return when encountering a tape mark 2019-04-02 09:26:34 -07:00
Mark Pizzolato
2ba50a3f70 TAPE: Fix potential Coverity complaints 2019-04-01 15:06:25 -07:00
Mark Pizzolato
de829e52e9 TAPE: Fix incorrect comparison typo. 2019-03-31 09:35:52 -07:00
Mark Pizzolato
98f6aae31a TAPE: Make ATTACH time validation check more robust
- Different systems used tape marks in different ways that are now
  tolerated (multiple successive ones located on different parts of
  the tape, etc.)
- Always validate beginning and end of record length indicators to avoid
  moving into invalidly structured tape data
2019-03-30 09:27:02 -07:00
Mark Pizzolato
e56b5f05e7 TAPE: Add support for AWS format tape images
Also added extended tape unit test code
2019-03-26 14:06:57 -07:00
Mark Pizzolato
690b896cb4 TAPE: Fix Coverity identified issues 2019-03-20 01:45:16 -07:00