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

54 Commits

Author SHA1 Message Date
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
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
Jim Wilcoxson
003e07c171 devpnc.h: #ifdef Linux-specific optimization 2020-04-16 03:03:07 +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
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
35adf0905a devpnc.h: moved xmit setup code from OTA to pncxmit;
move loopback handling to pncxmit1 so it is used for broadcasts;
added reason to disconnects for better logging;
change some traces to prints for better logging;
my node is always authenticated
2020-03-08 23:25:44 -04:00
Jim
c18704894f merge -naddr changes 2020-03-01 22:06:56 -05:00
Jim
06a848a464 devpnc.h: don't send broadcasts to myself. Not sure if this is right 2020-03-01 22:04:47 -05:00
Dennis Boone
83f130aba5 devpnc.h: use global bindaddr variable instead of hardcoded INADDR_ANY.
em.c: command line option -naddr to set bind address for pnc socket.
2020-03-01 04:35:23 +00:00
Jim
9d656255a5 devpnc: only broadcast to nodes in ring.cfg 2020-02-29 14:02:52 -05:00
Jim
df00f2c7e6 devpnc.h: # in ring.cfg is a comment, like amlc.cfg; map all
unprintable characters to _
2020-02-29 13:21:45 -05:00
Jim
cd351506ea devpnc.h: drive connections from PNC xmit requests rather than
ring.cfg, for faster start times of large rings
2020-02-27 20:00:58 -05:00
Jim
120079666f devpnc.h: expand listen backlog for big rings, use TCP_DEFER_ACCEPT so
Linux holds onto connections until the uid is sent.  Otherwise, the
delay between making a connection and sending the uid will be larger
than MAXACCCEPTTIME, causing large rings to fail
2020-02-27 11:53:07 -05:00
Jim
bf3c1a3df2 devpnc: after accept, make fd non-blocking to avoid deadlock when multiple emulators make connect requests, then accept(), then block reading uid that never comes. 2020-02-26 21:39:21 -05:00
Jim
aac96b62c2 devpnc.h: disable Nagle to decrease latency 2020-02-25 13:46:44 -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
233ef630d4 Don't install signals with dedicated registers 2012-07-24 15:41:56 -04:00
Jim
147b28e84e misc edits 2012-06-09 17:56:11 -04:00
Jim
2e5674013a devpnc: add ENOTCONN as known error when connect fails 2011-11-26 13:36:56 -05:00
Jim
ae7a089a5d devpnc: remove DEMO debugs, don't print error for nodeid = 0 2011-11-26 10:45:05 -05:00
Jim
51072065e9 devpnc: check node id, add ring.cfg checks for DEMO builds 2011-11-26 09:45:15 -05:00
Jim
dc24f26eb1 Use registers on PPC for demo/production build, don't install sigquit,
don't use async I/O for PNC.  Signals don't work with registers enabled.
2011-11-23 15:07:45 -05:00
Jim
0f5c6eebdf devpnc: improve pkt dump, test my node id against limit, DEMO changes 2011-11-18 10:17:48 -05:00
Jim
cc9a40c2ad devpnc: incoming-only connections if host is -, fix select bug 2011-11-15 18:30:53 -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
4b75d003bd devpnc: handle case -2 (shutdown) to avoid "bad func in devpnc" error 2011-11-09 14:49:21 -05:00
Jim
33a4b7a459 devpnc: bs problems fixed, corrected rcv pkt hdr update 2011-10-25 20:48:01 -04:00
Jim
53893d85ae bs: more changes, functions for symbolic register access, incl DMX 2011-10-20 17:23:15 -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
5a5be64d17 Split devamlc into .h file, correct devpnc.h brace bug (hobby) 2011-08-24 17:42:35 -04:00
Jim
d398a93143 Removed PNCXSNAK - don't need it 2011-08-24 17:12:36 -04:00
Jim
50a95cc1ba Use close(): shutdown() causes a descriptor leak. Add a trace when a
connection is accepted.
2011-08-19 17:04:31 -04:00
Jim
49eaf4b21b Don't zero uid of disabled node, to avoid "can't find uid" error. 2011-08-19 16:15:16 -04:00
Jim
a3a1f06d6f When a packet is too big to receive, disable the node it came from.
This happens for example if a node is configured with a 1024-word
packet size and sends to a node with a 256-word packet size.  In the
emulator PNC design, the packet has already been ACK'd at the sending
side, so there is no way to indicate a transmission error other than
taking down the connection.  Since the error will just occur again,
the best course is to disable the node until the next reboot.
Primenet will disconnect the sending and receive nodes from each other
in about 30 seconds.

Also removed pnchexuid: useful in the beginning, not so much now.
2011-08-19 16:04:39 -04:00
Jim
2a698b038d Don't NAK xmit packets. prmnt1 seems to indicate that a packet no one
accepts is NAK'd, but if we do that, it keeps getting sent over and
over.  If we're not connected, retries don't make sense.
2011-08-19 13:37:02 -04:00
Jim
063a23144a Fix several devpnc bugs:
1. Need 32-bit integer for dma address so newer Primos can use I/O
segments other than 0.
2. Ignore interrupted select()
3. Set fd to -1 after closing when not connected, to avoid bad
file descriptor error
2011-08-18 14:04:55 -04:00
Jim
8200cff70d devpnc: don't print disconnected message in error.log when we were
trying to connect but failed.  Only print them when we actually were
connected.
2011-08-17 16:28:58 -04:00
Jim
1bc93f304a devpnc: ensure ring.cfg unique id is really unique: it determines the
node-id for incoming connections.
2011-08-17 15:48:01 -04:00
Jim
834cb1977f Add simulate token OCP, just for documentation purposes. This is only
used by T&M's.
2011-08-17 12:05:21 -04:00
Jim
8c635c19c8 Minor devpnc edits, change MAXACCEPTTIME from 5 to 15 seconds 2011-08-16 18:34:16 -04:00
Jim
1b943bce0a Enabled PNC async I/O, changed poll from 100ms to 1 sec, performance
seems to be fine.  Remote ld -size no longer takes 1 second per entry,
but that is probably because of earlier PNC changes.
2011-08-16 18:04:13 -04:00
Jim
8aac162418 Use select() to find out if any node has sent us data; more efficient
than doing a read on each socket.
2011-08-16 17:55:55 -04:00
Jim
51dfd5101b Only dump packets when tracing w/RIO 2011-08-16 15:31:07 -04:00
Jim
f742bc46a9 Add code to devpnc to remember when it triggers interrupts, seems to
work okay and not have the 30-second delay problem.

Over netlink, a prirun, l, displays a couple of medium-sized packets,
then '55' from PR0055 in a tiny packet, then one more reasonable-size
packet.  The tiny packet seems odd, but I'm guessing it's a window
size or buffer size thing inside Primos / Primenet.
2011-08-16 15:28:14 -04:00
Jim
6a668b877d Timestamp packet dumps and polls, check for interrupt needed when
interrupts are enabled.  This fixes the 30-second lag problem, but
also causes PNCDIM to get notified too many times.  After an xmit,
devpnc causes an immediate interrupt.  This is handled by the SEG4
phantom interrupt code by disabling PNC interrupts, then notifying
PNCDIM.  (Remember, PNCDIM is still in the xmit OTA, or shortly
following).  PNCDIM finishes its loop, enables interrupts, and does a
WAIT.  When it enables interrupts before the WAIT, devpnc doesn't
remember that it has already interrupted, and interrupts again.  I
think this is a bug - the other emulator controllers have a state
variable to remember whether they have already interrupted.  But,
if I fix this "bug", we'll probably have 30-second delays again.
Hmmm...
2011-08-16 14:46:36 -04:00
Jim
4ddd43debf Add async I/O code to devpnc, but disabled for now: there is a delay
problem with remote terminal sessions:

1. netlink to remote Prime
2. a prirun
3. l (list directory)
4. displays a little, then a longish pause up to 30 seconds, then the rest

Does a similar thing with stat us.  Hitting Enter will cause it to
finish, while typing characters does not.  I suspect this is a problem
with Prime's networking code, but not sure.

Also, if async I/O is used, the QUIT. OK, message doesn't appear after
ctrl-p.  I think they are getting wiped out by Primenet's buffer
flushes.

All of this might be subtle timing problems because I changed the
default clock rate from 250/330/500/whatever times per sec to 20 times
per second in this rev 19 version of Primos.
2011-08-15 17:11:28 -04:00
Jim
e4dfa3fade Interrupt immediately after xmit and rcv instead of doing a poll. 2011-08-14 23:53:12 -04:00