1
0
mirror of https://github.com/prirun/p50em.git synced 2026-01-13 15:17:32 +00:00

368 Commits

Author SHA1 Message Date
Dennis Boone
74aa7fe23e Trial command line option to suppress updating PRIMOS' DATNOW variable. 2025-09-29 20:38:30 -04:00
Dennis Boone
1819fed512 Error in link to install instructions
The link in README.md to install instructions was either old or
never quite right.  Point to DRB's overview document now, which
points (near) to the version specific ones.
2022-03-21 15:24:01 -04:00
Dennis Boone
64c5970e97 Added tracing for floating point operations. 2021-12-13 14:02:01 -05:00
Dennis Boone
c6c0344004 Additional #ifdef __APPLE__ sections removed
Some DTR handling was still inside of such #ifdefs, and thus
I was unable to make a modem work on a serial port.  I believe
this code is portable to OSX, Linux, FreeBSD, and Solaris.
2021-09-05 16:40:13 -04:00
Dennis Boone
0466b4b603 Emit mark parity space(s) in the "less than three" case, not space
parity ones.  Discovered by Daiyu.
2021-07-27 14:59:27 -04:00
Dennis Boone
256c72ca64 Install git in the vm so the version stamping works. latest 2021-03-19 01:42:51 -04:00
Dennis Boone
975cc951f8 Really? No "latest" tag or release or whatever, have to use a
numeric version?
2021-03-19 01:34:13 -04:00
Dennis Boone
29fbc31df6 Can the packaging be outside the vm thing? 2021-03-19 01:30:30 -04:00
Dennis Boone
f72b67b876 FreeBSD build, attempt 1. 2021-03-19 01:27:25 -04:00
Dennis Boone
df6529c505 Make these manual. 2021-03-19 01:16:12 -04:00
Dennis Boone
8782e6a63e MacOS builder. 2021-03-19 01:13:11 -04:00
Dennis Boone
88a43363e1
Put repo_token back in
Not sure what this really wants, the action doco doesn't explain it _at all_.
2021-03-19 00:58:53 -04:00
Dennis Boone
9fa1c77bad Flush out the auto-build. No clue if this will work. 2021-03-18 11:58:04 -04:00
Dennis Boone
2d8397d1a4
Create linuxbuild.yml
See if we can build release binaries.
2021-03-18 11:45:44 -04:00
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
902f535120 Merge remote-tracking branch 'refs/remotes/origin/master' 2021-02-17 18:11:03 -05:00
Dennis Boone
25febc3947 Merge remote-tracking branch 'refs/remotes/origin/master' 2021-02-11 13:01:51 -05:00
Dennis Boone
84afd8da7b Add an editorconfig file. 2021-02-11 13:01:28 -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
Dennis Boone
5d119bb2c5
Update README.md
Github discussions.
2021-01-21 14:24:49 -05:00
Dennis Boone
aa8095217f
Merge pull request #5 from kej715/master
Add support for RJE MASTER mode in MDLC/HSSMLC controller, and use TRACE system instead of separate debug tracing.
2020-08-07 10:19:32 -04: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
e61857e333 Man page enhancements
Credit Kevin Jordan for sync serial support.

Add smlc.cfg info.

Improved explanation for instruction count and octal segno tracing.
2020-06-23 17:53:01 -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
6bf6e2ea48 Nanosecond log resolution for SMLC debug log
Using clock_gettime(), fetch the realtime clock, which has as much as
nanosecond resolution.  (In reality, it will likely ben more like
microseconds, though it returns the value in nanoseconds.) Use the
nanosecond value in SMLC log entries.  On modern systems and over
ethernet links, second resolution is probably fairly coarse for trying
to debug RJE problems.
2020-06-23 17:15:35 -04:00
Dennis Boone
edf7129651 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-06-22 23:58:37 -04:00
Dennis Boone
543aa3f963 Fix link fail on x64-64
Weird gcc behavior.  Code snippet:

   uint16_t data;
   char ch;
   ...
   i = (data >> 8) & 0xff;
   ch = data & 0xff;
   ...
   fprintf(smlclog, "%s OTA '01%02o line '%02o set special character %d <%02x>\n", smlctimestamp, device, dc[dx].lineno, i, ch);

Output on x86-64 before this change:

    17:13:51 OTA '0150 line '02 set special character 3 <ffffffff>

Output on armhf or on x86-64 after this change:

    19:05:00.130466808 OTA '0150 line '02 set special character 3 <ff>

WTH?  Masking an unsigned with an appropriately sized mask produces a
sign extension?
2020-06-22 23:54:22 -04:00
Dennis Boone
7d7504a02e Clock resolution sniffer
The cmraw tool shows the approximate minimum time a program could
nanosleep, which tends to be quite a bit bigger than the smallest
value one could pass to nanosleep (one ns).  For example, on my
i7-3770 running linux, the results tend to be between 90 and 120 ns.
2020-06-11 13:22:48 -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
Dennis Boone
80c1a57895
Merge pull request #4 from kej715/master
MDLC/HSSMLC controller emulation to support Bisync and HASP for RJE
2020-05-30 00:17:58 -04:00
Kevin Jordan
d566f42ea6 Eliminate compiler warnings. 2020-05-29 22:46:09 -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
43bbf3cd8f TCP_KEEPALIVE timer not supported on OSX 2020-05-27 18:49:35 -04:00
Dennis Boone
9c6722ffc5 Set the keepalive idle time at accept time
Set the keepalive idle time per connection, at accept time,
using the setsockopt TCP_KEEPIDLE flag.  This seems to be
reasonably portable.
2020-05-17 00:35:04 -04:00
Dennis Boone
7e8e7236ec Turn on keepalive on accepted amlc telnet connections
On linux, keepalive defaults off.  The default timer on linux
is 7200 seconds.  Do we need to make a note in the docs about
setting /proc/sys/net/ipv4/tcp_keepalive_time?
2020-05-16 22:51:14 -04:00
Dennis Boone
07c7232878 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-05-05 18:40:09 -04:00
Dennis Boone
8749def64f Changes to enable building on Solaris, FreeBSD
Solaris (SmartOS) build needs alternative solutions to two termios
things, plus makefile support for additional link libraries.  PNC
support is untested and is likely _very_ slow, since Solaris doesn't
have O_ASYNC.  The usual suggestion is to rewrite such code to use
poll().

Incidental: utilities makefile needed tabs to make `make` happy
on FreeBSD.  Which make?  Don't remember now.
2020-05-05 18:37:08 -04:00
Dennis Boone
633d61f2de
Separate binaries package. 2020-05-05 18:29:03 -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