Re: [hatari-devel] Network support for Hatari

[ Thread Index | Date Index | More Archives ]

Le 10/05/2021 à 13:24, Thorsten Otto a écrit :

the attached patch implements the ETHERNET native feature as it is implemented in ARAnyM, which should make it possible to use network functions when runnning mint (it uses the same nfeth.xif, no changes are needed there).

To test this, i've also made an hardisk image with some rudimentry tools that boots straight into Mint: <>

The archive also includes the config file. This may need some changes regarding the ip addresses i'm using:

- for the router

- for the host

- for the Hatari instance.

Unfortunately similar changes will be needed also in some files on the harddisk image:



and in the script i use to bring up the bridge (attached below)

Some other notes:

- the harddisk image contains a freshly compiled mint kernel, with changes that are already pushed to the repo, but (due to bintray closing) are not yet downloadable as snapshots.

- In aranym, 2 small helper tools are used for certain configurations (aratapif and bpf_helper), which are not part of the patch. However that are independent programs, and i don't expect much problems to integrate them, but i'm just not very used to cmake to do that cleanly.

- ARAnyM uses AutoVector Interrupt #3 for the reception thread, and calls TriggerInt3() for this purpose. In Hatari, i translated that to a call to M68000_Exception(), i hope this is the right thing to do (but seems to work, as seen in <> )

- no attempt is currently made to save/restore the state from snapshots, since i have no idea how to do that since open file descriptos are involved

- There seems to be a leak on the thread, which is not killed when resetting the emulator (this is also present in aranym). Looks like there is no SDL_KillThread() function in SDL2 anymore?

- I have only tested it on linux so far, but verified that the sources for win32/macos compile at least

- i also tried to avoid some of the c++isms (like declaration-after-statement), but it is possible that i missed some (activating the warning did not work, because that spits out also lots of warnings from header files).

- the ethernet_darwin.c is an older implementation, which imho isn't used anymore (ARAnyM also unconditionally defines ENABLE_BPF for macOS, which causes the newer implementation to be used).


thanks for your work ; Unfortunately, I don't use Mint myself, so I can't comment whether it works OK or not, but I'm sure other users will have a look

Just a small note regarding files : I see several ethernet*.c files with your patch, maybe we could create an "ethernet_drivers" (or whatever name) directory and group them all in one place ? I think it makes the source tree easier to browse when specific parts consisting of several files (like cpu emulation) are grouped in a single place.


Mail converted by MHonArc 2.6.19+