1. New Features in 2.10-2 The build procedures have changed. There is only one UNIX makefile. To compile without Ethernet support, simply type gmake {target|all} To compile with Ethernet support, type gmake USE_NETWORK=1 {target|all} The Mingw batch files require Mingw release 2 and invoke the Unix makefile. There are still separate batch files for compilation with or without Ethernet support. 1.1 SCP and Libraries - The EVAL command will evaluate a symbolic type-in and display it in numeric form. - The ! command (with no arguments) will launch the host operating system command shell. The ! command (with an argument) executes the argument as a host operating system command. (Code from Mark Pizzolato) - Telnet sessions now recognize BREAK. How a BREAK is transmitted dependent on the particular Telnet client. (Code from Mark Pizzolato) - The sockets library includes code for active connections as well as listening connections. - The RESTORE command will restore saved memory size, if the simulator supports dynamic memory resizing. 1.2 PDP-1 - The PDP-1 supports the Type 24 serial drum (based on recently discovered documents). 1.3 18b PDP's - The PDP-4 supports the Type 24 serial drum (based on recently discovered documents). 1.4 PDP-11 - The PDP-11 implements a stub DEUNA/DELUA (XU). The real XU module will be included in a later release. 1.5 PDP-10 - The PDP-10 implements a stub DEUNA/DELUA (XU). The real XU module will be included in a later release. 1.6 HP 2100 - The IOP microinstruction set is supported for the 21MX as well as the 2100. - The HP2100 supports the Access Interprocessor Link (IPL). 1.7 VAX - If the VAX console is attached to a Telnet session, BREAK is interpreted as console halt. - The SET/SHOW HISTORY commands enable and display a history of the most recently executed instructions. (Code from Mark Pizzolato) 1.8 Terminals Multiplexors - BREAK detection was added to the HP, DEC, and Interdata terminal multiplexors. 1.9 Interdata 16b and 32b - First release. UNIX is not yet working. 1.10 SDS 940 - First release. 2. Bugs Fixed in 2.10-2 - PDP-11 console must default to 7b for early UNIX compatibility. - PDP-11/VAX TMSCP emulator was using the wrong packet length for read/write end packets. - Telnet IAC+IAC processing was fixed, both for input and output (found by Mark Pizzolato). - PDP-11/VAX Ethernet setting flag bits wrong for chained descriptors (found by Mark Pizzolato). 3. New Features in 2.10 vs prior releases 3.1 SCP and Libraries - The VT emulation package has been replaced by the capability to remote the console to a Telnet session. Telnet clients typically have more complete and robust VT100 emulation. - Simulated devices may now have statically allocated buffers, in addition to dynamically allocated buffers or disk-based data stores. - The DO command now takes substitutable arguments (max 9). In command files, %n represents substitutable argument n. - The initial command line is now interpreted as the command name and substitutable arguments for a DO command. This is backward compatible to prior versions. - The initial command line parses switches. -Q is interpreted as quiet mode; informational messages are suppressed. - The HELP command now takes an optional argument. HELP <cmd> types help on the specified command. - Hooks have been added for implementing GUI-based consoles, as well as simulator-specific command extensions. A few internal data structures and definitions have changed. - Two new routines (tmxr_open_master, tmxr_close_master) have been added to sim_tmxr.c. The calling sequence for sim_accept_conn has been changed in sim_sock.c. - The calling sequence for the VM boot routine has been modified to add an additional parameter. - SAVE now saves, and GET now restores, controller and unit flags. - Library sim_ether.c has been added for Ethernet support. 3.2 VAX - Non-volatile RAM (NVR) can behave either like a memory or like a disk-based peripheral. If unattached, it behaves like memory and is saved and restored by SAVE and RESTORE, respectively. If attached, its contents are loaded from disk by ATTACH and written back to disk at DETACH and EXIT. - SHOW <device> VECTOR displays the device's interrupt vector. A few devices allow the vector to be changed with SET <device> VECTOR=nnn. - SHOW CPU IOSPACE displays the I/O space address map. - The TK50 (TMSCP tape) has been added. - The DEQNA/DELQA (Qbus Ethernet controllers) have been added. - Autoconfiguration support has been added. - The paper tape reader has been removed from vax_stddev.c and now references a common implementation file, dec_pt.h. - Examine and deposit switches now work on all devices, not just the CPU. - Device address conflicts are not detected until simulation starts. 3.3 PDP-11 - SHOW <device> VECTOR displays the device's interrupt vector. Most devices allow the vector to be changed with SET <device> VECTOR=nnn. - SHOW CPU IOSPACE displays the I/O space address map. - The TK50 (TMSCP tape), RK611/RK06/RK07 (cartridge disk), RX211 (double density floppy), and KW11P programmable clock have been added. - The DEQNA/DELQA (Qbus Ethernet controllers) have been added. - Autoconfiguration support has been added. - The paper tape reader has been removed from pdp11_stddev.c and now references a common implementation file, dec_pt.h. - Device bootstraps now use the actual CSR specified by the SET ADDRESS command, rather than just the default CSR. Note that PDP-11 operating systems may NOT support booting with non-standard addresses. - Specifying more than 256KB of memory, or changing the bus configuration, causes all peripherals that are not compatible with the current bus configuration to be disabled. - Device address conflicts are not detected until simulation starts. 3.4 PDP-10 - SHOW <device> VECTOR displays the device's interrupt vector. A few devices allow the vector to be changed with SET <device> VECTOR=nnn. - SHOW CPU IOSPACE displays the I/O space address map. - The RX211 (double density floppy) has been added; it is off by default. - The paper tape now references a common implementation file, dec_pt.h. - Device address conflicts are not detected until simulation starts. 3.5 PDP-1 - DECtape (then known as MicroTape) support has been added. - The line printer and DECtape can be disabled and enabled. 3.6 PDP-8 - The RX28 (double density floppy) has been added as an option to the existing RX8E controller. - SHOW <device> DEVNO displays the device's device number. Most devices allow the device number to be changed with SET <device> DEVNO=nnn. - Device number conflicts are not detected until simulation starts. 3.7 IBM 1620 - The IBM 1620 simulator has been released. 3.8 AltairZ80 - A hard drive has been added for increased storage. - Several bugs have been fixed. 3.9 HP 2100 - The 12845A has been added and made the default line printer (LPT). The 12653A has been renamed LPS and is off by default. It also supports the diagnostic functions needed to run the DCPC and DMS diagnostics. - The 12557A/13210A disk defaults to the 13210A (7900/7901). - The 12559A magtape is off by default. - New CPU options (EAU/NOEAU) enable/disable the extended arithmetic instructions for the 2116. These instructions are standard on the 2100 and 21MX. - New CPU options (MPR/NOMPR) enable/disable memory protect for the 2100 and 21MX. - New CPU options (DMS/NODMS) enable/disable the dynamic mapping instructions for the 21MX. - The 12539 timebase generator autocalibrates. 3.10 Simulated Magtapes - Simulated magtapes recognize end of file and the marker 0xFFFFFFFF as end of medium. Only the TMSCP tape simulator can generate an end of medium marker. - The error handling in simulated magtapes was overhauled to be consistent through all simulators. 3.11 Simulated DECtapes - Added support for RT11 image file format (256 x 16b) to DECtapes. 4. Bugs Fixed in 2.10 vs prior releases - TS11/TSV05 was not simulating the XS0_MOT bit, causing failures under VMS. In addition, two of the CTL options were coded interchanged. - IBM 1401 tape was not setting a word mark under group mark for load mode reads. This caused the diagnostics to crash. - SCP bugs in ssh_break and set_logon were fixed (found by Dave Hittner). - Numerous bugs in the HP 2100 extended arithmetic, floating point, 21MX, DMS, and IOP instructions were fixed. Bugs were also fixed in the memory protect and DMS functions. The moving head disks (DP, DQ) were revised to simulate the hardware more accurately. Missing functions in DQ (address skip, read address) were added. - PDP-10 tape wouldn't boot, and then wouldn't read (reported by Michael Thompson and Harris Newman, respectively) - PDP-1 typewriter is half duplex, with only one shift state for both input and output (found by Derek Peschel) 5. General Notes WARNING: V2.10 has reorganized and renamed some of the definition files for the PDP-10, PDP-11, and VAX. Be sure to delete all previous source files before you unpack the Zip archive, or unpack it into a new directory structure. WARNING: V2.10 has a new, more comprehensive save file format. Restoring save files from previous releases will cause 'invalid register' errors and loss of CPU option flags, device enable/ disable flags, unit online/offline flags, and unit writelock flags. WARNING: If you are using Visual Studio .NET through the IDE, be sure to turn off the /Wp64 flag in the project settings, or dozens of spurious errors will be generated. WARNING: Compiling Ethernet support under Windows requires extra steps; see the Ethernet readme file. Ethernet support is currently available only for Windows, Linux, NetBSD, and OpenBSD.
268 lines
9.8 KiB
C
268 lines
9.8 KiB
C
/* hp2100_defs.h: HP 2100 simulator definitions
|
||
|
||
Copyright (c) 1993-2002, Robert M. Supnik
|
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a
|
||
copy of this software and associated documentation files (the "Software"),
|
||
to deal in the Software without restriction, including without limitation
|
||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||
and/or sell copies of the Software, and to permit persons to whom the
|
||
Software is furnished to do so, subject to the following conditions:
|
||
|
||
The above copyright notice and this permission notice shall be included in
|
||
all copies or substantial portions of the Software.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||
ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
|
||
Except as contained in this notice, the name of Robert M Supnik shall not
|
||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||
in this Software without prior written authorization from Robert M Supnik.
|
||
|
||
24-Oct-02 RMS Added indirect address interrupt
|
||
08-Feb-02 RMS Added DMS definitions
|
||
01-Feb-02 RMS Added terminal multiplexor support
|
||
16-Jan-02 RMS Added additional device support
|
||
30-Nov-01 RMS Added extended SET/SHOW support
|
||
15-Oct-00 RMS Added dynamic device numbers
|
||
14-Apr-99 RMS Changed t_addr to unsigned
|
||
|
||
The author gratefully acknowledges the help of Jeff Moffat in answering
|
||
questions about the HP2100.
|
||
*/
|
||
|
||
#include "sim_defs.h" /* simulator defns */
|
||
|
||
/* Simulator stop codes */
|
||
|
||
#define STOP_RSRV 1 /* must be 1 */
|
||
#define STOP_IODV 2 /* must be 2 */
|
||
#define STOP_HALT 3 /* HALT */
|
||
#define STOP_IBKPT 4 /* breakpoint */
|
||
#define STOP_IND 5 /* indirect loop */
|
||
#define STOP_INDINT 6 /* indirect intr */
|
||
#define STOP_NOCONN 7 /* no connection */
|
||
|
||
#define ABORT_PRO 1 /* protection abort */
|
||
|
||
/* Memory */
|
||
|
||
#define MEMSIZE (cpu_unit.capac) /* actual memory size */
|
||
#define MEM_ADDR_OK(x) (((t_addr) (x)) < MEMSIZE)
|
||
#define VA_N_SIZE 15 /* virtual addr size */
|
||
#define VASIZE (1 << VA_N_SIZE)
|
||
#define VAMASK (VASIZE - 1) /* virt addr mask */
|
||
#define PA_N_SIZE 20 /* phys addr size */
|
||
#define PASIZE (1 << PA_N_SIZE)
|
||
#define PAMASK (PASIZE - 1) /* phys addr mask */
|
||
|
||
/* Architectural constants */
|
||
|
||
#define SIGN32 020000000000 /* 32b sign */
|
||
#define SIGN 0100000 /* 16b sign */
|
||
#define DMASK 0177777 /* 16b data mask */
|
||
#define AR M[0] /* A = location 0 */
|
||
#define BR M[1] /* B = location 1 */
|
||
#define ABREG M /* register array */
|
||
#define SEXT(x) ((int32) (((x) & SIGN)? ((x) | ~DMASK): ((x) & DMASK)))
|
||
|
||
/* Memory reference instructions */
|
||
|
||
#define I_IA 0100000 /* indirect address */
|
||
#define I_AB 0004000 /* A/B select */
|
||
#define I_CP 0002000 /* current page */
|
||
#define I_DISP 0001777 /* page displacement */
|
||
#define I_PAGENO 0076000 /* page number */
|
||
|
||
/* Other instructions */
|
||
|
||
#define I_NMRMASK 0102000 /* non-mrf opcode */
|
||
#define I_SRG 0000000 /* shift */
|
||
#define I_ASKP 0002000 /* alter/skip */
|
||
#define I_EXTD 0100000 /* extend */
|
||
#define I_IO 0102000 /* I/O */
|
||
#define I_CTL 0004000 /* CTL on/off */
|
||
#define I_HC 0001000 /* hold/clear */
|
||
#define I_DEVMASK 0000077 /* device mask */
|
||
#define I_GETIOOP(x) (((x) >> 6) & 07) /* I/O sub op */
|
||
|
||
/* DMA channels */
|
||
|
||
#define DMA1_STC 0100000 /* DMA - issue STC */
|
||
#define DMA1_CLC 0020000 /* DMA - issue CLC */
|
||
#define DMA2_OI 0100000 /* DMA - output/input */
|
||
|
||
struct DMA { /* DMA channel */
|
||
int32 cw1; /* device select */
|
||
int32 cw2; /* direction, address */
|
||
int32 cw3; /* word count */
|
||
};
|
||
|
||
/* Memory management */
|
||
|
||
#define VA_N_OFF 10 /* offset width */
|
||
#define VA_M_OFF ((1 << VA_N_OFF) - 1) /* offset mask */
|
||
#define VA_GETOFF(x) ((x) & VA_M_OFF)
|
||
#define VA_N_PAG (VA_N_SIZE - VA_N_OFF) /* page width */
|
||
#define VA_V_PAG (VA_N_OFF)
|
||
#define VA_M_PAG ((1 << VA_N_PAG) - 1)
|
||
#define VA_GETPAG(x) (((x) >> VA_V_PAG) & VA_M_PAG)
|
||
|
||
/* Maps */
|
||
|
||
#define MAP_NUM 4 /* num maps */
|
||
#define MAP_LNT (1 << VA_N_PAG) /* map length */
|
||
#define MAP_MASK ((MAP_NUM * MAP_LNT) - 1)
|
||
#define SMAP 0 /* system map */
|
||
#define UMAP (SMAP + MAP_LNT) /* user map */
|
||
#define PAMAP (UMAP + MAP_LNT) /* port A map */
|
||
#define PBMAP (PAMAP + MAP_LNT) /* port B map */
|
||
|
||
/* Map entries are left shifted by VA_N_OFF, flags in lower 2b */
|
||
|
||
#define PA_N_PAG (PA_N_SIZE - VA_N_OFF) /* page width */
|
||
#define PA_V_PAG (VA_N_OFF)
|
||
#define PA_M_PAG ((1 << PA_N_PAG) - 1)
|
||
#define MAPM_V_RPR 15 /* in mem: read prot */
|
||
#define MAPM_V_WPR 14 /* write prot */
|
||
#define MAPA_V_RPR 1 /* in array: */
|
||
#define MAPA_V_WPR 0
|
||
#define PA_GETPAG(x) ((x) & (PA_M_PAG << VA_V_PAG))
|
||
#define RD (1 << MAPA_V_RPR)
|
||
#define WR (1 << MAPA_V_WPR)
|
||
|
||
/* Map status register */
|
||
|
||
#define MST_ENBI 0100000 /* mem enb @ int */
|
||
#define MST_UMPI 0040000 /* usr map @ int */
|
||
#define MST_ENB 0020000 /* mem enb */
|
||
#define MST_UMP 0010000 /* usr map */
|
||
#define MST_PRO 0004000 /* protection */
|
||
#define MST_FLT 0002000 /* fence comp */
|
||
#define MST_FENCE 0001777 /* base page fence */
|
||
|
||
/* Map violation register */
|
||
|
||
#define MVI_V_RPR 15
|
||
#define MVI_V_WPR 14
|
||
#define MVI_RPR (1 << MVI_V_RPR) /* rd viol */
|
||
#define MVI_WPR (1 << MVI_V_WPR) /* wr viol */
|
||
#define MVI_BPG 0020000 /* base page viol */
|
||
#define MVI_PRV 0010000 /* priv viol */
|
||
#define MVI_MEB 0000200 /* me bus enb @ viol */
|
||
#define MVI_MEM 0000100 /* mem enb @ viol */
|
||
#define MVI_UMP 0000040 /* usr map @ viol */
|
||
#define MVI_PAG 0000037 /* pag sel */
|
||
|
||
/* Timers */
|
||
|
||
#define TMR_CLK 0 /* clock */
|
||
#define TMR_MUX 1 /* multiplexor */
|
||
|
||
/* I/O sub-opcodes */
|
||
|
||
#define ioHLT 0 /* halt */
|
||
#define ioFLG 1 /* set/clear flag */
|
||
#define ioSFC 2 /* skip on flag clear */
|
||
#define ioSFS 3 /* skip on flag set */
|
||
#define ioMIX 4 /* merge into A/B */
|
||
#define ioLIX 5 /* load into A/B */
|
||
#define ioOTX 6 /* output from A/B */
|
||
#define ioCTL 7 /* set/clear control */
|
||
|
||
/* I/O devices - fixed assignments */
|
||
|
||
#define CPU 000 /* interrupt control */
|
||
#define OVF 001 /* overflow */
|
||
#define DMALT0 002 /* DMA 0 alternate */
|
||
#define DMALT1 003 /* DMA 1 alternate */
|
||
#define PWR 004 /* power fail */
|
||
#define PRO 005 /* parity/mem protect */
|
||
#define DMA0 006 /* DMA channel 0 */
|
||
#define DMA1 007 /* DMA channel 1 */
|
||
#define VARDEV (DMA1 + 1) /* start of var assign */
|
||
#define M_NXDEV (INT_M (CPU) | INT_M (OVF) | \
|
||
INT_M (DMALT0) | INT_M (DMALT1))
|
||
#define M_FXDEV (M_NXDEV | INT_M (PWR) | INT_M (PRO) | \
|
||
INT_M (DMA0) | INT_M (DMA1))
|
||
|
||
/* I/O devices - variable assignment defaults */
|
||
|
||
#define PTR 010 /* paper tape reader */
|
||
#define TTY 011 /* console */
|
||
#define PTP 012 /* paper tape punch */
|
||
#define CLK 013 /* clock */
|
||
#define LPS 014 /* 12653 line printer */
|
||
#define LPT 015 /* 12845 line printer */
|
||
#define MTD 020 /* 12559A data */
|
||
#define MTC 021 /* 12559A control */
|
||
#define DPD 022 /* 12557A data */
|
||
#define DPC 023 /* 12557A control */
|
||
#define DQD 024 /* 12565A data */
|
||
#define DQC 025 /* 12565A control */
|
||
#define DRD 026 /* 12610A data */
|
||
#define DRC 027 /* 12610A control */
|
||
#define MSD 030 /* 13181A data */
|
||
#define MSC 031 /* 13181A control */
|
||
#define IPLI 032 /* 12556B link in */
|
||
#define IPLO 033 /* 12556B link out */
|
||
#define MUXL 040 /* 12920A lower data */
|
||
#define MUXU 041 /* 12920A upper data */
|
||
#define MUXC 042 /* 12920A control */
|
||
|
||
/* IBL assignments */
|
||
|
||
#define IBL_PTR 0000000 /* PTR */
|
||
#define IBL_DP 0040000 /* DP */
|
||
#define IBL_DQ 0060000 /* DQ */
|
||
#define IBL_MS 0100000 /* MS */
|
||
#define IBL_TBD 0140000 /* tbd */
|
||
#define IBL_V_DEV 6 /* dev in <11:6> */
|
||
#define IBL_FIX 0000001 /* DP fixed */
|
||
#define IBL_LNT 64 /* boot length */
|
||
#define IBL_MASK (IBL_LNT - 1) /* boot length mask */
|
||
|
||
/* Dynamic device information table */
|
||
|
||
struct hp_dib {
|
||
int32 devno; /* device number */
|
||
int32 cmd; /* saved command */
|
||
int32 ctl; /* saved control */
|
||
int32 flg; /* saved flag */
|
||
int32 fbf; /* saved flag buf */
|
||
int32 (*iot)(); /* I/O routine */
|
||
};
|
||
|
||
typedef struct hp_dib DIB;
|
||
|
||
/* I/O macros */
|
||
|
||
#define INT_V(x) ((x) & 037) /* device bit pos */
|
||
#define INT_M(x) (1u << INT_V (x)) /* device bit mask */
|
||
#define setCMD(D) dev_cmd[(D)/32] = dev_cmd[(D)/32] | INT_M ((D))
|
||
#define clrCMD(D) dev_cmd[(D)/32] = dev_cmd[(D)/32] & ~INT_M (D)
|
||
#define setCTL(D) dev_ctl[(D)/32] = dev_ctl[(D)/32] | INT_M ((D))
|
||
#define clrCTL(D) dev_ctl[(D)/32] = dev_ctl[(D)/32] & ~INT_M (D)
|
||
#define setFBF(D) dev_fbf[(D)/32] = dev_fbf[(D)/32] | INT_M (D)
|
||
#define clrFBF(D) dev_fbf[(D)/32] = dev_fbf[(D)/32] & ~INT_M (D)
|
||
#define setFLG(D) dev_flg[(D)/32] = dev_flg[(D)/32] | INT_M (D); \
|
||
setFBF(D)
|
||
#define clrFLG(D) dev_flg[(D)/32] = dev_flg[(D)/32] & ~INT_M (D); \
|
||
clrFBF(D)
|
||
#define CMD(D) ((dev_cmd[(D)/32] >> INT_V (D)) & 1)
|
||
#define CTL(D) ((dev_ctl[(D)/32] >> INT_V (D)) & 1)
|
||
#define FLG(D) ((dev_flg[(D)/32] >> INT_V (D)) & 1)
|
||
#define FBF(D) ((dev_fbf[(D)/32] >> INT_V (D)) & 1)
|
||
|
||
#define IOT_V_REASON 16
|
||
#define IORETURN(f,v) ((f)? (v): SCPE_OK) /* stop on error */
|
||
|
||
/* Function prototypes */
|
||
|
||
t_stat hp_setdev (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||
t_stat hp_showdev (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||
void hp_enbdis_pair (DEVICE *ccp, DEVICE *dcp);
|