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

32 Commits

Author SHA1 Message Date
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
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
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
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
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
527611669b Convert strcpy() calls to strncpy().
Raise the size of the symbol name variable.
2020-04-11 12:51:44 -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
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
a5d156c679 devamlc: only print ttymsg on socket connections, not dedicated; b)
only accept incoming connections from dedicated host if the port in
amlc config file is zero
2019-07-04 12:56:36 -04:00
Jim
e42d7cee37 devamlc: fix byte-order bugs with dedicated outbound lines on Intel 2012-06-10 09:46:50 -04:00
Jim
1dd6b39ef3 devamlc: don't print disconnect msg on dedicated lines, don't try to
connect on dedicated *inbound* lines; connection request has to come
from the device in this case.
2012-06-06 14:22:36 -04:00
Jim
0f4af04275 devamlc: increase max buffer size for large AMLIBL buffers 2011-11-26 13:37:40 -05:00
Jim
49a81258ae devamlc: remove some prints, add some comments, moved an if 2011-11-26 11:47:31 -05:00
Jim
44f35153c7 devamlc: start working on passing ^O through AMLC / telnet 2011-11-26 09:48:29 -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
2a89fb6ab8 First set of byte-swap changes; should compile equal to version 194 2011-10-17 10:53:58 -04:00
Jim
b9980bfe30 devamlc: add outbound dedicated lines, programmable clock line,
move local vars to the block that uses them
2011-10-10 00:07:51 -04:00
Jim
d1596b5e82 devamlc: fix ttymsg bug 2011-09-17 15:21:13 -04:00
Jim
3a64f463f0 devamlc: minor edits 2011-09-16 09:46:51 -04:00
Jim
f912f5dcc5 devamlc: major revision to interrupt only on the clock line board,
and in general, optimize operation of the AMLC subsystem.
2011-09-15 18:27:33 -04:00
Jim
efada91773 Fixed several AMLC issues:
- Kermit/telnet negotiations work now: fd var was not being set, so
write() was not actually working

- with many controllers, Primos would halt with tumble table overflow:
you can't do read processing until lines are enabled

- only look for new connections when handling the clock line
controller; there is no sense doing this more than 10x per second, and
it probably should still have a timer in case polls are being sped up

- use buf[] for tty message, not another static buf

- when a new connection occurs, set devpoll for the controller.  The
first connection to a controller was taking 5 seconds when more than 1
controller was present

- when status is read and an eor occurred, do read processing again
rather than waiting for the next poll

- divide tumble table space up by # of connected lines.  The old way
read MAXREAD (64) chars from each line until the tumble table was
full.  But with 8 AMLC boards configured, there is only 53 words of TT
space in each double buffer.  A select() on connected fd's would be
better.

- allow # as first character of amlc.cfg for comment lines

- turn on TCP/IP NODELAY (disable Nagle) to improve character echo
2011-09-13 14:02:28 -04:00
Jim
023edffb04 Remove "room left in input buffer" concept, remove DMT support 2011-09-05 16:17:48 -04:00
Jim
871568778f Re-add broken Kermit negotiation, but now telnet works again! 2011-08-27 20:51:19 -04:00
Jim
4e59c7728b Re-add Kermit telnet negotiation, but leave it disabled 2011-08-27 20:35:12 -04:00
Jim
cc4d7561ed devamlc comments and cleanups 2011-08-27 20:23:32 -04:00
Jim
7230a331f3 Back out telnet changes for Kermit; they screwed up regular telnet 2011-08-27 20:11:37 -04:00
Jim
927d8c9c13 Tried to fix Kermit telnet negotiation so /nowait isn't required; worked
for most things, but not for DO KERMIT / WILL KERMIT - still hangs. :(
2011-08-27 17:04:59 -04:00
Jim
d7dc1847a8 amlc.cfg: can dedicate AMLC lines to an IP address. This is useful
for serial device servers connected to a serial printer for example,
where the SDS initiates the telnet connect to the Prime when the
printer is turned on.
2011-08-27 08:29:44 -04:00
Jim
5a5be64d17 Split devamlc into .h file, correct devpnc.h brace bug (hobby) 2011-08-24 17:42:35 -04:00