mirror of
https://github.com/open-simh/simh.git
synced 2026-01-13 07:20:12 +00:00
Pervasive misuse of "ETH_MAC *" (a pointer to an ETH_MAC, aka a 6
element unsigned char array) when a simple "ETH_MAC" is correct. The
best example of this was eth_mac_fmt() in sim_ether.c with the following
prototype:
t_stat eth_mac_fmt (ETH_MAC* const mac, char* strmac)
The first parameter is a pointer to an array of 6 unsigned characters,
whereas it really just wants to be a pointer to the first element of the
array:
t_stat eth_mac_scan (const ETH_MAC mac, char* strmac)
The "ETH_MAC *" indirection error also results in subtle memcpy() and
memcmp() issues, e.g.:
void network_func(DEVICE *dev, ETH_MAC *mac)
{
ETH_MAC other_mac;
/* ...code... */
/* memcpy() bug: */
memcpy(other_mac, mac, sizeof(ETH_MAC));
/* or worse: */
memcpy(mac, other_mac, sizeof(ETH_MAC));
}
eth_copy_mac() and eth_mac_cmp() replace calls to memcpy() and memcmp()
that copy or compare Ethernet MAC addresses. These are type-enforcing
functions, i.e., the parameters are ETH_MAC-s, to avoid the subtle
memcpy() and memcmp() bugs.
This fix solves at least one Heisenbug in _eth_close() while free()-ing
write request buffers (and possibly other Heisenbugs.)
AT&T 3B2 Simulator
This module contains the source for two simulators:
- A simulator for the AT&T 3B2/400 computer (3b2-400 or 3B2-400.EXE)
- A simulator for the AT&T 3B2/700 computer (3b2-700 or 3B2-700.EXE)
Full documentation for the 3B2 simulator is available here:
3B2/400 Simulator Devices
The following devices are simulated. The SIMH names for the simulated devices are given in parentheses:
- 3B2 Model 400 System Board with 1MB, 2MB, or 4MB RAM
- Configuration and Status Register (CSR)
- WE32100 CPU (CPU)
- WE32101 MMU (MMU)
- WE32106 Math Accelerator Unit (MAU)
- PD8253 Interval Timer (TMR)
- AM9517 DMA controller (DMAC)
- SCN2681A Integrated DUART (IU)
- TMS2793 Integrated Floppy Controller (IFLOPPY)
- uPD7261A Integrated MFM Fixed Disk Controller (IDISK)
- Non-Volatile Memory (NVRAM)
- MM58174A Time Of Day Clock (TOD)
- CM195A Ethernet Network Interface (NI)
- CM195B 4-port Serial MUX (PORTS)
- CM195H Cartridge Tape Controller (CTC)
- CM195W SCSI Host Adapter (SCSI)
3B2/700 Simulator Devices
The following devices are simulated. The SIMH names for the simulated devices are given in parentheses:
- 3B2 Model 700 System Board with 8MB, 16MB, 32MB, or 64MB RAM
- Configuration and Status Registers (CSR)
- WE32200 CPU (CPU)
- WE32201 MMU (MMU)
- WE32106 Math Accelerator Unit (MAU)
- PD8253 Interval Timer (TMR)
- AM9517 DMA controller (DMAC)
- SCN2681A Integrated DUART (IU)
- TMS2793 Integrated Floppy Controller (IFLOPPY)
- Non-Volatile Memory (NVRAM)
- MM58274C Time Of Day Clock (TOD)
- CM195A Ethernet Network Interface (NI)
- CM195B 4-port Serial MUX (PORTS)
- CM195W SCSI Host Adapter (SCSI)