[Rpcemu] Config-free networking work-in-progress (was: Patch for 0.9.1 - Mac keyboard support)

David Gee dr.david.gee at outlook.com
Wed Nov 21 06:07:11 PST 2018

The Mac emulator BasiliskII uses slirp for networking. It doesn't require setting up. It's open source so it may be easier than QEMU (or it may just use the same code).

David Gee

On 21 Nov 2018, at 12:45, Theo Markettos <theo at markettos.org.uk<mailto:theo at markettos.org.uk>> wrote:

On Tue, Nov 20, 2018 at 10:08:40PM +0000, Theo Markettos wrote:
There are also things like: https://github.com/zhuhaow/NEKit that build on
top of NETunnelProvider and handle the entitlement, like you do with

Shortly after writing that post, I had a better idea.

QEMU uses a library called SLIRP, which contains its own ethernet stack,
including servers to do DHCP, DNS, etc.  When a QEMU VM wants to use the network,
the default mode is to push packets into SLIRP which will NAT them and emit
them from the QEMU app as if they were native connections.  This enables
no-setup networking for QEMU VMs, and it's the default way that QEMU uses.
In principle, doing the same for RPCEmu would allow no-setup networking
across all the platforms it supports.

QEMU's source code is not pleasant to work with (I have the scars), but
somebody has done libslirp, which is the SLIRP code ripped out into a
separate library with an easy-to-use interface:
(it's mostly GPL as RPCEmu is)

Since I had a spare couple of hours, I plugged libslirp into RPCEmu as a new
'NAT' networking type, just in the Linux code for now as a proof of concept.
Currently it doesn't work - transmitted packets go into libslirp but none
are received from it as network_plt_rx() is never called to fetch them,
probably because I need to understand how the RPCEmu network card does
interrupts.  libslirp can either do a synchronous receive call, or a file
descriptor via poll() or select().

As I don't know when I'll next get time to work on this, I've put the
code up here:
in case anyone gets around to taking a look before me.


RPCEmu mailing list
RPCEmu at riscos.info<mailto:RPCEmu at riscos.info>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20181121/d1a7e42a/attachment.html>

More information about the RPCEmu mailing list