The CTC and PORTS pump code for System V Release 2.0.5 for the 3B2 is
different from the pump code used by SVR 3, leading to PORTS and CTC
diagnostics failing to pass when running SVR2. This change adds
support for the pump code used in SVR 2.
At one point in the distant past, there was an unremembered
reason to prefer __libc_longjmp if it was available. It is no
longer needed, and has been removed from glibc in the most recent
versions.
Fixes#1088.
This commit fixes an issue that caused floppy diagnostics to fail if
the floppy drive unit was not attached. The 3B2 floppy controller has
a "force interrupt" command that should run whether or not the floppy
unit is attached to an image.
- This change introduces a full refactor of the interrupt subsystem
for the system board (SBD) and the I/O bus (CIO). Interrupt decode
should now be significantly faster, and not require an expensive
calculation on every step.
- The TIMER device has been split into Rev 2 and Rev 3
implementations.
- The optional 3B2/400 Debug Monitor ROMs can now be booted by passing
the "DEMON" argument to the 3B2/400 simulator BOOT command. Any
of the following will cause the Debug Monitor ROM to be booted
instead of the standard 3B2/400 ROM:
sim> BOOT DEMON
sim> BOOT CPU DEMON
sim> BOOT DEMON CPU
The actual contents of the input ROM binary files and the contents of the
created arrays are unchanged.
Multiple ROM image include files can be included in the same source module
without the need for any #undef BOOT_CODE_SIZE, etc.
This change signficantly improves header hygiene in the 3B2 project by
moving global symbols out of 3b2_defs.h and into the appropriate
individual module header files.
Each compilation unit now includes:
- its appropriate matching .h file
- any other .h files necessary for linting and compilation
Each header file in turn includes 3b2_defs.h, which contains truly
global symbols, and which pulls in sim_defs.h and exports global
devices.
The Rev 3 firmware does not check floppy controller status before
commanding a sector read, which can lead to calling sim_disk_rdsect()
on a detached unit. With this checkin, the simulator will no longer
attempt a read or write if the floppy unit is not attached.
This change introduces initial support for the AT&T 3B2 Rev 3 platform, based
around the WE32200 CPU with up to 64MB of RAM and SCSI disk and tape support.
This simulator is experimental and not yet supported. It will not be built by
default, but can be built with:
make 3b2-600
Or by using the 3B2-600 Windows Visual Studio project.
This commit adds support for automatically running DGMON SBD diagnostic tests
on build.
Additionally, a small bug is fixed in simulator boot caused by failure to
parse boot switches.
This change lays the groundwork for adding support for Rev 3 3B2 models,
which includes the Model 500, Model 600, and Model 1000.
Rather than use the fixed strings "400" and "1000" in file names, the
strings "rev2" and "rev3" will be used, which allows greater flexibility
to implement various system configurations more easily.
Additionally, this change adds a copy of the Debug Monitor (DEMON) ROM
image for the Rev 2 board, to be used soon in a later checkin.
Historically this functionality was reimplemented within each
DEVICE simulator often with slightly different implementations
and inconsistencies. Solving this globally within SCP required
changes in many places, but should henceforth be reasonably
managed.
As discussed in #1034
This avoids a potential invalid pointer dereference when formatting
the return value from sim_instr() if it is < SCPE_BASE but greater
than the previously defined static array size.sizeof
Update simh.doc to reflect this generic change.
Floppy disk images are potentially used as a medium of data exchange
between some hosts and simulators and the disk information can confuse
this process.
As discussed in #847
Refactor in preparation for the addition of a Rev 3 simulator for the
3B2/1000 system.
This change also includes a full cleanup of the rat's-nest of includes
and externs that plagued the 3B2 simulator and made it difficult to
understand and maintain. Headers are now required in the following
order:
compilation unit -> "3b2_defs.h" -> {... dependencies ...}
Finally, HELP has been added to the CPU device.
The WE32100 supports expanded datatypes for its opcodes, allowing an
opcode to override the default size (byte/halfword/word) expected by the
instruction. For example:
CMPH &0x10000,{uword}-8(%fp)
Without the {uword} marker, this instruction would only compare the
lower 2 bytes of -8(%fp) against the lower two bytes of the constant
value 0x10000, since the CMPH instruction compares halfwords. However,
with the {uword} marker, the CMPH instruction promotes the opcode from a
halfword to an unsigned word, sign extending if appropriate.
The CMP{W|H|B} instruction implementation in the 3B2 simulator was
ignoring any expanded type markers on its opcodes when checking whether
to set the "N" (negative) bit in the PSW, leading to a failure in
compiling GCC. This fix causes the instruction to honor the expanded
datatype in this case.
- The previous fix for STRCPY introduced a new bug. STRCPY must always
copy the final NULL terminator of the string, but must NOT increment
the source or destination pointers for the NULL terminator.
- The CTC simulation did not correctly support streaming mode, which
can in some cases request reads that are not on 512-byte block
boundaries.
- To begin to support System V Release 4 UNIX, the NI card (called EMD
under SVR4) needed to support several more CRC codes for pump code.
- A bug in the Square Root implementation could lead to
an infinite loop.
- Incorrect rounding was used when MAU destination register
was single or double word.
- Fix Coverity-discovered issues.
This change adds a small infinite loop program that will be used by
the simulator to establish a reasonable guess at the host's
performance in order to precalibrate the system timer.
- Integer addition of unsigned types could fail to set the
overflow flag, leading to errors in the SVR3 floating point
emulation library that rely on the overflow flag to detect
carry out of high bit on unsigned addition. This change
will correctly set the V flag if the high bit should be
carried out on an add.
This change adds support for the WE32106 Math Acceleration Unit (MAU).
The WE32106 is an IEEE-754 1985 compatible floating point math
acceleration unit that was an optional component on the 3B2/310 and
3B2/400.
The MAU is implemented using software floating point routines. As
always, there may be bugs, but the MAU currently passes extensive
floating point tests with exactly the same results as a real 3B2/400
equipped with a physical MAU, so I hope these are few.
Previously, the NI ethernet device expected to do all
autoconfiguration at attach time. Furthermore, if attaching failed for
some reason (e.g., permission issues on a tap device, etc.) the card
would be left autoconfigured, but in a broken state that could lead to
reading uninitialized memory.
This change fixes those bugs, and allows the device to be attached and
detached more freely. The card is now autoconfigured when it is
enabled. Attaching and detaching are analogous to connecting or
disconnecting an ethernet transceiver from the physical device.
This change enables the simulator to be shut down cleanly via a
soft-power shutdown command. This is implemented in the real 3B2/400
through the sanity timer, which, if it reaches zero, sets a bus timeout
flag in the CSR and issues an interrupt at IPL 15. The operating
system (System V UNIX) treats this as a shutdown request and enters
runlevel 0.
To use this change in a SIMH startup script, for example to implement a
3B2 simulator as a service, one could add these commands:
# [... simulator setup ...]
BOOT
SET TIMER SHUTDOWN
CONTINUE
EXIT
On catching a SIGTERM, SIGINT, or SIGHUP, the simulator would return to
SCP control, set the soft power shutdown flag, and then continue
simulator execution. After the system is cleanly shut down, the
simulator would then exit back to the operating system.
This change also addresses some unused function parameter warnings
issued by GNU Flycheck (not generally used by the build process, but
useful when editing files with Flycheck enabled)
- Formerly, the floppy controller buffered an entire diskette image
in memory using the unit buffer, and flushed it out on detach or
shutdown. This worked well enough, but it's better to have the
device use the SIMH disk sector read and write routines and
behave like a true disk.
- Read Only (Write Protect) logic has also been enabled in the
floppy controller, allowing users to mount images that do not
have write permissions.
- The IF (Integrated Floppy) and ID (Integrated Disk)
device names were poorly chosen. They conflict with built-in
scp commands and mess up the help system. This commit
changes them to IFLOPPY and IDISK, respectively.
NOTE!! THIS IS A BREAKING CONFIG CHANGE!!
- The DMAC controller "Current Word Count" expects to decrement
beyond 0 to 0xffff. Its initial value should also be 0xffff.
Setting the initial value to 0 introduced a very subtle bug
related to DUART self-test following a soft power reset.
This change cleans up warnings issued when compiled with
-Wall.
- Removed unused functions and variables.
- Moved static declarations out of headers and into source files
- Added braces around initialization where suggested.