1
0
mirror of https://github.com/prirun/p50em.git synced 2026-01-11 23:42:56 +00:00

96 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
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
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
ea16e96f33 Fixed clock skew during boot when PNC not enabled 2020-04-16 01:50:52 +00:00
Jim Wilcoxson
b87e47d530 Fixup clock debugging trace 2020-04-14 19:32:01 +00: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
97264de159
Units error.
The significant digits are correct, but the decimal point is misplaced.
2020-03-18 17:12:50 -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
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
3dbd7630fb allow demo emulator to access 2 drives 2019-07-04 11:47:24 -04:00
Jim
ebd8a8a3fa secure: muck up RP instead of keys if secure() is bypassed, because
bad keys give an emulator error about a bad generic, while a bad RP
('7777/0) is a failure mechanism already in secure()
2012-07-25 09:25:02 -04:00
Jim
a0b8f60449 emdev: disable ^C, include gettimeofday override test 2012-07-18 23:57:51 -04:00
Jim
fce85ba28e secure: update dongle handling:
- decrement hoursleft on each boot to prevent running very short Prime
  sessions that don't update the dongle; this allows removing of
  dongle_dtime (the last time the dongle was updated)

- only uses 1 dongle location (for hoursleft)

- maintain a checksum on dongle values to detect tampering

- encrypt hoursleft and the dongle checksum

- write random values in all other dongle locations

- validate dongle by asking it to encrypt random values; this requires
  that a copy of the dongle key is stored in the executable

- don't fail immediately: just set a status and keep going

- caller sets bad Prime keys and hands us the correct keys; we reset
  Prime keys before returning.  This makes it harder to bypass
  security by not calling it at all.
2012-07-02 17:45:45 -04:00
Jim
147b28e84e misc edits 2012-06-09 17:56:11 -04:00
Jim
4c2594beb4 Change long to int for instruction counts 2011-12-04 11:01:14 -05:00
Jim
def51f2641 devasr: full-duplex test was backwards for console logging 2011-11-15 14:31:30 -05:00
Jim
83e05663cb - Replace HOBBY #ifdef with DEMO,
- Remove long integers so x86_64, where long is 8 bytes, is like i686
compile, where long is 4 bytes.
- Dont' handle xon/xoff on sys console in full duplex
- Add geom hash for DEMO emulator
- Add -mmacosx-version-min=10.4 option for DEMO emulator
- Add 1-line AMLC and 2-node PNC to DEMO emulator
2011-11-15 14:01:58 -05:00
Jim
c6d4fd1724 emdev.h: mt backspace at EOT kept returning EOT 2011-11-03 17:03:25 -04:00
Jim
d829b0efd9 Hey, it runs Primos again! This time on Intel. :) 2011-10-21 18:55:43 -04:00
Jim
53893d85ae bs: more changes, functions for symbolic register access, incl DMX 2011-10-20 17:23:15 -04:00
Jim
fa097d21fc BS rvec, memory accesses; order of RPH/RPL is byte-order dependent,
fix bug in get32 when -DFAST isn't used
2011-10-17 22:14:55 -04:00
Jim
2a89fb6ab8 First set of byte-swap changes; should compile equal to version 194 2011-10-17 10:53:58 -04:00
Jim
77ee732144 Changes to get rev 18 to boot 2011-10-01 22:42:59 -04:00
Jim
51aaaeb341 Reverse order of devpnc.h and devamlc.h: both use MAXHOSTLEN 2011-08-27 07:34:52 -04:00
Jim
5a5be64d17 Split devamlc into .h file, correct devpnc.h brace bug (hobby) 2011-08-24 17:42:35 -04:00
Jim
26b86c84e9 Add "off" trace option: initially disabled, ctrl-t to toggle it 2011-08-13 10:58:16 -04:00
Jim
fde9c6e812 Initial PNC driver (no receive yet), added #ifdefs for trace, allow
continuing after real HLT in S and R modes for old T&M diagnostics,
expanded list of Prime device drivers
2011-07-30 17:06:19 -04:00
Jim
6a00d0d937 Add mt option to return 2-word zero record instead of error status, to
test how magrst behaves.  It treats this just like a real tape error,
which is good.  If mtwrite is used to re-create a physical tape from a
.tap file, it cannot re-create tape errors, so writes a 4-byte zero
record instead.  Prime magrst will still see this as an error record
since it isn't long enough to be a real magsav record.
2011-07-18 09:49:34 -04:00
Jim
bcfdbec10f Changes for gcc on OSX 10.6, cross compile on Intel 2011-07-18 09:31:14 -04:00
Jim
ba3d9a1a7f licensing, sys console, fixed rare hang in sleep if IMPS goes to zero
add DNS lookup on every license server connect to handle dynamic IP
made keyboard chars ^O, ^Y, and ^V work on system console
added printf in fatal() if any messages were logged to error.log
supports ^b in Primos II to reboot from tape w/Primos II in memory
to allow running make rev 19 from Primos II, but it's still broken
fixed cylinder limits for some disk models (couldn't format some drive types)
fixed devdisk problem: a error on one unit could cause bogus errors on another
IMPORTANT: fixed rare bug where emulator would hang in sleep (IMPS=0)
2008-04-25 00:00:00 -04:00
Jim
1750f7f83b license dongle, boot options, amlc, tape, disk, change device filenames
added licensing dongle support
boot option supports filename, sense and data switches:
  -boot filename sswitch dswitch (for D. Boone)
-ds option (like VCP) as alternate way to set data switches (for D. Boone)
removed -v and -vv: they were old and didn't do anything
tries to read ring0.map and ring3.map if no -map option used
fixed bug with new connect for multiple AMLC controllers
default build is now for 32 amlc lines
fixed disk geometry for CMD; added geometry for Model 4935 (1.1G NEC)
fixed tape boot for variable record sizes (for D. Boone), but rev 19 loops
added EMULATOR_VERSION #define and version printf()
changed tape drive filenames from dev14u0-4 to mt0-4
changed disk drive filenames from dev26u0 to disk26u0
added license manager tracing
changed to automatically redirect stderr to error.log on startup
changed to create mtx tape drive files if they don't exist
tested write-protected tape drive files
changed invalid seek from a fatal error (emulator halt) to a disk error
disable Nagle algorithm for telnet connections (OSX buggy delay)
error setting terminfo flags for USB serial devices is no longer fatal
changed "pio to unimplemented device" from error to trace
2008-01-06 00:00:00 -05:00
Jim
e16f8824c4 license dongle, hobbyist build, tape, RT clock, amlc, disk, cpboot
changes for hobby version (no amlc, one disk drive)
new files geom.h, geomhash.h, geomhash.c for hobby version
added checksum to disk geometry tables to thwart hacking hobby version
added head offset check to disk driver for hobby version
added -boot help to display help with booting
added initial support for Matrixlock dongle
emulator handles xon/xoff on console to avoid blocking
supports read-only tape files (Unix read-only mode)
changed clock catch-up code (slower) so rev 20 doesn't crash after suspend
changed disk driver to controller 0-7 instead of device 0-64
demand-based variable interrupt rate for amlc controllers
fixed devdisk error reading zero bytes past disk eof (for D. Boone)
devdisk sets read check status bit on Unix read error
added INA '1114 for cpboot (for D. Boone)
2007-11-29 00:00:00 -05:00
Jim
b8233043d2 devamlc supports real serial ports, performance tweaks
changed SETCC_16/32, tcr, tch for speed, checked with Shark
support for real serial ports
added "amlc" config file to tie specific amlc lines to serial ports
changed amlc context to controller 0-7 rather than device 0-64
use lword bit 7 to enable hardware flow control: 2413 -> 3413
poll amlc faster if dmq buffer full (output), but don't do this for
  input because user input buffer might overflow
2007-10-29 00:00:00 -04:00
Jim
9d6903b4e2 prep devamlc for real serial, changed ints to shorts for queue instructions
changed devamlc in prep for real serial support:
- changed .sockfd to .fd
- change transmit to directly access queue, to remove select
2007-10-19 00:00:00 -04:00
Jim
3bb5eefc61 fixed multiple extension segments (stex, pcl, prtn), perf tweaks
-- this was causing the LISTENER_ORDER$ signals after DIAG
-- also was causing HELP to fail sporadically (HELP MTRESUME)
removed TB_xxx flags (identical to T_xxx)
added some eap hints
changed to pop the concealed stack earlier
changed LDLR/LDAR to load result from RP if ea is 7
changed STLR/STAR to store result in RP if ea is 7
added new trace flags for GET/PUT (unimplemented)
2007-10-16 00:00:00 -04:00
Jim
afdf6057b1 FP exceptions, -DNOREG for -O0 and -DBG compiles, perf tweaks, gcov
reworked ring/register fix so that Primos nevers sees RP faulted
  but we don't have to do extra tests in the fetch loop
changed EAxxx routines to use RP segno when EA = register
added FP exception fault to ieeepr8 and all FP routines
added round flag to ieeepr8 (though not sure it's rounding correctly)
used gcov info to reorder some stuff in ea16s, ea32s, ea32r64r
changed warn() and fatal() to use get16t; prevpc might be a register
IMPORTANT NOTE: to compile with -O0, also use -DNOREG (gcc bug)
2007-10-12 00:00:00 -04:00
Jim
36254e2fba RP ring bits weren't being preserved when executing code in registers.
This caused a HLT instruction in the register to halt the machine from ring 3
2007-10-09 00:00:00 -04:00
Jim
4779beb25e removed dup iget16 in BDX, no wait common case handled first in WAIT
cleaned up/added a few comments, added messages to fatal() calls
2007-10-06 00:00:00 -04:00
Jim
c845fdce12 changed main loop to test inhcount only when intvec is set;
this also required changes to emdev.h (can't look at inhcount)
2007-10-04 00:00:00 -04:00
Jim
84f57c9d59 removed rounding operation from ieeepr8 - causing Info RUN to fail +
changed ARGT to add ring bits to LB & SB in brsave[]
major TRACE update, to debug Information tsrc$$ problem
changed MAXMB default for non-OSX platforms (PS3) to 32MB
2007-10-02 00:00:00 -04:00
Jim
399b67ea91 SSSN hack to bypass serialization in Primos, more performance tweaks
changed B(I,D)(X,Y) instructions to increment/decrement inside if;
  (avoids reloading values to test them) and removed B(X,Y)NE macros
changed default cpuid to 15 so real time clock is always set
use ppa instead of ppn to avoid << 10 on every memory reference
changed newkeys() so illegal keys give illegal instruction vs fatal()
removed hack to patch Primos for rev 23 SSSN check
added code to SSSN to skip the check loop immediately following
removed #ifdef FAST from a few places, just use the faster code
added code to LDA trace to also display as two octal bytes
2007-09-23 00:00:00 -04:00
Jim
e095020a55 add access bits to brp.vpn entries, use brp cache for put16 & put32
added get32m & put32m: these always map
changed get32 and put32 to be inlined
changed mem[] references to MEM[] to allow experiments
tried using register for MEM pointer - not so great
tried using register for instcount - screwed up (very sluggish)
2007-09-12 00:00:00 -04:00
Jim
0948124f29 added "# of register sets" array, enabled multi-register set code ("ors") +
moved dispatch tables to global variable structure
2007-09-12 00:00:00 -04:00
Jim
0ea78958b0 Backout ea64v changes, PCL fixes, disabled curtrack/maxtrack check in devdisk 2007-09-01 00:00:00 -04:00
Jim
62b8229961 gvp dedicated global variable register, iget16 page cache 2007-08-31 00:00:00 -04:00
Jim
7601dcb718 INCRP, ADDRP macros, code optimization
added INCRP macro - now does 32-bit increments of RP for speed
added ADDRP macro to return RP incremented by n (CGT)
changed globals to static (didn't help speed much - thought it might)
moved around some functions
changed shift instructions to create bitmask at runtime (faster)
manually inlined mathexception (but used inline keyword in later revs)
2007-08-25 00:00:00 -04:00