Re: [hatari-devel] Network support for Hatari

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


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

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: http://tho-otto.de/download/hatari-mint.zip <http://tho-otto.de/download/hatari-mint.zip>

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

- 192.168.1.1 for the router

- 192.168.1.2 for the host

- 192.168.1.7 for the Hatari instance.

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

c:/mint/network.cnf

c:/etc/resolv.conf

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 https://www.atari-forum.com/viewtopic.php?p=416923#p416923 <https://www.atari-forum.com/viewtopic.php?p=416923#p416923> )

- 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).


Hi

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.

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/