1
0
mirror of https://github.com/prirun/p50em.git synced 2026-01-14 23:45:17 +00:00

211 Commits

Author SHA1 Message Date
Dennis Boone
244f2f49a2 Remove now-inaccurate comment. 2021-02-21 00:35:31 -05:00
Dennis Boone
af2b015383 Fix for problem where PASCAL install test crashes.
It appears that the emulator needs to check for faulted pointers
after indirection in APs used in e.g. EAFA.  PASCAL triggers this
issue by using EAFA on an indirect pointer to a DYNT.  A two cycle
fault check is done other places, and the approach is repeated here.
2021-02-21 00:06:38 -05:00
Dennis Boone
d6d01cd05c Workaround for locked up AMLC lines
As it was in the real world, especially with dialup ports, it is possible
for an emulator AMLC line to get blocked by stray flow control characters.
The blocked port may appear dead to the next user to connect, if they are
not "serial savvy" enough to try sending an XON character.

A large number of vulnerability scanners have found and have been hitting
the public emulators, injecting HTTP transactions or worse into the AMLC
ports and often locking all of them daily.

This workaround injects an XON (DC1, 0221) and a line kill character as
extracted from the DEFKIL field in FIGCOM, into the AMLC line when a new
connection is received.

There is a -dolineclear command line switch to enable the behavior.
2021-02-07 00:37:15 -05:00
Dennis Boone
ea2edd89de Fix terminal i/o issue in d_hlt
Due to the configuration of the tty, the getchar() call in d_hlt
returns nothing.  Work around this in the same way the SOC console
code does, by opening it on a separate unit, and reading from that
instead.  Without this fix, the code which looks for certain halt
cases and offers "continue or exit" just spins, printing its message
and getting no input.
2021-02-06 17:11:55 -05:00
Dennis Boone
3d71fd85f0 Update copyrights. 2021-02-03 18:51:34 -05:00
Kevin Jordan
89043d09a4 Add support for RJE MASTER mode in MDLC/HSSMLC controller, and use
TRACE macro in the controller implementation.
2020-08-06 23:43:50 -04:00
Dennis Boone
4771f09e1e Minor tracing enhancements
Deconflict some values of instruction count with some of the
other tracing options by making it require a leading # before
the integer count.

Add/fix support for tracing execution within a designated segno.

Announce to the trace file that tracing is initialized.
2020-06-23 17:35:53 -04:00
Dennis Boone
43d2d863d7 Replace tabs with spaces
Mixed tabs/spaces gets hairy.  I've expanded the tabs on the basis
of 8-position tabstops.
2020-05-30 01:42:39 -04:00
Kevin Jordan
af1718f699 Merge branch 'master' of https://github.com/kej715/p50em 2020-05-29 22:38:06 -04:00
Kevin Jordan
91bddd02c3 Add emulation of MDLC/HSSMLC controller to support Bisync protocol and enable a Prime
system to operate as a HASP station in an RJE environment. This implementation is
compatible with Bisync/HASP emulation in the Hercules IBM mainframe emulator and the
DtCyber CDC mainframe emulator.
2020-05-29 12:53:58 -04:00
Dennis Boone
4def8fe397 Support for booting DOS pre-Rev20
PRIMOS2 was built to be relocated after being loaded by BOOT.
The build process rewrote the RVEC in the save file.  The SA was anded
with :160000; the result was subtracted from SA and EA in the RVEC,
and stored into RA in the RVEC.  The BOOT program knew to add the RA
value during the load process.

This change causes the emulator to recognize such an RVEC when booting
an R-mode executable from unix disk, and to adjust the RVEC before
actually loading the program.  This fixes failure to boot *DOS64 from
19.2.9, for example.

The code only makes this adjustment if RA is non-zero, and RP is not
between SA and EA.
2020-05-27 19:06:55 -04:00
Jim Wilcoxson
ebf5511235 em.c: remove mips benchmark
Now that instpermsec is being adjusted every second instead of every
5 seconds, the initial value of instpermsec is not so critical.  This
benchmark gave wildly varying results on different system and compilers.
2020-05-01 16:26:19 -04:00
Jim Wilcoxson
280634b67e em.c: fix precendence bug caught by compiler
Only affects the display of keys (float exception enabled) on a fatal error.
2020-04-26 12:27:48 -04:00
Jim Wilcoxson
33f748f778 em.c: simpler iget16 and iget16t with same performance
Previously iget16 was used for all instruction fetches, with the
assumption that any could trap.  But actually, only the first word of
the instruction stream can trap in V mode, which is why these
instructions must be short.  Both words of a long R-mode instruction
can trap.

Tested change by booting R19 with and without -DFAST, all other revs
with -DFAST, and basic with trace on in R19 (this executes code from
the DFAC)
2020-04-20 16:14:03 +00:00
Jim Wilcoxson
6693ab36e2 Merge branch 'master' of https://github.com/prirun/p50em 2020-04-19 02:04:48 +00:00
Jim Wilcoxson
b3cada1dbf em.c: add a small benchmark loop to set the initial value of instpermsec
to a reasonable value.  This avoids clock anomolies during startup.
2020-04-19 01:14:15 +00:00
Dennis Boone
1d8476a807 Fix crash executing from registers during boot
In slow mode (compiled without -DFAST), Rev. 19 would crash during
boot.  On investigation, the code was branching to '4 after setting
up an instruction there.  However, instruction fetch found a '0
instead of the expected instruction.

Instructions might be fetched from registers via trap.  Fast iget16()
checks for fault.  Slow iget16() does not, and just calls get16() which
does not check.
2020-04-18 01:48:22 -04:00
Jim Wilcoxson
4a1bfefa4a Minimize clock inaccuracies during system boot
The initial estimate for instructions per millisec (instpermses) was
much too low for modern CPUs, and was also only updated every 5
seconds.  Combined, these were causing the clock to be erratic during
the first 5-15 seconds of system boot.

This was easily noticed by running the MIPS benchmark program right
after a system boot, where instead of delaying 5 seconds, it might
only delay 2 seconds, and then would report a bogus MIPS rating.
Waiting a minute and running it again would give an accurate rating.

Adjusting the instpermsec initial value from 2000 to 40000 and
IPMSTIME time from 5000 ms to 1000 ms (every second vs 5 seconds)
fixes the problem.
2020-04-18 03:11:56 +00:00
Jim Wilcoxson
cd2b4516e5 em.c: remove searchloadmap from SR-mode flow tracing
The emulator reads SEG load maps for Primos and displays symbolic
names and offsets during tracing.  But when running in S/R modes
during initial startup, there is no point in doing a load map lookup
and it's somewhat confusing to see segment 0 symbol names printed for
all effective addresses.  A blank name was already printed for
user-mode S/R traces because the segment number is > 01777, usually
04000.
2020-04-17 20:26:25 +00:00
Jim Wilcoxson
02f841d87f em.c: remove boot_tv as it's no longer used 2020-04-17 20:19:23 +00:00
Jim Wilcoxson
4561acc0b1 Revised & expanded comments about phyiscal memory
Removed comment about memory needing to be a power of 2.  Testing
-mem 9 worked fine with rev 20:

OK, stat sys

System is currently running PRIMOS rev. 20.2.8
Copyright (c) Prime Computer, Inc. 1985

9216K bytes memory in use
2020-04-16 19:47:54 +00:00
Jim Wilcoxson
d0cb6629c1 em.c: change MAXMB to DEFMB, remove MEMSIZE and MEMMASK
It was confusing that MAXMB is the default memory size, so renamed it
to DEFMB.  MEMSIZE was not necessary (half of MAXMB) and MEMMASK was
used only in mapva to limit physcal addresses when segmentation was
not enabled.  However, this appears to be a bug, because it would
cause memory addresses larger than physical memory to wrap and succeed
rather than generate a missing memory check.
2020-04-16 15:09:14 +00:00
Jim Wilcoxson
f9f77c3c99 Check if Prime RAM allocation succeeded instead of seg faulting 2020-04-13 22:00:00 +00:00
Jim Wilcoxson
932224bf0f Check -mem limit against 512, not MAXMB 2020-04-13 21:12:02 +00:00
Jim Wilcoxson
918b771dfa Remove comment about not sharing emulator source 2020-04-13 19:50:15 +00:00
Jim Wilcoxson
5ef05d79b4 Set Prime physical memory with -mem 2020-04-13 17:15:40 +00:00
Dennis Boone
087fd30e83 Make sure stderr is still unbuffered after the reopen. This is
likely unnecessary, but belt.  Suspenders.
2020-04-12 12:56:24 -04:00
Dennis Boone
527611669b Convert strcpy() calls to strncpy().
Raise the size of the symbol name variable.
2020-04-11 12:51:44 -04:00
Jim
1624437939 em: move #define to force inline to start of code 2020-03-09 22:36:26 -04:00
Jim
364792c169 Remove stopwatch-related calls and stopwatch.h stub 2020-03-09 22:30:09 -04:00
Jim
4a6a3aff5d em: add macro to force gcc to obey inline keyword
History: when the emulator was first developed on OSX 10.4 (PowerPC),
the inline keyword was added by profiling with Apple's pretty
fantastic Shark profiler.  Apple's version of gcc had an -fobey-inline
switch that the makefile used to force gcc to obey the inline keyword.
This macro does the same thing
2020-03-09 01:12:45 -04:00
Jim
9054d69446 em.c, etc: use gv.xxx instead of gvp->xxx for 13% speed increase, from
37.5 Prime MIPS on Linode VM to 42.5 MIPS.  gvp-> was faster on the
PowerPC architecture when gvp was kept in a dedicated register, but
that does not apply to Intel.

Old:

Timing CPU,  20.0 ticks per second...
  35.3 Prime MIPS for 16-bit ADD loop
  40.0 Prime MIPS for 16-bit MPY loop
  42.1 Prime MIPS for 16-bit DIV loop
  21.4 Prime MIPS for 32-bit ADD loop
  30.8 Prime MIPS for 32-bit MPY loop
  28.6 Prime MIPS for 32-bit DIV loop
  57.1 Prime MIPS for 16-bit X=0 loop
  44.4 Prime MIPS for 32-bit X=0 loop
  37.5 average Prime MIPS

New:

Timing CPU,  20.0 ticks per second...
  42.9 Prime MIPS for 16-bit ADD loop
  53.3 Prime MIPS for 16-bit MPY loop
  47.1 Prime MIPS for 16-bit DIV loop
  24.0 Prime MIPS for 32-bit ADD loop
  38.1 Prime MIPS for 32-bit MPY loop
  32.0 Prime MIPS for 32-bit DIV loop
  57.1 Prime MIPS for 16-bit X=0 loop
  44.4 Prime MIPS for 32-bit X=0 loop
  42.4 average Prime MIPS
2020-03-08 23:46:14 -04:00
Jim
c18704894f merge -naddr changes 2020-03-01 22:06:56 -05:00
Jim
73d2479dba em: comment cleanups 2020-03-01 22:02:47 -05:00
Dennis Boone
83f130aba5 devpnc.h: use global bindaddr variable instead of hardcoded INADDR_ANY.
em.c: command line option -naddr to set bind address for pnc socket.
2020-03-01 04:35:23 +00:00
Jim
9de65ca516 em: decode keys and modals in fatal error message 2020-02-25 20:11:15 -05:00
Jim
00205c830b add lights (Dennis) 2020-02-25 14:15:03 -05:00
Jim
a4cc429fad Linux cleanup to remove demo/dongle code, remove PowerPC stuff, fix slow PNC I/O, fix a nasty devmt bug 2020-02-24 23:55:03 -05:00
Jim
4061b6adc9 Changes to allow emulator to run on Linux for hosting at Linode 2019-09-25 10:56:48 -04:00
Jim
5bf0eb8362 typo 2019-07-04 11:53:04 -04:00
Jim
233ef630d4 Don't install signals with dedicated registers 2012-07-24 15:41:56 -04:00
Jim
371c051d16 em: save pid and boot file inode for security checks 2012-07-18 23:56:49 -04:00
Jim
441a3f5845 Updates after testing on PPC G4 Tiger machine (makefile changes), and
tighten secure.h a bit
2012-07-09 22:13:25 -04:00
Jim
75a4b59312 em: don't use localhost if license server DNS fails; update copyright 2012-07-02 17:15:42 -04:00
Jim
2b0bb15902 em: if instpermsec starts at 15000, CPU.TIMER.SAVE diag fails in case 4 2012-06-09 17:55:54 -04:00
Jim
e60628f2d1 Fix trace format 2011-12-14 16:50:54 -05:00
Jim
4c2594beb4 Change long to int for instruction counts 2011-12-04 11:01:14 -05:00
Jim
f1a7e6f501 -cpuid takes model numbers too, STPM stores emulator version 2011-11-24 00:10:12 -05:00
Jim
dc24f26eb1 Use registers on PPC for demo/production build, don't install sigquit,
don't use async I/O for PNC.  Signals don't work with registers enabled.
2011-11-23 15:07:45 -05:00
Jim
ad35ffb6f7 Fixed SSSN byte-swap problem 2011-11-18 15:06:47 -05:00