Commit graph

2652 commits

Author SHA1 Message Date
Mark Pizzolato
1a7f8d4df0 VAX,PDP11,PDP10: Added explicit support to enable (or disable) DMR Micro Diagnostics which corresponds to the SW10 hardware switch.
Also, always process initialization commands without regard to whether the DMC/DMR line is attached and return diag error status if the line isn't attached.
2014-02-07 09:01:22 -08:00
Mark Pizzolato
afcbea251d SCP: Add SHOW -C BREAK to display the currently defined breakpoints as commands which can be used to redefine them later.
Note: This excludes the possibility of there being a -C breakpoint type.  Since there are potentially 26 different breakpoint types, this exclusion is not likely to have a significant impact.
2014-02-07 06:32:21 -08:00
Mark Pizzolato
cde0be5573 TMXR: Added support to reasonably set modem bits when a line has dedicated listen port defined or uses datagram transport. 2014-02-06 17:08:38 -08:00
Mark Pizzolato
ccabc026d5 PDP10: Added display support of PC value in debug messages. 2014-02-05 15:25:09 -08:00
Mark Pizzolato
8d09ebec8b Compiler indicated cleanups to Fix #105 2014-02-05 13:44:36 -08:00
Mark Pizzolato
c9e8121c16 PDP8: Add device buffer flush capability and keep track of data written state in the device buffer. Fixes #87 2014-02-05 10:30:22 -08:00
Mark Pizzolato
ffda4c1c41 VAX,PDP11: Fix behavior of simulator when multiple DMC devices are in use concurrently. Fix for issue #51.
The interrupt acknowledgment logic for the transmit interrupt inadvertently cleared the device interrupt pending flag even when other devices potentially had pending interrupts.

Added line specific indications in the debug output for packet trace debugging.
2014-02-05 08:20:43 -08:00
Mark Pizzolato
da134ebb2a SCP: Added detailed help (including switches) for SET DEBUG command and an auto flush of the debug output when instruction execution stops. 2014-02-04 15:45:26 -08:00
Mark Pizzolato
8cc3791e2a PDP11/VAX: Improved debug information to identify the distinct DMC line when multiple lines are in use and added detailed debug output for DDCMP state machine changes. 2014-02-04 14:45:05 -08:00
Mark Pizzolato
0e11dfea98 PDP11/VAX: Fix VH device to properly be displayed when the number of lines changes and to avoid problems in debug mode. 2014-02-04 11:29:25 -08:00
Mark Pizzolato
d0cee0f6b6 SWTP: Fixes to segfault issue described in #103 (from Gene Irwin)
The simulated memory address block from 0x8000 thru 0x8FFF is defined to have address 0x8000 - 0x801F mapped to I/O ports and 0x8020 - 0x8FFF as NO RAM ALLOWED.  Code has been added to behave reasonably when references are made to 0x8020 - 0x8FFF.
2014-02-01 08:12:19 -08:00
Mark Pizzolato
eaae19463c SCP: Initial merge of old style single line help with hierarchical help 2014-02-01 07:04:44 -08:00
Mark Pizzolato
235ffdb6f0 PDP10: Change default bus address and vector for DMR device to be what the TOPS-10 expects (address 764000 and vector 610) 2014-01-30 16:29:40 -08:00
Mark Pizzolato
8c2de7c5a9 SWTP: Added missing SWTP documentation files 2014-01-28 15:21:25 -08:00
Mark Pizzolato
4ec1f7ed2b PDP11: Fix to allow allow Q18 devices to be enabled on Qbus systems with memory <= 256KB. Reported by Christian Gauger-Cosgrove.
The devices which are affected by this are: RK, HK, RM and VT.
2014-01-26 18:09:06 -08:00
Mark Pizzolato
9ab6c4d1c1 SOCKET: Extended TMXR packet capabilities to disable the Nagle algorithm when TCP packets transports are used. 2014-01-23 09:31:05 -08:00
Mark Pizzolato
bebb787325 SCP: Fix problem on Windows which inhibited the ability to enter console input (^E) when bells characters were being output too often. Fixes #102 2014-01-23 09:21:07 -08:00
Mark Pizzolato
18451806b7 SCP: Added default simulator specific initialization file to be in the current working directory if one isn't found where the simulator binary is located (suggested by Jordi Guillaumes Pons in #101). 2014-01-23 05:15:54 -08:00
Mark Pizzolato
fcaced5393 GIT: Added ignore of OS/X DS_Store files and made line endings consistent (from Jordi Guillaumes Pons) 2014-01-23 05:11:18 -08:00
Mark Pizzolato
c64aabf51f SCP: Fix for %DATE_WW% and %DATE_WYYYY% computation on the first days of a year after a leap year. 2014-01-16 07:40:35 -08:00
Mark Pizzolato
8b9e33c3a3 MAKEFILE: Fix Linux build when pcap.h isn't available but SDL is. Fix for Issue #97 2014-01-16 06:17:45 -08:00
Mark Pizzolato
e1b0a416a9 SCP: Generalized DATE and TIME variable insertion adding support for ISO 8601 date values. Inspired by Christian Gauger-Cosgrove.
ISO 8601 support without requiring C99 strftime functionality.

          %DATE%                yyyy-mm-dd
          %TIME%                 hh:mm:ss
          %DATETIME%       yyyy-mm-ddThh:mm:ss
          %LDATE%               mm/dd/yy (Locale Formatted)
          %LTIME%               hh:mm:ss am/pm (Locale Formatted)
          %CTIME%               Www Mmm dd hh:mm:ss yyyy (Locale Formatted)
          %DATE_YYYY%     yyyy              (0000-9999)
          %DATE_YY%          yy                  (00-99)
          %DATE_MM%       mm               (01-12)
          %DATE_DD%         dd                  (01-31)
          %DATE_WW%       ww                 (01-53)     ISO 8601 week number
          %DATE_WYYYY%  yyyy              (0000-9999) ISO 8601 week year number
          %DATE_D%            d                    (1-7)       ISO 8601 day of week
          %DATE_JJJ%           jjj                   (001-366) day of year
          %TIME_HH%         hh                  (00-23)
          %TIME_MM%        mm               (00-59)
          %TIME_SS%            ss                  (00-59)
2014-01-11 11:13:25 -08:00
Mark Pizzolato
fd4a3acbad Avoid NULL pointer dereference when examining a device with no units. #95 2014-01-09 12:03:51 -08:00
Mark Pizzolato
b61e5ae176 Compiler indicated cleanups 2014-01-08 13:06:42 -08:00
Mark Pizzolato
2ea8a0a30f SCP: Changed command processing variable insertion to format %DATE% as yyyy-mm-dd instead of yyyy/mm/dd and added %STIME% to produce hh_mm_ss. 2014-01-08 12:47:33 -08:00
Mark Pizzolato
5800e5b403 Compiler indicated cleanup 2014-01-06 14:13:30 -08:00
Mark Pizzolato
0e753b7c45 Compiler indicated cleanups 2014-01-06 13:14:16 -08:00
Mark Pizzolato
76fc90f405 VMS: Update descrip.mms for recently added video and network device support 2014-01-06 13:13:18 -08:00
Mark Pizzolato
ae8bcecd29 I1620 : Changes from Bob Supnik re: Bob Armstrong has been running diagnostics and software, and these changes reflect fixes to bugs that were found.
We're not absolutely sure that all of the changes are correct - in particular the treatment of record marks in add/compare - but they do make the diagnostics pass, which they didn't before.

Bob asked for variable tab stops on the typewriter, and those are implemented as well. The routines were general enough that I put the SET/SHOW processors in sim_console.c, so I'm enclosing that and its header file.

Conflicts:
	I1620/i1620_cpu.c
	sim_console.c
	sim_console.h
2014-01-05 14:45:08 -08:00
Mark Pizzolato
c6eef85850 MAKE: Changed minimum version of gmake required before warning is issued from 3.81 to 3.80. 2014-01-02 16:06:12 -08:00
Mark Pizzolato
fdcbef3954 ETHER: Added support to build with more older versions of libpcap on some platforms. Removed support to use tcpdump.org's libpcap on Linux platforms. 2014-01-02 13:30:49 -08:00
Mark Pizzolato
028f152f6f SWTP: Fixed overflown bit logic for addition and subtraction (from Bill Beech) 2014-01-01 10:33:29 -08:00
Mark Pizzolato
1666cef8e3 ETHER: Fix mixed line endings which crept in while adding network support without any pcap components. 2013-12-30 09:19:55 -08:00
Mark Pizzolato
86e342501d SCP: One more static analyzer potential issue from Peter Schorn. 2013-12-28 05:31:07 -08:00
Mark Pizzolato
2bb502ee64 SCP: Static Analyzer cleanups suggested by Peter Schorn 2013-12-27 07:08:17 -08:00
Mark Pizzolato
bf58edfaab VAX: Fix for unaligned memory reference to IO and Register Space (from Bob Supnik)
Design Notes for Fixing VAX Unaligned Access to IO and Register Space

Problem Statement: VAX unaligned accesses are handled by reading the
surrounding longword (or longwords) and

a) for reads, extracting the addressed addressed word or longword
b) for writes, inserting the addressed word or longword and then
   writing the surrounding longword (or longwords) back

This is correct for all memory cases. On the 11/780, the unaligned
access to register or IO space causes an error, as it should. On
CVAX, it causes incorrect behavior, by either performing too many
QBus references, or performing read-modify-writes instead of pure
writes, or accessing the wrong Qbus locations.

The problem cannot be trivially solved with address manipulation.
The core issues is that on CVAX, unaligned access is done to
exactly as many bytes as are required, using a base longword
address and a byte mask. There are five cases, corresponding to
word and longword lengths, and byte offsets 1, 2 (longword only),
and 3. Further, behavior is different for reads and writes, because
the Qbus always performs word operations on reads, leaving it to
the processor to extract a byte if needed.

Conceptual design: Changes in vax_mmu.c:

Unaligned access is done with two separate physical addresses, pa
and pa1, because if the access crosses a page boundary, pa1 may
not be contiguous with pa. It's worth noting that in an unaligned
access, the low part of the data begins at pa (complete with byte
offset), but the high parts begins at pa1 & ~03 (always in the
low-order end of the second longword).

To handle unaligned data, we will add two routines for read and
write unaligned:

	data = ReadU (pa, len);
	WriteU (pa, len, val);

Note that the length can be 1, 2, or 3 bytes. For ReadU, data is
return right-aligned and masked. For WriteU, val is expected to
be right-aligned and masked.

The read-unaligned flows are changed as follows:

if (mapen && ((off + lnt) > VA_PAGSIZE)) {              /* cross page? */
    vpn = VA_GETVPN (va + lnt);                         /* vpn 2nd page */
    tbi = VA_GETTBI (vpn);
    xpte = (va & VA_S0)? stlb[tbi]: ptlb[tbi];          /* access tlb */
    if (((xpte.pte & acc) == 0) || (xpte.tag != vpn) ||
        ((acc & TLB_WACC) && ((xpte.pte & TLB_M) == 0)))
        xpte = fill (va + lnt, lnt, acc, NULL);         /* fill if needed */
    pa1 = ((xpte.pte & TLB_PFN) | VA_GETOFF (va + 4)) & ~03;
    }
else pa1 = ((pa + 4) & PAMASK) & ~03;                   /* not cross page */
bo = pa & 3;
if (lnt >= L_LONG) {                                    /* lw unaligned? */
    sc = bo << 3;
    wl = ReadU (pa, L_LONG - bo);                       /* read both fragments */
    wh = ReadU (pa1, bo);                               /* extract */
    return ((wl | (wh << (32 - sc))) & LMASK);
    }
else if (bo == 1)                                       /* read within lw */
    return ReadU (pa, L_WORD);
else {
    wl = ReadU (pa, L_BYTE);                            /* word cross lw */
    wh = ReadU (pa1, L_BYTE);                           /* read, extract */
    return (wl | (wh << 8));
    }

These are not very different, but they do reflect that ReadU returns
right-aligned and properly masked data, rather than the encapsulating
longword.

The write-unaligned flows change rather more drastically:

if (mapen && ((off + lnt) > VA_PAGSIZE)) {
    vpn = VA_GETVPN (va + 4);
    tbi = VA_GETTBI (vpn);
    xpte = (va & VA_S0)? stlb[tbi]: ptlb[tbi];          /* access tlb */
    if (((xpte.pte & acc) == 0) || (xpte.tag != vpn) ||
        ((xpte.pte & TLB_M) == 0))
        xpte = fill (va + lnt, lnt, acc, NULL);
    pa1 = ((xpte.pte & TLB_PFN) | VA_GETOFF (va + 4)) & ~03;
    }
else pa1 = ((pa + 4) & PAMASK) & ~03;
bo = pa & 3;
if (lnt >= L_LONG) {
    sc = bo << 3;
    WriteU (pa, L_LONG - bo, val & insert[L_LONG - bo]);
    WriteU (pa, bo, (val >> (32 - sc)) & insert[bo]);
    }
else if (bo == 1)                                       /* read within lw */
    WriteU (pa, L_WORD, val & WMASK);
else {                                                  /* word cross lw */
    WriteU (pa, L_BYTE, val & BMASK);
    WriteU (pa, L_BYTE, (val >> 8) & BMASK);
    }
return;
}

Note that all the burden here has been thrown on the WriteU routine.

-------------

ReadU is the simpler of the two routines that needs to be written.
It will handle memory reads and defer register and IO space to
model-specific unaligned handlers.

int32 ReadU (uint32 pa, int32 lnt)
{
int32 dat;
int32 sc = (pa & 3) << 3;

if (ADDR_IS_MEM (pa))
    dat = M[pa >> 2];
else {
    mchk = REF_V;
    if (ADDR_IS_IO (pa))
       dat = ReadIOU (pa, lnt);
    else dat = ReadRegU (pa, lnt);
    }
return ((dat >> sc) & insert[lnt]);
}

Note that the ReadIOU and ReadRegU return a "full longword," just
like their aligned counterparts, and ReadU right-aligns the result,
just as ReadB, ReadW, and ReadL do.

WriteU must handle the memory read-modify-write sequence. However,
it defers register and IO space to model-specific unaligned handlers.

void WriteU (uint32 pa, int32 lnt, int32 val)
{
if (ADDR_IS_MEM (pa)) {
    int32 bo = pa & 3;
    int32 sc = bo << 3;
    M[pa >> 2] = (M[pa >> 2] & ~(insert[len] << sc) | (val << sc);
    }
else if ADDR_IS_IO (pa)
    WriteIOU (pa, lnt, val);
else WriteRegU (pa, lnt, val);
return;
}

--------------

For the 11/780, ReadIOU, ReadRegU, WriteIOU, and WriteRegU all do the
same thing: they throw an SBI machine check. We can write explicit
routines to do this (and remove the unaligned checks from all the
normal adapter flows), or leave things as they are and simply define
the four routines as macros that go to the normal routines. So there's
very little to do.

On CVAX, I suspect that ReadRegU and WriteRegU behave like the
normal routines. The CVAX specs don't say much, but CMCTL (the memory
controller) notes that it ignores the byte mask and treats every
access as an aligned longword access. I suspect this is true for
the other CVAX support chips, but I no longer have chip specs.

The Qbus, on the other hand... that's a fun one. Note that all of
these cases are presented to the existing aligned IO routine:

bo = 0, byte, word, or longword length
bo = 2, word
bo = 1, 2, 3, byte length

All the other cases are going to end up at ReadIOU and WriteIOU,
and they must turn the request into the exactly correct number of
Qbus accesses AND NO MORE, because Qbus reads can have side-effects,
and word read-modify-write is NOT the same as a byte write.

The read cases are:

bo = 0, byte or word - read one word
bo = 1, byte - read one word
bo = 2, byte or word - read one word
bo = 3, byte - read one word
bo = 0, triword - read two words
bo = 1, word or triword - read two words

ReadIOU is very similar to the existing ReadIO:

int32 ReadIOU (uint32 pa, int32 lnt)
{
int32 iod;

iod = ReadQb (pa);                                      /* wd from Qbus */
if ((lnt + (pa & 1)) <= 2)                              /* byte or word & even */
    iod = iod << ((pa & 2)? 16: 0);                     /* one op */
else iod = (ReadQb (pa + 2) << 16) | iod;               /* two ops, get 2nd wd */
SET_IRQL;
return iod;
}

The write cases are:

bo = x, lnt = byte - write one byte
bo = 0 or 2, lnt = word - write one word
bo = 1, lnt = word - write two bytes
bo = 0, lnt = triword - write word, byte
bo = 1, lnt = triword - write byte, word

WriteIOU is similar to the existing WriteIO:

void WriteIO (uint32 pa, int32 val, int32 lnt)
{
switch (lnt) {
case L_BYTE:                                            /* byte */
    WriteQb (pa, val & BMASK, WRITEB);
    break;
case L_WORD:                                            /* word */
    if (pa & 1) {                                       /* odd addr? */
        WriteQb (pa, val & BMASK, WRITEB);
        WriteQb (pa + 1, (val >> 8) & BMASK, WRITEB);
        }
    else WriteQb (pa, val, WRITE);
    break;
case 3:                                                 /* triword */
    if (pa & 1) {                                       /* odd addr? */
        WriteQb (pa, val & BMASK, WRITEB);
        WriteQb (pa + 1, (val >> 8) & WMASK, WRITE);
        }
    else {
        WriteQb (pa, val & WMASK, WRITE);
        WriteQb (pa + 2, (val >> 16) & BMASK, WRITEB);
        }
    break;
    }
SET_IRQL;
return;
}

-----------------

I think this handles all the cases.

/Bob Supnik

Conflicts:
	VAX/vax780_defs.h
	VAX/vax_mmu.c
	VAX/vaxmod_defs.h
2013-12-22 04:10:01 -08:00
Mark Pizzolato
7b3e508627 ETHER: Added capability to build working networking support without pcap packet transport (i.e. only using one of the other available packet transports: VDE, TAP, UDP, etc.) 2013-12-19 09:45:51 -08:00
Mark Pizzolato
e34babdc7e ETHER,VAX,PDP11: Fixed regression in pcap ethernet link behavior introduced by the addition of the udp link type. This fixes issue #92 2013-12-17 05:44:27 -08:00
Mark Pizzolato
25a62c2837 PDP11,VAX: Added Unibus KRU50 controller type (from Bob Armstrong) 2013-12-10 11:11:41 -08:00
Mark Pizzolato
2daa41ecb3 PDP11: Fixed bug in CSM (John Dundas)
John Dundas said:

Bob and all,

I ran across what I believe to be a bug in the CSM code:

         case 070:                                       /* CSM */
             if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) || (cm != MD_KER)) {

According to the Architecture Handbook, CSM may be executed only if the MMR3 bit is set AND the mode is not Kernel.  Changing the code to:

         case 070:                                       /* CSM */
             if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) && (cm != MD_KER)) {

also has the effect of making the ZKDKB0 diagnostic much happier.

Thanks,

John
--
John A. Dundas III
2013-12-06 10:54:56 -08:00
Mark Pizzolato
17574ba699 Merge branch 'master' of github.com:simh/simh 2013-12-05 11:59:27 -08:00
Mark Pizzolato
834e986eaf ETHER,VAX,PDP11: Added UDP as a link type for Ethernet packet connectivity.
This will allow a single simulator to directly connect to HECnet systems without needing an external bridge program.
2013-12-05 11:58:58 -08:00
Mark Pizzolato
7ebc991b5d PDP11,VAX: Corrected the KRQ50 controller id code (from Bob Armstrong) 2013-12-04 09:55:28 -08:00
Mark Pizzolato
577f921014 PDP11/VAX: Additonal RQ drive types (RA70 and RA73) along with the ability to set additional controller types (from Bob Armstrong) 2013-12-03 12:48:29 -08:00
Mark Pizzolato
c1aa85d944 H316: Updated H316 and IMP documentation and addition of IMP modem loopback functionality and testing (from Bob Armstrong) 2013-12-03 06:56:38 -08:00
Mark Pizzolato
8810571d7e H316: Improve IMP error recovery when a remote host is restarted. 2013-12-02 12:00:48 -08:00
Mark Pizzolato
33248778cf TMXR: Correct const attributes for packet reading APIs. 2013-12-02 10:29:04 -08:00
Mark Pizzolato
f0ca4de993 H316: Move the SMK/OTK to h316_cpu (where it belongs!) and Allow the CLK device to be disabled (from Bob Armstrong) 2013-12-01 15:15:07 -08:00
Mark Pizzolato
118ef33f19 H316: Added "SET dev LOCALLOOP" and "SET dev NOLOCALLOOP" commands to the IMP modem device so that loopback mode can be changed by commands instead of just programatically. 2013-12-01 07:29:32 -08:00
Mark Pizzolato
a22c5c35b0 MAKEFILE: Give more clear information when issuing missing libSDL library to enable video capabilities #90 2013-11-30 00:38:49 -08:00