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.
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.
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.
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.
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.
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.
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.
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?
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.
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.
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.
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?
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.
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.
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)
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.
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.