1
0
mirror of https://github.com/simh/simh.git synced 2026-05-06 07:42:23 +00:00

Merge remote-tracking branch 'github-simh/master' into KDP

This commit is contained in:
Mark Pizzolato
2013-06-02 16:50:03 -07:00
34 changed files with 1675 additions and 86 deletions

View File

@@ -197,6 +197,7 @@ jmp_buf save_env;
int32 hst_p = 0; /* history pointer */
int32 hst_lnt = 0; /* history length */
InstHistory *hst = NULL; /* instruction history */
int32 apr_serial = -1; /* CPU Serial number */
/* Forward and external declarations */
@@ -205,6 +206,9 @@ t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc);
d10 adjsp (d10 val, a10 ea);
void ibp (a10 ea, int32 pflgs);
d10 ldb (a10 ea, int32 pflgs);
@@ -400,6 +404,7 @@ MTAB cpu_mod[] = {
NULL, &show_iospace },
{ MTAB_XTD|MTAB_VDV|MTAB_NMO|MTAB_SHP, 0, "HISTORY", "HISTORY",
&cpu_set_hist, &cpu_show_hist },
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "SERIAL", "SERIAL", &cpu_set_serial, &cpu_show_serial },
{ 0 }
};
@@ -2104,7 +2109,14 @@ return;
t_bool aprid (a10 ea, int32 prv)
{
Write (ea, (Q_ITS)? UC_AIDITS: UC_AIDDEC, prv);
d10 value = (Q_ITS)? UC_AIDITS: UC_AIDDEC;
if( (apr_serial == -1) || (!Q_ITS && apr_serial < 4096) )
value |= (Q_ITS)? UC_SERITS: UC_SERDEC;
else
value |= apr_serial;
Write (ea, value, prv);
return FALSE;
}
@@ -2419,3 +2431,34 @@ for (k = 0; k < lnt; k++) { /* print specified */
} /* end for */
return SCPE_OK;
}
/* Set serial */
t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc)
{
int32 lnt;
t_stat r;
if (cptr == NULL) {
apr_serial = -1;
return SCPE_OK;
}
lnt = (int32) get_uint (cptr, 10, 077777, &r);
if ((r != SCPE_OK) || (lnt <= 0) || (!Q_ITS && lnt < 4096))
return SCPE_ARG;
apr_serial = lnt & 077777;
return SCPE_OK;
}
/* Show serial */
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "Serial: " );
if( (apr_serial == -1) || (!Q_ITS && apr_serial < 4096) ) {
fprintf (st, "%d (default)", (Q_ITS)? UC_SERITS: UC_SERDEC);
return SCPE_OK;
}
fprintf (st, "%d", apr_serial);
return SCPE_OK;
}

View File

@@ -476,8 +476,9 @@ typedef t_int64 d10; /* PDP-10 data (36b) */
#define UC_SERDEC 4097 /* serial number */
#define UC_SERITS 1729
#define UC_AIDDEC (UC_INHCST | UC_UBABLT | UC_KIPAGE | UC_KLPAGE | \
UC_VERDEC | UC_SERDEC)
#define UC_AIDITS (UC_KIPAGE | UC_VERITS | UC_SERITS)
UC_VERDEC)
#define UC_AIDITS (UC_KIPAGE | UC_VERITS)
#define UC_HSBDEC 0376000 /* DEC initial HSB */
#define UC_HSBITS 0000500 /* ITS initial HSB */
@@ -619,6 +620,7 @@ typedef struct pdp_dib DIB;
#define DZ_MUXES 4 /* max # of muxes */
#define DZ_LINES 8 /* lines per mux */
#define DUP_LINES 4 /* max # of DUP11's */
#define DIB_MAX 100 /* max DIBs */
#define DEV_V_UBUS (DEV_V_UF + 0) /* Unibus */
@@ -712,6 +714,9 @@ typedef struct pdp_dib DIB;
#define INT_V_PTP 25
#define INT_V_LP20 26 /* LPT20 */
#define INT_V_CR 27 /* CD20 (CD11) */
#define INT_V_CR 27 /* CD20 (CD11) */
#define INT_V_DUPRX 28 /* DUP11 */
#define INT_V_DUPTX 29
#define INT_RP (1u << INT_V_RP)
#define INT_TU (1u << INT_V_TU)
@@ -729,6 +734,8 @@ typedef struct pdp_dib DIB;
#define INT_PTP (1u << INT_V_PTP)
#define INT_LP20 (1u << INT_V_LP20)
#define INT_CR (1u << INT_V_CR)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define IPL_RP 6 /* int levels */
#define IPL_TU 6
@@ -742,6 +749,8 @@ typedef struct pdp_dib DIB;
#define IPL_DZRX 5
#define IPL_DZTX 5
#define IPL_RY 5
#define IPL_DUPRX 5
#define IPL_DUPTX 5
#define IPL_PTR 4
#define IPL_PTP 4
#define IPL_LP20 4

View File

@@ -25,6 +25,8 @@
lp20 line printer
29-May-13 TL Force append when an existing file is attached.
Previously over-wrote file from the top.
19-Jan-07 RMS Added UNIT_TEXT flag
04-Sep-05 RMS Fixed missing return (found by Peter Schorn)
07-Jul-05 RMS Removed extraneous externs
@@ -374,17 +376,17 @@ return SCPE_OK;
else if (paper)
davfu_action;
else print_xlate;
}
}
else if (paper) {
if (xlate || delim || delim_hold)
davfu_action;
else print_input;
}
}
else {
if (xlate || delim || delim_hold)
print_xlate;
else print_input;
}
}
*/
t_stat lp20_svc (UNIT *uptr)
@@ -657,6 +659,10 @@ t_stat lp20_attach (UNIT *uptr, char *cptr)
t_stat reason;
reason = attach_unit (uptr, cptr); /* attach file */
if (reason == SCPE_OK) {
sim_fseek (uptr->fileref, 0, SEEK_END);
uptr->pos = sim_ftell (uptr->fileref);
}
if (lpcsa & CSA_ONL) /* just file chg? */
return reason;
if (sim_is_active (&lp20_unit)) /* busy? no int */

View File

@@ -56,7 +56,7 @@ extern DEVICE ry_dev;
extern DEVICE cr_dev;
extern DEVICE lp20_dev;
extern DEVICE kmc_dev;
extern DEVICE dup_dev[];
extern DEVICE dup_dev;
extern UNIT cpu_unit;
extern REG cpu_reg[];
extern d10 *M;
@@ -92,9 +92,8 @@ DEVICE *sim_devices[] = {
&rp_dev,
&tu_dev,
&dz_dev,
&kmc_dev,
&dup_dev[0],
&dup_dev[1],
&kmc_dev,
&dup_dev,
NULL
};

View File

@@ -1,6 +1,6 @@
/* pdp11_cpu.c: PDP-11 CPU simulator
Copyright (c) 1993-2012, Robert M Supnik
Copyright (c) 1993-2013, 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"),
@@ -25,6 +25,7 @@
cpu PDP-11 CPU
10-Apr-13 RMS MMR1 does not track PC changes (Johnny Billquist)
29-Apr-12 RMS Fixed compiler warning (Mark Pizzolato)
19-Mar-12 RMS Fixed declaration of sim_switches (Mark Pizzolato)
29-Dec-08 RMS Fixed failure to clear cpu_bme on RESET (Walter Mueller)
@@ -689,7 +690,8 @@ if (abortval != 0) {
if ((trapea > 0) && stop_vecabort)
reason = STOP_VECABORT;
if ((trapea < 0) && /* stack push abort? */
(CPUT (STOP_STKA) || stop_spabort)) reason = STOP_SPABORT;
(CPUT (STOP_STKA) || stop_spabort))
reason = STOP_SPABORT;
if (trapea == ~MD_KER) { /* kernel stk abort? */
setTRAP (TRAP_RED);
setCPUERR (CPUE_RED);
@@ -715,7 +717,7 @@ while (reason == 0) {
cpu_astop = 0;
reason = SCPE_STOP;
break;
}
}
AIO_CHECK_EVENT;
if (sim_interval <= 0) { /* intv cnt expired? */
@@ -809,7 +811,7 @@ while (reason == 0) {
if (sim_brk_summ && sim_brk_test (PC, SWMASK ('E'))) { /* breakpoint? */
reason = STOP_IBKPT; /* stop simulation */
continue;
}
}
if (update_MM) { /* if mm not frozen */
MMR1 = 0;
@@ -907,7 +909,8 @@ while (reason == 0) {
trap_req = calc_ints (ipl, trap_req);
JMP_PC (src);
if (CPUT (HAS_RTT) && tbit && /* RTT impl? */
(IR == 000002)) setTRAP (TRAP_TRC); /* RTI immed trap */
(IR == 000002))
setTRAP (TRAP_TRC); /* RTI immed trap */
break;
case 7: /* MFPT */
if (CPUT (HAS_MFPT)) /* implemented? */
@@ -1352,7 +1355,8 @@ while (reason == 0) {
}
else {
dst = srcreg? R[srcspec]: ReadW (GeteaW (srcspec));
if (!dstreg) ea = GeteaW (dstspec);
if (!dstreg)
ea = GeteaW (dstspec);
}
N = GET_SIGN_W (dst);
Z = GET_Z (dst);
@@ -1888,6 +1892,7 @@ while (reason == 0) {
R[dstspec] = (R[dstspec] & 0177400) | dst;
else PWriteB (dst, last_pa);
break;
/* Notes:
- MTPS cannot alter the T bit
- MxPD must mask GeteaW returned address, dspace is from cm not pm
@@ -1981,7 +1986,8 @@ while (reason == 0) {
}
else {
dst = srcreg? R[srcspec] & 0377: ReadB (GeteaB (srcspec));
if (!dstreg) ea = GeteaB (dstspec);
if (!dstreg)
ea = GeteaB (dstspec);
}
N = GET_SIGN_B (dst);
Z = GET_Z (dst);
@@ -2161,20 +2167,20 @@ switch (spec >> 3) { /* decode spec<5:3> */
case 2: /* (R)+ */
R[reg] = ((adr = R[reg]) + 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (020 | reg);
return (adr | ds);
case 3: /* @(R)+ */
R[reg] = ((adr = R[reg]) + 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (020 | reg);
adr = ReadW (adr | ds);
return (adr | dsenable);
case 4: /* -(R) */
adr = R[reg] = (R[reg] - 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (0360 | reg);
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);
@@ -2182,7 +2188,7 @@ switch (spec >> 3) { /* decode spec<5:3> */
case 5: /* @-(R) */
adr = R[reg] = (R[reg] - 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (0360 | reg);
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);
@@ -2219,13 +2225,13 @@ switch (spec >> 3) { /* decode spec<5:3> */
case 2: /* (R)+ */
delta = 1 + (reg >= 6); /* 2 if R6, PC */
R[reg] = ((adr = R[reg]) + delta) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 ((delta << 3) | reg);
return (adr | ds);
case 3: /* @(R)+ */
R[reg] = ((adr = R[reg]) + 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (020 | reg);
adr = ReadW (adr | ds);
return (adr | dsenable);
@@ -2233,7 +2239,7 @@ switch (spec >> 3) { /* decode spec<5:3> */
case 4: /* -(R) */
delta = 1 + (reg >= 6); /* 2 if R6, PC */
adr = R[reg] = (R[reg] - delta) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 ((((-delta) & 037) << 3) | reg);
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);
@@ -2241,7 +2247,7 @@ switch (spec >> 3) { /* decode spec<5:3> */
case 5: /* @-(R) */
adr = R[reg] = (R[reg] - 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = calc_MMR1 (0360 | reg);
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);

145
PDP11/pdp11_ddcmp.h Normal file
View File

@@ -0,0 +1,145 @@
/* pdp11_ddcmp.h: Digital Data Communications Message Protocol support
Copyright (c) 2013, Mark Pizzolato
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.
Digital Data Communications Message Protocol - DDCMP support routines
29-May-13 MP Initial implementation
*/
#ifndef PDP11_DDCMP_H_
#define PDP11_DDCMP_H_ 0
/* DDCMP packet types */
#define DDCMP_SYN 0226u /* Sync character on synchronous links */
#define DDCMP_DEL 0377u /* Sync character on asynchronous links */
#define DDCMP_SOH 0201u /* Numbered Data Message Identifier */
#define DDCMP_ENQ 0005u /* Control Message Identifier */
#define DDCMP_DLE 0220u /* Maintenance Message Identifier */
/* Support routines */
/* crc16 polynomial x^16 + x^15 + x^2 + 1 (0xA001) CCITT LSB */
static uint16 crc16_nibble[16] = {
0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400,
};
static uint16 ddcmp_crc16(uint16 crc, const void* vbuf, size_t len)
{
const unsigned char* buf = (const unsigned char*)vbuf;
while(0 != len--) {
crc = (crc>>4) ^ crc16_nibble[(*buf ^ crc) & 0xF];
crc = (crc>>4) ^ crc16_nibble[((*buf++)>>4 ^ crc) & 0xF];
};
return(crc);
}
/* Debug routines */
#include <ctype.h>
static void ddcmp_packet_trace (uint32 reason, DEVICE *dptr, const char *txt, const uint8 *msg, int32 len, t_bool detail)
{
if (sim_deb && dptr && (reason & dptr->dctrl)) {
sim_debug(reason, dptr, "%s len: %d\n", txt, len);
if (detail) {
int i, same, group, sidx, oidx;
char outbuf[80], strbuf[18];
static char hex[] = "0123456789ABCDEF";
switch (msg[0]) {
case DDCMP_SOH: /* Data Message */
sim_debug (reason, dptr, "Data Message, Link: %d, Count: %d, Resp: %d, Num: %d, HDRCRC: %s, DATACRC: %s\n", msg[2]>>6, ((msg[2] & 0x3F) << 8)|msg[1], msg[3], msg[4],
(0 == ddcmp_crc16 (0, msg, 8)) ? "OK" : "BAD", (0 == ddcmp_crc16 (0, msg+8, 2+(((msg[2] & 0x3F) << 8)|msg[1]))) ? "OK" : "BAD");
break;
case DDCMP_ENQ: /* Control Message */
sim_debug (reason, dptr, "Control: Type: %d ", msg[1]);
switch (msg[1]) {
case 1: /* ACK */
sim_debug (reason, dptr, "(ACK) ACKSUB: %d, Link: %d, Resp: %d\n", msg[2] & 0x3F, msg[2]>>6, msg[3]);
break;
case 2: /* NAK */
sim_debug (reason, dptr, "(NAK) Reason: %d, Link: %d, Resp: %d\n", msg[2] & 0x3F, msg[2]>>6, msg[3]);
break;
case 3: /* REP */
sim_debug (reason, dptr, "(REP) REPSUB: %d, Link: %d, Num: %d\n", msg[2] & 0x3F, msg[2]>>6, msg[4]);
break;
case 6: /* STRT */
sim_debug (reason, dptr, "(STRT) STRTSUB: %d, Link: %d\n", msg[2] & 0x3F, msg[2]>>6);
break;
case 7: /* STACK */
sim_debug (reason, dptr, "(STACK) STCKSUB: %d, Link: %d\n", msg[2] & 0x3F, msg[2]>>6);
break;
default: /* Unknown */
sim_debug (reason, dptr, "(Unknown=0%o)\n", msg[1]);
break;
}
if (len != 8) {
sim_debug (reason, dptr, "Unexpected Control Message Length: %d expected 8\n", len);
}
if (0 != ddcmp_crc16 (0, msg, len)) {
sim_debug (reason, dptr, "Unexpected Message CRC\n");
}
break;
case DDCMP_DLE: /* Maintenance Message */
sim_debug (reason, dptr, "Maintenance Message, Link: %d, Count: %d, HDRCRC: %s, DATACRC: %s\n", msg[2]>>6, ((msg[2] & 0x3F) << 8)| msg[1],
(0 == ddcmp_crc16 (0, msg, 8)) ? "OK" : "BAD", (0 == ddcmp_crc16 (0, msg+8, 2+(((msg[2] & 0x3F) << 8)| msg[1]))) ? "OK" : "BAD");
break;
}
for (i=same=0; i<len; i += 16) {
if ((i > 0) && (0 == memcmp(&msg[i], &msg[i-16], 16))) {
++same;
continue;
}
if (same > 0) {
sim_debug(reason, dptr, "%04X thru %04X same as above\n", i-(16*same), i-1);
same = 0;
}
group = (((len - i) > 16) ? 16 : (len - i));
for (sidx=oidx=0; sidx<group; ++sidx) {
outbuf[oidx++] = ' ';
outbuf[oidx++] = hex[(msg[i+sidx]>>4)&0xf];
outbuf[oidx++] = hex[msg[i+sidx]&0xf];
if (isprint(msg[i+sidx]))
strbuf[sidx] = msg[i+sidx];
else
strbuf[sidx] = '.';
}
outbuf[oidx] = '\0';
strbuf[sidx] = '\0';
sim_debug(reason, dptr, "%04X%-48s %s\n", i, outbuf, strbuf);
}
if (same > 0) {
sim_debug(reason, dptr, "%04X thru %04X same as above\n", i-(16*same), len-1);
}
}
}
}
uint16 ddcmp_crc16(uint16 crc, const void* vbuf, size_t len);
#endif /* PDP11_DDCMP_H_ */

View File

@@ -482,6 +482,7 @@ typedef struct {
#define VH_MUXES 4 /* max # of VH muxes */
#define DLX_LINES 16 /* max # of KL11/DL11's */
#define DCX_LINES 16 /* max # of DC11's */
#define DUP_LINES 8 /* max # of DUP11/DPV11's */
#define MT_MAXFR (1 << 16) /* magtape max rec */
#define AUTO_LNT 34 /* autoconfig ranks */
#define DIB_MAX 100 /* max DIBs */
@@ -601,6 +602,8 @@ typedef struct pdp_dib DIB;
#define INT_V_DMCTX 19
#define INT_V_KMCA 20
#define INT_V_KMCB 21
#define INT_V_DUPRX 20
#define INT_V_DUPTX 21
#define INT_V_PIR4 0 /* BR4 */
#define INT_V_TTI 1
@@ -648,6 +651,8 @@ typedef struct pdp_dib DIB;
#define INT_DMCTX (1u << INT_V_DMCTX)
#define INT_KMCA (1u << INT_V_KMCA)
#define INT_KMCB (1u << INT_V_KMCB)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define INT_PIR4 (1u << INT_V_PIR4)
#define INT_TTI (1u << INT_V_TTI)
#define INT_TTO (1u << INT_V_TTO)
@@ -698,6 +703,8 @@ typedef struct pdp_dib DIB;
#define IPL_DMCTX 5
#define IPL_KMCA 5
#define IPL_KMCB 5
#define IPL_DUPRX 5
#define IPL_DUPTX 5
#define IPL_PTR 4
#define IPL_PTP 4
#define IPL_TTI 4

1174
PDP11/pdp11_dup.c Normal file

File diff suppressed because it is too large Load Diff

50
PDP11/pdp11_dup.h Normal file
View File

@@ -0,0 +1,50 @@
/* pdp11_dup.h: PDP-11 DUP11 bit synchronous shared device packet interface interface
Copyright (c) 2013, Mark Pizzolato
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.
dup DUP11 Unibus/DPV11 Qbus bit synchronous interface
This module describes the interfaces exposed by the dup device for use by
a packet delivery devices (i.e. KMC11).
31-May-13 MP Initial implementation
*/
#ifndef PDP11_DUP_H_
#define PDP11_DUP_H_ 0
typedef void (*PACKET_RECEIVE_CALLBACK)(int32 dup, uint8 *buf, size_t len);
typedef void (*PACKET_TRANSMIT_COMPLETE_CALLBACK)(int32 dup, int status);
int32 dup_get_line_speed (int32 dup);
int32 dup_get_DCD (int32 dup);
t_stat dup_set_DTR (int32 dup, t_bool state);
t_stat dup_set_DDCMP (int32 dup, t_bool state);
int32 dup_csr_to_linenum (int32 CSRPA);
void dup_set_callback_mode (int32 dup, PACKET_RECEIVE_CALLBACK receive, PACKET_TRANSMIT_COMPLETE_CALLBACK transmit);
t_bool dup_put_msg_bytes (int32 dup, uint8 *bytes, size_t len, t_bool start, t_bool end);
#endif /* PDP11_DUP_H_ */

View File

@@ -1,6 +1,6 @@
/* pdp11_fp.c: PDP-11 floating point simulator (32b version)
Copyright (c) 1993-2008, Robert M Supnik
Copyright (c) 1993-2013, 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"),
@@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
20-Apr-13 RMS MMR1 does not track PC changes (Johnny Billquist)
22-Sep-05 RMS Fixed declarations (Sterling Garwood)
04-Oct-04 RMS Added FIS instructions
19-Jan-03 RMS Changed mode definitions for Apple Dev Kit conflict
@@ -584,20 +585,20 @@ switch (spec >> 3) { /* case on spec */
if (reg == 7)
len = 2;
R[reg] = ((adr = R[reg]) + len) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = (len << 3) | reg;
return (adr | ds);
case 3: /* @(R)+ */
R[reg] = ((adr = R[reg]) + 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = 020 | reg;
adr = ReadW (adr | ds);
return (adr | dsenable);
case 4: /* -(R) */
adr = R[reg] = (R[reg] - len) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = (((-len) & 037) << 3) | reg;
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);
@@ -605,7 +606,7 @@ switch (spec >> 3) { /* case on spec */
case 5: /* @-(R) */
adr = R[reg] = (R[reg] - 2) & 0177777;
if (update_MM)
if (update_MM && (reg != 7))
MMR1 = 0360 | reg;
if ((reg == 6) && (cm == MD_KER) && (adr < (STKLIM + STKL_Y)))
set_stack_trap (adr);

View File

@@ -440,7 +440,7 @@ AUTO_CON auto_tab[] = {/*c #v am vm fxa fxv */
{ { NULL }, 1, 2, 0, 8,
{012400} }, /* KW11W */
{ { NULL }, 1, 2, 8, 8 }, /* DU11 */
{ { "DUP0", "DUP1" },1, 2, 8, 8 }, /* DUP11 */
{ { "DUP" }, 1, 2, 8, 8 }, /* DUP11 */
{ { NULL }, 1, 3, 0, 8,
{015000, 015040, 015100, 015140, }}, /* DV11 */
{ { NULL }, 1, 2, 8, 8 }, /* LK11A */
@@ -468,7 +468,7 @@ AUTO_CON auto_tab[] = {/*c #v am vm fxa fxv */
{ { NULL }, 1, 1, 8, 4,
{012410, 012410}, {0124} }, /* DR11B - fx CSRs,vec */
{ { "DMP" }, 1, 2, 8, 8 }, /* DMP11 */
{ { NULL }, 1, 2, 8, 8 }, /* DPV11 */
{ { "DPV" }, 1, 2, 8, 8 }, /* DPV11 */
{ { NULL }, 1, 2, 8, 8 }, /* ISB11 */
{ { NULL }, 1, 2, 16, 8 }, /* DMV11 */
{ { "XU", "XUB" }, 1, 1, 8, 4,

View File

@@ -103,8 +103,9 @@ extern DEVICE xu_dev, xub_dev;
extern DEVICE ke_dev;
extern DEVICE kg_dev;
extern DEVICE dmc_dev[];
extern DEVICE dup_dev;
extern DEVICE dpv_dev;
extern DEVICE kmc_dev;
extern DEVICE dup_dev[];
extern UNIT cpu_unit;
extern REG cpu_reg[];
extern uint16 *M;
@@ -169,13 +170,13 @@ DEVICE *sim_devices[] = {
&xub_dev,
&ke_dev,
&kg_dev,
&dmc_dev[0],
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&dmc_dev[0],
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&kmc_dev,
&dup_dev[0],
&dup_dev[1],
&dup_dev,
&dpv_dev,
NULL
};

View File

@@ -35,6 +35,8 @@ A subset of normal simh commands are available for use in remote console session
The Single Command Mode commands are: ATTACH, DETACH, PWD, SHOW, DIR, LS, ECHO, HELP
The Multiple Command Mode commands are: EXAMINE, IEXAMINE, DEPOSIT, EVALUATE, ATTACH, DETACH, ASSIGN, DEASSIGN, STEP, CONTINUE, PWD, SAVE, SET, SHOW, DIR, LS, ECHO, HELP
A remote console session will close when an EOF character is entered (i.e. ^D or ^Z).
#### VAX/PDP11 Enhancements
RQ has new disk types: RC25, RCF25, RA80
RQ device has a settable controller type (RQDX3, UDA50, KLESI, RUX50)
@@ -276,15 +278,15 @@ See the 0readme_ethernet.txt file for details about the required network compone
Compiling on windows is supported with recent versions of Microsoft Visual Studio (Standard or Express) and using GCC via the MinGW environment. Things may also work under Cygwin, but that is not the preferred windows environment. Not all features will be available as well as with either Visual Studio or MinGW.
##### Required related files. The file https://github.com/simh/simh/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt
##### Required related files. The file https://github.com/simh/simh/blob/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt
##### Visual Studio (Standard or Express) 2008, 2010 or 2012
The file https://github.com/simh/simh/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt describes the required steps to use the setup your environment to build using Visual Studio.
The file https://github.com/simh/simh/blob/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt describes the required steps to use the setup your environment to build using Visual Studio.
##### MinGW
The file https://github.com/simh/simh/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt describes the required steps to use the setup your environment to build using MinGW.
The file https://github.com/simh/simh/blob/master/Visual%20Studio%20Projects/0ReadMe_Projects.txt describes the required steps to use the setup your environment to build using MinGW.
#### VMS

View File

@@ -205,6 +205,7 @@ extern t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc);
#define VH_MUXES 4 /* max # of DHQ muxes */
#define DLX_LINES 16 /* max # of KL11/DL11's */
#define DCX_LINES 16 /* max # of DC11's */
#define DUP_LINES 8 /* max # of DUP11's */
#define MT_MAXFR (1 << 16) /* magtape max rec */
#define DEV_V_UBUS (DEV_V_UF + 0) /* Unibus */
@@ -256,6 +257,8 @@ typedef struct {
#define INT_V_XU 9
#define INT_V_DMCRX 10
#define INT_V_DMCTX 11
#define INT_V_DUPRX 12
#define INT_V_DUPTX 13
#define INT_V_LPT 0 /* BR4 */
#define INT_V_PTR 1
@@ -282,6 +285,8 @@ typedef struct {
#define INT_CR (1u << INT_V_CR)
#define INT_DMCRX (1u << INT_V_DMCRX)
#define INT_DMCTX (1u << INT_V_DMCTX)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define IPL_DZRX (0x15 - IPL_HMIN)
#define IPL_DZTX (0x15 - IPL_HMIN)
@@ -301,6 +306,8 @@ typedef struct {
#define IPL_VHTX (0x14 - IPL_HMIN)
#define IPL_DMCRX (0x15 - IPL_HMIN)
#define IPL_DMCTX (0x15 - IPL_HMIN)
#define IPL_DUPRX (0x15 - IPL_HMIN)
#define IPL_DUPTX (0x15 - IPL_HMIN)
/* Device vectors */

View File

@@ -53,6 +53,7 @@ extern DEVICE dz_dev;
extern DEVICE vh_dev;
extern DEVICE xu_dev, xub_dev;
extern DEVICE dmc_dev[];
extern DEVICE dup_dev;
extern UNIT cpu_unit;
extern void WriteB (uint32 pa, int32 val);
@@ -88,6 +89,7 @@ DEVICE *sim_devices[] = {
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&dup_dev,
NULL
};

View File

@@ -295,6 +295,8 @@ typedef struct {
#define INT_V_XU 8
#define INT_V_DMCRX 9
#define INT_V_DMCTX 10
#define INT_V_DUPRX 11
#define INT_V_DUPTX 12
#define INT_V_LPT 0 /* BR4 */
#define INT_V_PTR 1
@@ -320,6 +322,8 @@ typedef struct {
#define INT_CR (1u << INT_V_CR)
#define INT_DMCRX (1u << INT_V_DMCRX)
#define INT_DMCTX (1u << INT_V_DMCTX)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define IPL_DZRX (0x15 - IPL_HMIN)
#define IPL_DZTX (0x15 - IPL_HMIN)
@@ -338,6 +342,8 @@ typedef struct {
#define IPL_VHTX (0x14 - IPL_HMIN)
#define IPL_DMCRX (0x15 - IPL_HMIN)
#define IPL_DMCTX (0x15 - IPL_HMIN)
#define IPL_DUPRX (0x15 - IPL_HMIN)
#define IPL_DUPTX (0x15 - IPL_HMIN)
/* Device vectors */

View File

@@ -55,6 +55,7 @@ extern DEVICE dz_dev;
extern DEVICE vh_dev;
extern DEVICE xu_dev, xub_dev;
extern DEVICE dmc_dev[];
extern DEVICE dup_dev;
extern UNIT cpu_unit;
extern void WriteB (uint32 pa, int32 val);
@@ -93,6 +94,7 @@ DEVICE *sim_devices[] = {
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&dup_dev,
NULL
};

View File

@@ -247,6 +247,7 @@ extern t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc);
#define VH_MUXES 4 /* max # of DHU muxes */
#define DLX_LINES 16 /* max # of KL11/DL11's */
#define DCX_LINES 16 /* max # of DC11's */
#define DUP_LINES 8 /* max # of DUP11's */
#define MT_MAXFR (1 << 16) /* magtape max rec */
#define DEV_V_UBUS (DEV_V_UF + 0) /* Unibus */
@@ -306,6 +307,8 @@ typedef struct {
#define INT_V_XU 8
#define INT_V_DMCRX 9
#define INT_V_DMCTX 10
#define INT_V_DUPRX 11
#define INT_V_DUPTX 12
#define INT_V_LPT 0 /* BR4 */
#define INT_V_PTR 1
@@ -331,6 +334,8 @@ typedef struct {
#define INT_CR (1u << INT_V_CR)
#define INT_DMCRX (1u << INT_V_DMCRX)
#define INT_DMCTX (1u << INT_V_DMCTX)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define IPL_DZRX (0x15 - IPL_HMIN)
#define IPL_DZTX (0x15 - IPL_HMIN)
@@ -349,6 +354,8 @@ typedef struct {
#define IPL_VHTX (0x14 - IPL_HMIN)
#define IPL_DMCRX (0x15 - IPL_HMIN)
#define IPL_DMCTX (0x15 - IPL_HMIN)
#define IPL_DUPRX (0x15 - IPL_HMIN)
#define IPL_DUPTX (0x15 - IPL_HMIN)
/* Device vectors */

View File

@@ -55,6 +55,7 @@ extern DEVICE dz_dev;
extern DEVICE vh_dev;
extern DEVICE xu_dev, xub_dev;
extern DEVICE dmc_dev[];
extern DEVICE dup_dev;
extern UNIT cpu_unit;
extern void WriteB (uint32 pa, int32 val);
@@ -95,6 +96,7 @@ DEVICE *sim_devices[] = {
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&dup_dev,
NULL
};

View File

@@ -342,6 +342,9 @@ typedef struct {
#define INT_V_XU 8
#define INT_V_DMCRX 9
#define INT_V_DMCTX 10
#define INT_V_DUPRX 11
#define INT_V_DUPTX 12
#define INT_V_LPT 0 /* BR4 */
#define INT_V_PTR 1
#define INT_V_PTP 2
@@ -366,6 +369,9 @@ typedef struct {
#define INT_CR (1u << INT_V_CR)
#define INT_DMCRX (1u << INT_V_DMCRX)
#define INT_DMCTX (1u << INT_V_DMCTX)
#define INT_DUPRX (1u << INT_V_DUPRX)
#define INT_DUPTX (1u << INT_V_DUPTX)
#define IPL_DZRX (0x15 - IPL_HMIN)
#define IPL_DZTX (0x15 - IPL_HMIN)
#define IPL_HK (0x15 - IPL_HMIN)
@@ -383,6 +389,8 @@ typedef struct {
#define IPL_VHTX (0x14 - IPL_HMIN)
#define IPL_DMCRX (0x15 - IPL_HMIN)
#define IPL_DMCTX (0x15 - IPL_HMIN)
#define IPL_DUPRX (0x15 - IPL_HMIN)
#define IPL_DUPTX (0x15 - IPL_HMIN)
/* Device vectors */

View File

@@ -55,6 +55,7 @@ extern DEVICE dz_dev;
extern DEVICE vh_dev;
extern DEVICE xu_dev, xub_dev;
extern DEVICE dmc_dev[];
extern DEVICE dup_dev;
extern UNIT cpu_unit;
extern void WriteB (uint32 pa, int32 val);
@@ -93,6 +94,7 @@ DEVICE *sim_devices[] = {
&dmc_dev[1],
&dmc_dev[2],
&dmc_dev[3],
&dup_dev,
NULL
};

View File

@@ -23,18 +23,29 @@ The contents of the windows-build directory can be downloaded from:
https://github.com/simh/windows-build/archive/windows-build.zip
Download and extract the contents of this zip file into the appropriate
place in your directory structure. You do not need to do anything else
but have this directory properly located.
Network devices are capable of using pthreads to enhance their performance.
To realize these benefits, you must build the desire simulator with
USE_READER_THREAD defined. The relevant simulators which have network
support are VAX, VAX780 and PDP11.
support are all of the VAX simulators and the PDP11 simulator.
Additionally, simulators which contain devices which use the asynchronous
APIs in sim_disk.c and sim_tape.c can also achieve greater performance by
leveraging pthreads to perform blocking I/O in separate threads. Currently
the simulators which have such devices are VAX, VAX780 and PDP11. To
achieve these benefits the simulators must be built with SIM_ASYNCH_IO
defined.
the simulators which have such devices are all of the VAX simulators and
the PDP11. To achieve these benefits the simulators must be built with
SIM_ASYNCH_IO defined.
The project files in this directory build these simulators with support for
both network and asynchronous I/O.
To build any of the supported simulators you should open the simh.sln file
in this directory.
If you are using a version of Visual Studio beyond Visual Studio 2008, then
your later version of Visual Studio will automatically convert the Visual
Studio 2008 project fils. You should ignore any warnings produced by the
conversion process.

View File

@@ -239,6 +239,10 @@
RelativePath="..\PDP11\pdp11_cr.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -300,6 +304,10 @@
RelativePath="..\PDP10\pdp10_defs.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\scp.h"
>

View File

@@ -219,6 +219,10 @@
RelativePath="..\PDP11\pdp11_dmc.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -416,6 +420,10 @@
RelativePath="..\PDP11\pdp11_cr_dat.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_defs.h"
>

View File

@@ -206,6 +206,10 @@
RelativePath="..\PDP11\pdp11_dmc.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -379,6 +383,10 @@
RelativePath="..\dec_dz.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dmc.h"
>

View File

@@ -206,6 +206,10 @@
RelativePath="..\PDP11\pdp11_dmc.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -387,6 +391,10 @@
RelativePath="..\dec_dz.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dmc.h"
>

View File

@@ -209,6 +209,10 @@
RelativePath="..\PDP11\pdp11_dmc.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -399,6 +403,10 @@
RelativePath="..\PDP11\pdp11_cr_dat.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dmc.h"
>

View File

@@ -209,6 +209,10 @@
RelativePath="..\PDP11\pdp11_dmc.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dup.c"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dz.c"
>
@@ -391,6 +395,10 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc"
>
<File
RelativePath="..\PDP11\pdp11_ddcmp.h"
>
</File>
<File
RelativePath="..\PDP11\pdp11_dmc.h"
>

View File

@@ -534,7 +534,7 @@ PDP11_SOURCE1 = $(PDP11_DIR)PDP11_FP.C,$(PDP11_DIR)PDP11_CPU.C,\
$(PDP11_DIR)PDP11_SYS.C,$(PDP11_DIR)PDP11_TC.C, \
$(PDP11_DIR)PDP11_CPUMOD.C,$(PDP11_DIR)PDP11_CR.C,\
$(PDP11_DIR)PDP11_TA.C,$(PDP11_DIR)PDP11_DMC.C,\
$(PDP11_DIR)PDP11_IO_LIB.C
$(PDP11_DIR)PDP11_DUP.C,$(PDP11_DIR)PDP11_IO_LIB.C
PDP11_LIB2 = $(LIB_DIR)PDP11L2-$(ARCH).OLB
PDP11_SOURCE2 = $(PDP11_DIR)PDP11_TM.C,$(PDP11_DIR)PDP11_TS.C,\
$(PDP11_DIR)PDP11_IO.C,$(PDP11_DIR)PDP11_RQ.C,\
@@ -561,7 +561,8 @@ PDP10_SOURCE = $(PDP10_DIR)PDP10_FE.C,\
$(PDP10_DIR)PDP10_RP.C,$(PDP10_DIR)PDP10_SYS.C,\
$(PDP10_DIR)PDP10_TIM.C,$(PDP10_DIR)PDP10_TU.C,\
$(PDP11_DIR)PDP11_PT.C,$(PDP11_DIR)PDP11_DZ.C,\
$(PDP11_DIR)PDP11_RY.C,$(PDP11_DIR)PDP11_CR.C
$(PDP11_DIR)PDP11_RY.C,$(PDP11_DIR)PDP11_CR.C,\
$(PDP11_DIR)PDP11_DUP.C
PDP10_OPTIONS = /INCL=($(SIMH_DIR),$(PDP10_DIR),$(PDP11_DIR))\
/DEF=($(CC_DEFS),"USE_INT64=1","VM_PDP10=1"$(PCAP_DEFS))
@@ -749,7 +750,7 @@ VAX730_SOURCE2 = $(PDP11_DIR)PDP11_RL.C,$(PDP11_DIR)PDP11_RQ.C,\
$(PDP11_DIR)PDP11_XU.C,$(PDP11_DIR)PDP11_RY.C,\
$(PDP11_DIR)PDP11_CR.C,$(PDP11_DIR)PDP11_HK.C,\
$(PDP11_DIR)PDP11_VH.C,$(PDP11_DIR)PDP11_DMC.C,\
$(PDP11_DIR)PDP11_IO_LIB.C
$(PDP11_DIR)PDP11_DUP.C,$(PDP11_DIR)PDP11_IO_LIB.C
.IFDEF ALPHA_OR_IA64
VAX730_OPTIONS = /INCL=($(SIMH_DIR),$(VAX730_DIR),$(PDP11_DIR)$(PCAP_INC))\
/DEF=($(CC_DEFS),"VM_VAX=1","USE_ADDR64=1","USE_INT64=1"$(PCAP_DEFS),"VAX_730=1")
@@ -780,7 +781,7 @@ VAX750_SOURCE2 = $(PDP11_DIR)PDP11_RL.C,$(PDP11_DIR)PDP11_RQ.C,\
$(PDP11_DIR)PDP11_CR.C,$(PDP11_DIR)PDP11_HK.C,\
$(PDP11_DIR)PDP11_RP.C,$(PDP11_DIR)PDP11_TU.C,\
$(PDP11_DIR)PDP11_VH.C,$(PDP11_DIR)PDP11_DMC.C,\
$(PDP11_DIR)PDP11_IO_LIB.C
$(PDP11_DIR)PDP11_DUP.C,$(PDP11_DIR)PDP11_IO_LIB.C
.IFDEF ALPHA_OR_IA64
VAX750_OPTIONS = /INCL=($(SIMH_DIR),$(VAX750_DIR),$(PDP11_DIR)$(PCAP_INC))\
/DEF=($(CC_DEFS),"VM_VAX=1","USE_ADDR64=1","USE_INT64=1"$(PCAP_DEFS),"VAX_750=1")
@@ -811,7 +812,7 @@ VAX780_SOURCE2 = $(PDP11_DIR)PDP11_RL.C,$(PDP11_DIR)PDP11_RQ.C,\
$(PDP11_DIR)PDP11_CR.C,$(PDP11_DIR)PDP11_RP.C,\
$(PDP11_DIR)PDP11_TU.C,$(PDP11_DIR)PDP11_HK.C,\
$(PDP11_DIR)PDP11_VH.C,$(PDP11_DIR)PDP11_DMC.C,\
$(PDP11_DIR)PDP11_IO_LIB.C
$(PDP11_DIR)PDP11_DUP.C,$(PDP11_DIR)PDP11_IO_LIB.C
.IFDEF ALPHA_OR_IA64
VAX780_OPTIONS = /INCL=($(SIMH_DIR),$(VAX780_DIR),$(PDP11_DIR)$(PCAP_INC))\
/DEF=($(CC_DEFS),"VM_VAX=1","USE_ADDR64=1","USE_INT64=1"$(PCAP_DEFS),"VAX_780=1")
@@ -842,7 +843,7 @@ VAX8600_SOURCE2 = $(PDP11_DIR)PDP11_RL.C,$(PDP11_DIR)PDP11_RQ.C,\
$(PDP11_DIR)PDP11_CR.C,$(PDP11_DIR)PDP11_RP.C,\
$(PDP11_DIR)PDP11_TU.C,$(PDP11_DIR)PDP11_HK.C,\
$(PDP11_DIR)PDP11_VH.C,$(PDP11_DIR)PDP11_DMC.C,\
$(PDP11_DIR)PDP11_IO_LIB.C
$(PDP11_DIR)PDP11_DUP.C,$(PDP11_DIR)PDP11_IO_LIB.C
.IFDEF ALPHA_OR_IA64
VAX8600_OPTIONS = /INCL=($(SIMH_DIR),$(VAX8600_DIR),$(PDP11_DIR)$(PCAP_INC))\
/DEF=($(CC_DEFS),"VM_VAX=1","USE_ADDR64=1","USE_INT64=1"$(PCAP_DEFS),"VAX_860=1")

Binary file not shown.

View File

@@ -399,7 +399,11 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifneq (,$(call find_include,libvdeplug))
# Provide support for vde networking
NETWORK_CCDEFS += -DUSE_VDE_NETWORK
NETWORK_LDFLAGS += -lvdeplug -Wl,-R,$(dir $(call find_lib,vdeplug)) -L$(dir $(call find_lib,vdeplug))
ifeq (Darwin,$(OSTYPE))
NETWORK_LDFLAGS += -lvdeplug -L$(dir $(call find_lib,vdeplug))
else
NETWORK_LDFLAGS += -lvdeplug -Wl,-R,$(dir $(call find_lib,vdeplug)) -L$(dir $(call find_lib,vdeplug))
endif
$(info using libvdeplug: $(call find_lib,vdeplug) $(call find_include,libvdeplug))
endif
endif
@@ -661,7 +665,7 @@ PDP11 = ${PDP11D}/pdp11_fp.c ${PDP11D}/pdp11_cpu.c ${PDP11D}/pdp11_dz.c \
${PDP11D}/pdp11_cr.c ${PDP11D}/pdp11_rf.c ${PDP11D}/pdp11_dl.c \
${PDP11D}/pdp11_ta.c ${PDP11D}/pdp11_rc.c ${PDP11D}/pdp11_kg.c \
${PDP11D}/pdp11_ke.c ${PDP11D}/pdp11_dc.c ${PDP11D}/pdp11_dmc.c \
${PDP11D}/pdp11_io_lib.c
${PDP11D}/pdp11_dup.c ${PDP11D}/pdp11_io_lib.c
PDP11_OPT = -DVM_PDP11 -I ${PDP11D} ${NETWORK_OPT}
@@ -711,7 +715,7 @@ VAX730 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_hk.c ${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c \
${PDP11D}/pdp11_io_lib.c
${PDP11D}/pdp11_dup.c ${PDP11D}/pdp11_io_lib.c
VAX730_OPT = -DVM_VAX -DVAX_730 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
@@ -725,7 +729,8 @@ VAX750 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_hk.c ${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_io_lib.c
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX750_OPT = -DVM_VAX -DVAX_750 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
@@ -739,7 +744,8 @@ VAX780 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_hk.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_io_lib.c
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX780_OPT = -DVM_VAX -DVAX_780 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
@@ -753,7 +759,8 @@ VAX8600 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_hk.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_io_lib.c
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX8600_OPT = -DVM_VAX -DVAX_860 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
@@ -762,7 +769,8 @@ PDP10 = ${PDP10D}/pdp10_fe.c ${PDP11D}/pdp11_dz.c ${PDP10D}/pdp10_cpu.c \
${PDP10D}/pdp10_ksio.c ${PDP10D}/pdp10_lp20.c ${PDP10D}/pdp10_mdfp.c \
${PDP10D}/pdp10_pag.c ${PDP10D}/pdp10_rp.c ${PDP10D}/pdp10_sys.c \
${PDP10D}/pdp10_tim.c ${PDP10D}/pdp10_tu.c ${PDP10D}/pdp10_xtnd.c \
${PDP11D}/pdp11_pt.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c
${PDP11D}/pdp11_pt.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_dup.c
PDP10_OPT = -DVM_PDP10 -DUSE_INT64 -I ${PDP10D} -I ${PDP11D}

3
scp.c
View File

@@ -6431,8 +6431,9 @@ return 0;
double sim_gtime (void)
{
if (AIO_MAIN_THREAD)
if (AIO_MAIN_THREAD) {
UPDATE_SIM_TIME;
}
return sim_time;
}

View File

@@ -518,6 +518,7 @@ t_bool stepping = FALSE;
int32 steps = 1;
t_bool was_stepping = (sim_rem_step_line != -1);
t_bool got_command;
t_bool close_session = FALSE;
TMLN *lp;
char cbuf[4*CBUFSIZE], gbuf[CBUFSIZE], *cptr, *argv[1] = {NULL};
CTAB *cmdp;
@@ -535,15 +536,15 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
sim_rem_step_line = -1; /* Done with step */
stat = SCPE_STEP;
cmdp = find_cmd ("STEP");
stat_nomessage = stat & SCPE_NOMESSAGE; /* extract possible message supression flag */
stat = SCPE_BARE_STATUS(stat); /* remove possible flag */
if (!stat_nomessage) { /* displaying message status? */
stat_nomessage = stat & SCPE_NOMESSAGE; /* extract possible message supression flag */
stat = SCPE_BARE_STATUS(stat); /* remove possible flag */
if (!stat_nomessage) { /* displaying message status? */
fflush (sim_log);
cmd_log_start = sim_ftell (sim_log);
if (cmdp && (cmdp->message)) /* special message handler? */
cmdp->message (NULL, stat); /* let it deal with display */
if (cmdp && (cmdp->message)) /* special message handler? */
cmdp->message (NULL, stat); /* let it deal with display */
else
if (stat >= SCPE_BASE) { /* error? */
if (stat >= SCPE_BASE) { /* error? */
printf ("%s\r\n", sim_error_text (stat));
if (sim_log)
fprintf (sim_log, "%s\n", sim_error_text (stat));
@@ -579,6 +580,12 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
tmxr_linemsgf (lp, "Simulation will resume automatically if input is not received in %d seconds\n", sim_rem_read_timeout);
}
else {
if ((c == '\004') || (c == '\032')) { /* EOF character (^D or ^Z) ? */
tmxr_linemsgf (lp, "\r\nGoodbye\r\n");
tmxr_send_buffered_data (lp); /* flush any buffered data */
tmxr_reset_ln (lp);
continue;
}
sim_rem_single_mode[i] = TRUE;
tmxr_linemsgf (lp, "\r\n%s", sim_prompt);
tmxr_send_buffered_data (lp); /* flush any buffered data */
@@ -648,6 +655,23 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
sim_rem_buf[i][sim_rem_buf_ptr[i]++] = '\0';
got_command = TRUE;
break;
case '\004': /* EOF (^D) */
case '\032': /* EOF (^Z) */
while (sim_rem_buf_ptr[i] > 0) { /* Erase current input line */
tmxr_linemsg (lp, "\b \b");
--sim_rem_buf_ptr[i];
}
if (!sim_rem_single_mode[i]) {
if (sim_rem_buf_ptr[i]+80 >= sim_rem_buf_size[i]) {
sim_rem_buf_size[i] += 1024;
sim_rem_buf[i] = realloc (sim_rem_buf[i], sim_rem_buf_size[i]);
}
strcpy (sim_rem_buf[i], "CONTINUE ! Automatic continue before close");
tmxr_linemsgf (lp, "%s\n", sim_rem_buf[i]);
got_command = TRUE;
}
close_session = TRUE;
break;
default:
tmxr_putc_ln (lp, c);
if (sim_rem_buf_ptr[i]+2 >= sim_rem_buf_size[i]) {
@@ -662,8 +686,9 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
}
} while ((!got_command) && (!sim_rem_single_mode[i]));
tmxr_send_buffered_data (lp); /* flush any buffered data */
if ((sim_rem_single_mode[i]) && !got_command)
if ((sim_rem_single_mode[i]) && !got_command) {
break;
}
printf ("Remote Console Command from %s> %s\r\n", lp->ipad, sim_rem_buf[i]);
if (sim_log)
fprintf (sim_log, "Remote Console Command from %s> %s\n", lp->ipad, sim_rem_buf[i]);
@@ -679,13 +704,14 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
strcpy (cbuf, sim_rem_buf[i]);
sim_rem_buf_ptr[i] = 0;
sim_rem_buf[i][sim_rem_buf_ptr[i]] = '\0';
if (cbuf[0] == '\0')
if (cbuf[0] == '\0') {
if (sim_rem_single_mode[i]) {
sim_rem_single_mode[i] = FALSE;
break;
}
else
continue;
}
sim_sub_args (cbuf, sizeof(cbuf), argv);
cptr = cbuf;
cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */
@@ -790,6 +816,11 @@ for (i=(was_stepping ? sim_rem_step_line : 0);
break;
}
}
if (close_session) {
tmxr_linemsgf (lp, "\r\nGoodbye\r\n");
tmxr_send_buffered_data (lp); /* flush any buffered data */
tmxr_reset_ln (lp);
}
}
if (stepping)
sim_activate(uptr, steps); /* check again after 'steps' instructions */

View File

@@ -436,13 +436,15 @@ lp->tsta = 0; /* init telnet state */
lp->xmte = 1; /* enable transmit */
lp->dstb = 0; /* default bin mode */
lp->rxbpr = lp->rxbpi = lp->rxcnt = 0; /* init receive indexes */
if (!lp->txbfd) /* if not buffered */
if (!lp->txbfd || lp->notelnet) /* if not buffered telnet */
lp->txbpr = lp->txbpi = lp->txcnt = 0; /* init transmit indexes */
memset (lp->rbr, 0, sizeof(lp->rbr)); /* clear break status array */
lp->txdrp = 0;
if (lp->modem_control)
lp->modembits = TMXR_MDM_CTS | TMXR_MDM_DSR;
if (!lp->mp->buffered) {
if (lp->modem_control) {
lp->modembits &= ~TMXR_MDM_INCOMING;
lp->modembits |= TMXR_MDM_CTS | TMXR_MDM_DSR;
}
if ((!lp->mp->buffered) && (!lp->txbfd)) {
lp->txbfd = 0;
lp->txbsz = TMXR_MAXBUF;
lp->txb = (char *)realloc (lp->txb, lp->txbsz);
@@ -695,7 +697,7 @@ static char *growstring(char **string, size_t growth)
return *string + strlen(*string);
}
static char *_mux_attach_string(char *old, TMXR *mp)
static char *tmxr_mux_attach_string(char *old, TMXR *mp)
{
char* tptr = NULL;
int32 i;
@@ -767,6 +769,10 @@ if (lp->destination || lp->port || lp->txlogname) {
sprintf (growstring(&tptr, 32), "Line=%d", (int)(lp-lp->mp->ldsc));
if (lp->modem_control != lp->mp->modem_control)
sprintf (growstring(&tptr, 32), ",%s", lp->modem_control ? "Modem" : "NoModem");
if (lp->txbfd && (lp->txbsz != lp->mp->buffered))
sprintf (growstring(&tptr, 32), ",Buffered=%d", lp->txbsz);
if (!lp->txbfd && (lp->mp->buffered > 0))
sprintf (growstring(&tptr, 32), ",UnBuffered");
if (lp->destination) {
if (lp->serport) {
char portname[CBUFSIZE];
@@ -1091,7 +1097,7 @@ if ((lp->destination) && (!lp->serport)) {
tmxr_init_line (lp); /* initialize line state */
if (lp->mp->uptr) {
/* Revise the unit's connect string to reflect the current attachments */
lp->mp->uptr->filename = _mux_attach_string (lp->mp->uptr->filename, lp->mp);
lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp);
/* No connections or listeners exist, then we're equivalent to being fully detached. We should reflect that */
if (lp->mp->uptr->filename == NULL)
tmxr_detach (lp->mp, lp->mp->uptr);
@@ -1272,7 +1278,7 @@ else {
r = SCPE_OK;
}
if (r == SCPE_OK) /* Record port state for proper restore */
lp->mp->uptr->filename = _mux_attach_string (lp->mp->uptr->filename, lp->mp);
lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp);
return r;
}
@@ -1342,7 +1348,7 @@ for (i = 0; i < mp->lines; i++) { /* loop thru lines */
TMXR_MAXBUF - lp->rxbpi);
if (nbytes < 0) { /* line error? */
if (!lp->txbfd)
if (!lp->txbfd || lp->notelnet)
lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */
tmxr_close_ln (lp); /* disconnect line */
}
@@ -1493,8 +1499,8 @@ return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? TMXR_MAXBUF: 0));
t_stat tmxr_putc_ln (TMLN *lp, int32 chr)
{
if ((lp->conn == FALSE) && /* no conn & not buffered? */
(!lp->txbfd)) {
if ((lp->conn == FALSE) && /* no conn & not buffered telnet? */
(!lp->txbfd || lp->notelnet)) {
++lp->txdrp; /* lost */
return SCPE_LOST;
}
@@ -1506,8 +1512,8 @@ tmxr_debug_trace_line (lp, "tmxr_putc_ln()");
if (lp->txbpi == lp->txbpr) \
lp->txbpr = (1+lp->txbpr)%lp->txbsz, ++lp->txdrp; \
}
if ((lp->txbfd) || (TXBUF_AVAIL(lp) > 1)) { /* room for char (+ IAC)? */
if ((TN_IAC == (u_char) chr) && (!lp->notelnet)) /* char == IAC in telnet session? */
if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+ IAC)? */
if ((TN_IAC == (u_char) chr) && (!lp->notelnet)) /* char == IAC in telnet session? */
TXBUF_CHAR (lp, TN_IAC); /* stuff extra IAC char */
TXBUF_CHAR (lp, chr); /* buffer char & adv pointer */
if ((!lp->txbfd) && (TXBUF_AVAIL (lp) <= TMXR_GUARD))/* near full? */
@@ -1811,7 +1817,7 @@ while (*tptr) {
sim_close_sock (sock, 1);
strcpy(listen, port);
cptr = get_glyph (cptr, option, ';');
if (option[0])
if (option[0]) {
if (0 == MATCH_CMD (option, "NOTELNET"))
listennotelnet = TRUE;
else
@@ -1819,6 +1825,7 @@ while (*tptr) {
listennotelnet = FALSE;
else
return SCPE_ARG;
}
}
if (line == -1) {
if (modem_control != mp->modem_control)
@@ -2783,7 +2790,7 @@ r = tmxr_open_master (mp, cptr); /* open master socket */
if (r != SCPE_OK) /* error? */
return r;
mp->uptr = uptr; /* save unit for polling */
uptr->filename = _mux_attach_string (uptr->filename, mp);/* save */
uptr->filename = tmxr_mux_attach_string (uptr->filename, mp);/* save */
uptr->flags = uptr->flags | UNIT_ATT; /* no more errors */
if ((mp->lines > 1) ||
((mp->master == 0) &&
@@ -2828,9 +2835,12 @@ else {
for (i=0; i<tmxr_open_device_count; ++i) {
TMXR *mp = tmxr_open_devices[i];
TMLN *lp;
char *attach;
fprintf(st, "Multiplexer device: %s", mp->dptr->name);
fprintf(st, ", attached to %s, ", mp->uptr->filename);
fprintf(st, "Multiplexer device: %s, ", mp->dptr->name);
attach = tmxr_mux_attach_string (NULL, mp);
fprintf(st, "attached to %s, ", attach);
free (attach);
if (mp->lines > 1) {
tmxr_show_lines(st, NULL, 0, mp);
fprintf(st, ", ");
@@ -3427,7 +3437,7 @@ if (lp->txlog == NULL) { /* error? */
free (lp->txlogname); /* free buffer */
return SCPE_OPENERR;
}
lp->mp->uptr->filename = _mux_attach_string (lp->mp->uptr->filename, lp->mp);
lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp);
return SCPE_OK;
}
@@ -3450,7 +3460,7 @@ if (lp->txlog) { /* logging? */
lp->txlog = NULL;
lp->txlogname = NULL;
}
lp->mp->uptr->filename = _mux_attach_string (lp->mp->uptr->filename, lp->mp);
lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp);
return SCPE_OK;
}