1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-25 19:46:21 +00:00

Dodo Nethub support (#445)

* added support for XNS networking via Dodo-Nethub

* NetHub connection now optional (only if -nh-host is given); released NetHub-related changes to 'ether.c' to the public domain

* Added file using-dodo-networking-with-maiko.md

Documentation for building and using the Dodo-networking addition to Maiko

* Added support for running Maiko unter cygwin/x86_64-x

* Migrate Addr68k/NativeAlignment{2,4} in Nethub code, move timer/async defines to platform.h

* added missing include <netinet/in.h> for FreeBSD

* updated 'compile-flags' with added flags

* splitted ether.c in 3 (_common, _sunos, _nethub)

* reworks/modifications for nbriggs' pull-request review comments

* addintional additions for nbriggs' pull-request review comments

* get the Lisp packet lengths with 'LispInt2CInt'

* renamed variables in dblwordsSwap to indicate it's about double-words

* fixed wrong preprocessor directive unnoticed by clang

* added networking choice option to cmake build, fix to printf warning

- for cmake specify the networking to use with -DMAIKO_NETWORK_TYPE=<type>
- with <type> one of: NONE, SUN_DLPI, SUN_NIT, NETHUB
- e.g.: cmake .. -DMAIKO_NETWORK_TYPE=NETHUB

* integrated improvement to sendPacket() proposed by nbriggs

* integrated fix for SIGBUS on 32-bit big-endian, provided by nbriggs

* MAIKO_ENABLE_ETHERNET should not be unconditionally set on Solaris systems

* Receiving an ethernet packet is an ether interrupt but not an i/o interrupt.

Co-authored-by: dev hawala <devhawala@x.y>
Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
This commit is contained in:
devhawala
2022-10-11 23:21:55 +02:00
committed by GitHub
parent 2509a796ce
commit 82577ce951
18 changed files with 1107 additions and 102 deletions

14
docs/NEWCDRCODING.md Normal file
View File

@@ -0,0 +1,14 @@
# CDR CODING in cons cells
The cdr-code is a 4-bit field of a 32-bit cons cell.
It is treated as an on-page indicator bit and a 3-bit scaled offset.
Certain combinations are treated specially.
on-page| offset | interpretation
-------|--------|----------------------------------------------------------------------------
1 | 0 | CDR is NIL
1 | 1 - 7 | CDR is at 2*offset (counted in 32-bit cells) on same page
0 | 0 | CDR is indirect, CDR(car)
0 | 1 - 7 | CDR is not a cons cell but is in the car of cell at 2*offset on same page

View File

@@ -0,0 +1,86 @@
# Using Dodo-networking with Maiko
The [Dodo XNS services](https://github.com/devhawala/dodo) provide an emulation for a usable
subset of the Xerox 8000 Network Services from the 1980-ies. Dodo uses its own virtual
network infrastructure - the Dodo *Nethub* - for avoiding the problems involved with
implementing the transmission of XNS protocol packets over (real or virtual) network
adapters of the diverse contemporary operating systems.
The Dodo Nethub provides a simple virtual network, a kind of *XNS-over-TCP/IP*,
where clients and servers connect with TCP/IP to the central Nethub program, which relays all
packets ingoing from one connection to the other connections.
The following sections describe the support for Dodo-networking added to
Maiko. The Dodo Nethub support was implemented and tested with Linux on the x86_64
architecture. However as only standard system calls for TCP/IP were used, adapting to other
platforms if necessary should be possible.
This extension allows Medley 3.51 running in a Maiko VM to use the XNS services
*Clearinghouse*, *Filing* and *Printing* provided by Dodo (using the *Mail* service may
also be possible, but this was not verified so far)
## Building Maiko with Dodo-networking support
As long as Dodo-networking support is not merged into the `master`-branch
of the primary Maiko repository, this networking option is only available in this
clone of the original Maiko repository in the branch `dodo-nethub-support`.
(however: this branch should already be checked out if this file is present)
The Dodo-networking support is enabled by defining `MAIKO_ENABLE_NETHUB`
when compiling Maiko. This can be done in the Makefile for the relevant platform
(file `bin/makefile-`*platform*) for example in the line where the compiler-command
variable is defined.
This is already done in the Makefile for the *Linux-x86_64-X* platform (file
`bin/makefile-linux.x86_64-x`), where the compiler-command defined as follows:
```
CC = clang -m64 $(CLANG_CFLAGS) -DMAIKO_ENABLE_NETHUB
```
After a complete (re-)build, this Maiko VM optionally allows to connect to a Dodo Nethub
and through this to use Dodo XNS services.
## Running Maiko with Dodo-networking
With Dodo-networking support compiled in, Maiko (i.e. the program `ldex`) accepts the
following additional commandline options:
- `-nh-host` *dodo-host*
the name or IP-address of the host where the Dodo Nethub program runs; no connection to
Dodo services will be opened if this option is not specified
Default: (*none*)
- `-nh-port` *port-number*
the port which the Dodo Nethub is listening to at *dodo-host*
Default: `3333`
- `-nh-mac` *machine-id*
the machine-id (aka. MAC-address) that this Maiko VM instance will use in the Dodo network;
the machine-id must be given as 48 bit hexadecimal value with a dash as byte-separator, i.e.
in the format *XX-XX-XX-XX-XX-XX* (with *XX* the hexcode for a single byte)
Default: `CA-FF-EE-12-34-56`
- `-nh-loglevel` *log-level*
the detail level of logging to `stdout`, one of:
`0`: log only main events (connect, disconnect or the like)
`1`: log network events each with a single line
`2`: detailled log of network events
Default: `0`
So by default Maiko will not connect to a Dodo nethub and behave like a "standard" version
without networking support.
To use Dodo XNS services, the option `-nh-host` must be given to specify the location
of the Dodo nethub. In the simplest (and probably most usual) case where Dodo is run on the
same machine as Maiko/Medley, the value for option `-nh-host` will be *localhost*, so
adding the option `-nh-host localhost` when starting the Medley Lisp system will allow
to use the XNS services of a Dodo system running locally.
Specifying the *machine-id* is optional unless more than one Maiko/Medley instances are to use
Dodo XNS services concurrently: in this case, each Maiko VM *must* use a *unique* machine-id,
so at most one Maiko VM may omit the `-nh-mac` option.
However, each machine-id used by the Maiko VMs should have an entry in the `machine.cfg`
file of the Dodo installation, cloning or copying the low-level SPP-configuration of the
`maiko-Lisp-One` example entry in the `machine.cfg` of the Dodo `dist.zip`
distribution.