Networking with Hatari?
Moderators: simonsunnyboy, npomarede, thothy, Moderator Team
-
MegaSTEarian
- Atari Super Hero

- Posts: 550
- Joined: Tue Aug 18, 2020 5:23 pm
Networking with Hatari?
Sorry if this has been discussed before, I couldn't find any post.
Is it possible to emulate any kind of network card under Hatari?
Edit:
Found this which is a bit old: https://www.atari-forum.com/viewtopic.php?t=30958, which is MiNT only
and
This: http://www.dest-unreach.org/socat/ not what I am asking though
My question is about Hatari. If it can emulate any network card the same way it emulates Atari hardware.
Is it possible to emulate any kind of network card under Hatari?
Edit:
Found this which is a bit old: https://www.atari-forum.com/viewtopic.php?t=30958, which is MiNT only
and
This: http://www.dest-unreach.org/socat/ not what I am asking though
My question is about Hatari. If it can emulate any network card the same way it emulates Atari hardware.
Re: Networking with Hatari?
I haven't seen any news on this since last time the topic was brought up.
I guess it comes down to what the active developers wants to out their time and efforts into, which is fair. Still, it is imo a great pity that the such a powerful emulator can't do networking, as it would massively extend its uses.
Regards,
/Joakim
I guess it comes down to what the active developers wants to out their time and efforts into, which is fair. Still, it is imo a great pity that the such a powerful emulator can't do networking, as it would massively extend its uses.
Regards,
/Joakim
-
MegaSTEarian
- Atari Super Hero

- Posts: 550
- Joined: Tue Aug 18, 2020 5:23 pm
Re: Networking with Hatari?
True, it would be absolutely useful. I assume Aranym is using some sort of virtual NIC driver to provide networking or reads the hardware when it runs natively.
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
Aranym does not emulate any network card. It just provides some simple functions to give mint the needed information like IP address, and functions to read/write data. In some cases (like on macOS) it also uses a BPF module to rewrite the packets. But all that is much simpler than that what Hatari would have to do, pretending that a network card is accessible at some I/O space, and emulating all its behaviour.
Edit.: implementing the same interface in Hatari as in Aranym would be rather easy: https://github.com/aranym/aranym/blob/m ... hernet.cpp
But then you would need to write a driver for Sting/Stik that makes use of this interface. Maybe that is possible, and surely simpler than emulating real hardware.
Edit.: implementing the same interface in Hatari as in Aranym would be rather easy: https://github.com/aranym/aranym/blob/m ... hernet.cpp
But then you would need to write a driver for Sting/Stik that makes use of this interface. Maybe that is possible, and surely simpler than emulating real hardware.
- Eero Tamminen
- Fuji Shaped Bastard

- Posts: 3899
- Joined: Sun Jul 31, 2011 1:11 pm
Re: Networking with Hatari?
Till's NE2000 emulation for (very old) Hatari version has rather harsh downsides:
- Description: https://github.com/mist-devel/mist-boar ... mory.c#L18
- Implementation: https://github.com/mist-devel/mist-boar ... ory.c#L570
- Dig up some documentation for that HW, and provide SW setup which can be used to test it
- Put the code to a separate (e.g. ne2000.c) file with HW register accesses done through ioMemTab<machine>.c tables. Example of how that works can be seen e.g. from this VME register interception commit: https://git.tuxfamily.org/hatari/hatari ... 743f11d76e
- Find out some way to get it working without needing root access
- Eero Tamminen
- Fuji Shaped Bastard

- Posts: 3899
- Joined: Sun Jul 31, 2011 1:11 pm
Re: Networking with Hatari?
Besides MiNT, also m68k Linux includes NatFeats network driver, which would make Linux much more usable under Hatari. And unlike Till's solution, it would not require root...ThorstenOtto wrote: βWed May 05, 2021 3:34 pm Edit.: implementing the same interface in Hatari as in Aranym would be rather easy: https://github.com/aranym/aranym/blob/m ... hernet.cpp
But then you would need to write a driver for Sting/Stik that makes use of this interface. Maybe that is possible, and surely simpler than emulating real hardware.
(Main use-case for running m68k Linux under Hatari would be making sure that Linux still works on real Atari HW i.e. debugging/profiling.)
Re: Networking with Hatari?
I suppose it would then also be technically possible to do a similar solution, writing a driver targetting mintnet instead, addressing the same interface?ThorstenOtto wrote: βWed May 05, 2021 3:34 pm Edit.: implementing the same interface in Hatari as in Aranym would be rather easy: https://github.com/aranym/aranym/blob/m ... hernet.cpp
But then you would need to write a driver for Sting/Stik that makes use of this interface. Maybe that is possible, and surely simpler than emulating real hardware.
Just goes to show how much easier it is to write a wishlist rather than actual software
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
Such a driver already exists: https://github.com/freemint/freemint/tr ... /xif/nfeth
This is what Aranym uses, and what could also be used for Hatari if the same interface is implemented there.
But on Hatari, you typically run plain TOS, not MiNT, that's why it may be neccessary to also write a driver for STinG.
Re: Networking with Hatari?
Ok, that makes sense, I didn't realize it may even be reused like that - very interesting. If the same interface would be available under Hatari, I would absolutely be (mainly) interested in using it with MiNT.
-
simonsunnyboy
- Moderator

- Posts: 5775
- Joined: Wed Oct 23, 2002 4:36 pm
- Location: Friedrichshafen, Germany
- Contact:
Re: Networking with Hatari?
Sting and its ancestor STiK use a sort of memorymapped interface and system call.
Hatari could provide a this as "hardware" registers and an additional small ROM somewhere.
Then only some cookies and detection must be handled from a TOS side driver.
Hatari could provide a this as "hardware" registers and an additional small ROM somewhere.
Then only some cookies and detection must be handled from a TOS side driver.
Simon Sunnyboy/Paradize - http://paradize.atari.org/
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
-
MegaSTEarian
- Atari Super Hero

- Posts: 550
- Joined: Tue Aug 18, 2020 5:23 pm
Re: Networking with Hatari?
simonsunnyboy wrote: βFri May 07, 2021 3:11 pm Sting and its ancestor STiK use a sort of memorymapped interface and system call.
Hatari could provide a this as "hardware" registers and an additional small ROM somewhere.
Then only some cookies and detection must be handled from a TOS side driver.
This is what I was thinking pretty much. Could be anything that has software support on TOS/MiNT and would be emulated on the hardware level.
A possible solution would be emulating NetUSBee (all or part of it) as it combines lots of stuff, has current drivers and goes into the cartridge slot that's already emulated and it is contemporary and info can be found. unfortunately I am not much of a programmer so not able to assist in this.
Re: Networking with Hatari?
Although, let's assume that someone would add to Hatari the same fundamental natfeat network interface as the one in aranym, there would then be a ready-to-use driver for mintnet already waiting - if so, then it would seem more logical to me (and maybe involving less work) to do a stik/sting driver stand-alone as well, addressing the network interface of Hatari the same way as the mintnet driver would.simonsunnyboy wrote: βFri May 07, 2021 3:11 pm Sting and its ancestor STiK use a sort of memorymapped interface and system call.
Hatari could provide a this as "hardware" registers and an additional small ROM somewhere.
Then only some cookies and detection must be handled from a TOS side driver.
In my mind it would seem more tidy to have each driver (be it mintnet or stik) connecting the same way to the same networking interface within Hatari, rather than having one of them sort of built-in, but I could be missing some aspect of it for sure.
-
simonsunnyboy
- Moderator

- Posts: 5775
- Joined: Wed Oct 23, 2002 4:36 pm
- Location: Friedrichshafen, Germany
- Contact:
Re: Networking with Hatari?
I have no idea what would be easier. Write a complete Sting driver from scratch or something halfway only?
As a user I would prefer something more native than Netusbee emulation. The latter is slow over the cratridge port and I assume emulating this special behaviour is way more complicated than adding such a Netfeats networt interface.
As a user I would prefer something more native than Netusbee emulation. The latter is slow over the cratridge port and I assume emulating this special behaviour is way more complicated than adding such a Netfeats networt interface.
Simon Sunnyboy/Paradize - http://paradize.atari.org/
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
The problem to emulate something that uses the cartridge slot is that it prevents the GEMDOS emulation to be used at the same time, since Hatari also uses the cartridge for that.MegaSTEarian wrote: βFri May 07, 2021 3:46 pm has current drivers and goes into the cartridge slot that's already emulated
I'm working on it. But may take some time since i don't have a working mint installation for Hatari currently.Although, let's assume that someone would add to Hatari the same fundamental natfeat network interface as the one in aranym,
Re: Networking with Hatari?
That is awesome news, please keep us postedThorstenOtto wrote: βSat May 08, 2021 6:01 am
I'm working on it. But may take some time since i don't have a working mint installation for Hatari currently.Although, let's assume that someone would add to Hatari the same fundamental natfeat network interface as the one in aranym,
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
Now that my network works again, i'm making a bit progress:
There you can see Hatari running a (slightly hacked) 030 MiNT kernel, pinging the host it is running on.
I wished i could show a picture running netsurf, but unfortunately it crashes a with bus-error
PS.: if someone wants to experiment with a MiNT setup for Hatari, i've made available a harddisk image file + config for it: http://tho-otto.de/download/hatari-mint.zip
There you can see Hatari running a (slightly hacked) 030 MiNT kernel, pinging the host it is running on.
I wished i could show a picture running netsurf, but unfortunately it crashes a with bus-error
PS.: if someone wants to experiment with a MiNT setup for Hatari, i've made available a harddisk image file + config for it: http://tho-otto.de/download/hatari-mint.zip
You do not have the required permissions to view the files attached to this post.
-
MegaSTEarian
- Atari Super Hero

- Posts: 550
- Joined: Tue Aug 18, 2020 5:23 pm
Re: Networking with Hatari?
ThorstenOtto wrote: βSun May 09, 2021 5:58 pm Now that my network works again, i'm making a bit progress:
Screenshot_20210509_185949.png
There you can see Hatari running a (slightly hacked) 030 MiNT kernel, pinging the host it is running on.
I wished i could show a picture running netsurf, but unfortunately it crashes a with bus-error
PS.: if someone wants to experiment with a MiNT setup for Hatari, i've made available a harddisk image file + config for it: http://tho-otto.de/download/hatari-mint.zip
Looks promising!
(image downloaded, thanks for that as well
Re: Networking with Hatari?
It is so cool there is already progress on this, keep up the good work!ThorstenOtto wrote: βSun May 09, 2021 5:58 pm Now that my network works again, i'm making a bit progress:
Screenshot_20210509_185949.png
There you can see Hatari running a (slightly hacked) 030 MiNT kernel, pinging the host it is running on.
I wished i could show a picture running netsurf, but unfortunately it crashes a with bus-error
PS.: if someone wants to experiment with a MiNT setup for Hatari, i've made available a harddisk image file + config for it: http://tho-otto.de/download/hatari-mint.zip
As for the MiNT setup (thanks for suppying it) I got it up and running but admit it took me a while to understand that the GEMDOS HDD emulation is a no-go under MiNT. I worked around it somewhat by booting into EmuTOS only when I need to transfer files between images and Host OS.
However, I am not successful with trying to enable the extended VDI modes when booting into MiNT/XaAES. Under EmuTOS it works as expected, but when I try it with MiNT/XaAES I always get: "exception 4 for AESSYS pc:FA0028 addr:0".
Could it be related to the missing include file referenced in xaaes.cnf as "include u:/c/mint/xa_video.cnf" by any chance? I seem to recall from back when migrating from my ancient XaAES setup (that was on the Falcon/CT60) to a more recent one, that wrong video settings can really rub XaAES the wrong way..
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
Yes, that's a drawback. Maybe you can try to build your own MinT Kernel with OLDTOSFS defined, that should theoretically allow the GEMDOS emulation to work again. Another (cleaner) alternative would be to also add the HOSTFS native feature to Hatari.
I mount the image on linux in order to populate it. There is only one partition on it, at offset 1024. Just don't forget do unmount it again before starting Hatari, that is likely to corrupt it. Using mtools should also work.I worked around it somewhat by booting into EmuTOS only when I need to transfer files between images and Host OS.
I dont think so, but you can try to replace it with just a "video =" line.Could it be related to the missing include file referenced in xaaes.cnf as "include u:/c/mint/xa_video.cnf" by any chance?
Re: Networking with Hatari?
That made no difference, but I'll look into it some more this evening if time allows. In my previous experiences with XaAES it did seem overly sensitive to changing gfx settings, but I always suspected the ct60-patched TOS for that.ThorstenOtto wrote: βMon May 10, 2021 5:24 am I dont think so, but you can try to replace it with just a "video =" line.
Re: Networking with Hatari?
Ok, got it working now. I had installed NVDI but had totally forgotten that NVDI installer also tosses the infamous WDIALOG.PRG into /AUTO.GokMasE wrote: βMon May 10, 2021 11:54 amThat made no difference, but I'll look into it some more this evening if time allows. In my previous experiences with XaAES it did seem overly sensitive to changing gfx settings, but I always suspected the ct60-patched TOS for that.ThorstenOtto wrote: βMon May 10, 2021 5:24 am I dont think so, but you can try to replace it with just a "video =" line.
Disabling WDIALOG.PRG made XaAES cope with the extended VDI modes.
However, to get fully back on topic again - will the upcoming network support be available under Hatari regardless of the host OS? (I mean, will it work even if Hatari is running on Windows or Mac OS?)
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
Theoretically, yes, since (from the emulator side) its the same as in ARAnyM, and there it is supported. But i have not tried that yet (IIRC, you need a wintap driver for Windows)
-
MegaSTEarian
- Atari Super Hero

- Posts: 550
- Joined: Tue Aug 18, 2020 5:23 pm
Re: Networking with Hatari?
Thanks @ThorstenOtto.Wondering what it would take for a NIC to be available under TOS as well.
-
ThorstenOtto
- Fuji Shaped Bastard

- Posts: 3329
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Networking with Hatari?
As noted above, a driver for STinG maybe. I'm working on that, too. But i since i never used STinG directly, i could need some advice in how to set it up, and what application i can use for testing.
