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

334 Commits

Author SHA1 Message Date
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
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
0396eb0a5b makefile: add -Wno-return-type to enable clang / OSX builds
This option can be removed when the compile problems in emdev.h
(device drivers don't return a value in some cases) are fixed.
2020-04-16 03:12:20 +00:00
Jim Wilcoxson
003e07c171 devpnc.h: #ifdef Linux-specific optimization 2020-04-16 03:03:07 +00:00
Jim Wilcoxson
ea16e96f33 Fixed clock skew during boot when PNC not enabled 2020-04-16 01:50:52 +00:00
Jim Wilcoxson
63d37818f0 Merge branch 'master' of https://github.com/prirun/p50em 2020-04-14 19:33:02 +00:00
Jim Wilcoxson
b87e47d530 Fixup clock debugging trace 2020-04-14 19:32:01 +00:00
Dennis Boone
c4fe8caa27 Remove #$%^&*() URL manglement. 2020-04-13 19:25:20 -04:00
Dennis Boone
18a92ca96e
Merge pull request #2 from rmblair/makefile-updates
add makefile timestamp tracking (and in the future, others?) as well
2020-04-13 18:58:25 -04:00
Ryan Blair
2f4a214d68 add makefile timestamp tracking (and in the future, others?) as well 2020-04-13 22:53:31 +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
Dennis Boone
899597572b
Merge pull request #1 from rmblair/makefile-updates
Makefile updates
2020-04-13 15:07:47 -04:00
Ryan Blair
94afe8c181 add dependencies for conditional rebuild 2020-04-13 19:01:06 +00:00
Ryan Blair
66e3fd6f1a remove .PHONY'd 'em' target 2020-04-13 18:53:42 +00:00
Ryan Blair
08e1c7015c add clean target, remove extra rm steps 2020-04-13 18:51:50 +00:00
Ryan Blair
4b399e22ca allow swapping C compilers via standard CC variable 2020-04-13 18:43:29 +00:00
Jim Wilcoxson
5ef05d79b4 Set Prime physical memory with -mem 2020-04-13 17:15:40 +00:00
Jim Wilcoxson
76a87f62eb
devpnc.h: check fd before FD_SET
If there is no socket connection, fd will be -1.  On Ubuntu 18.04, gcc doesn't like adding -1 with FD_SET, and gives a buffer overflow abort.
2020-04-12 22:42:09 -04:00
Jim Wilcoxson
1816d42238
Update devpnc.h
Remove extra %d in format string
2020-04-12 14:49:44 -04: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
Dennis Boone
345c4d7ecc Fiddling with language. 2020-04-10 11:52:04 -04:00
Dennis Boone
67a7dcf02b Clean up text wrap. 2020-04-09 00:02:26 -04:00
Dennis Boone
09c6b73f56
New dist tapes. Note man page in emu doco section.
Link to four distribution tape sets on sysovl.
In the emulator doco paragraph, mention the man page.
Hacked on line wrap until I decided it was better to do it in vi.
2020-04-09 00:01:12 -04:00
Dennis Boone
4b7818dbb9
V5 of the samples. 2020-03-24 14:48:42 -04:00
Jim Wilcoxson
535093160c
Update README.md
Typo
2020-03-24 11:01:32 -04:00
Dennis Boone
be5f6279e3
Restructure sample image explanation text. 2020-03-23 14:57:35 -04:00
Dennis Boone
7c8d4dffae
v4 of sample images 2020-03-23 14:48:20 -04:00
Dennis Boone
ba921ada90 Startup support for Mac OS X. 2020-03-20 20:57:34 -04:00
Dennis Boone
30da390699
Typo 2020-03-18 19:48:05 -04:00