VOGONS


DOSBox-X on macOS Sierra: Networking?

Topic actions

Reply 21 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie

In fact DOSBox-X cannot patch libpcap for macOS, since its compiled by aapl and only binary delivered.
But in fact we can emulate same modification by modify DOSBox-X code:

diff --git a/src/hardware/ne2000.cpp b/src/hardware/ne2000.cpp
index 16703ea4e..d35ea7402 100644
--- a/src/hardware/ne2000.cpp
+++ b/src/hardware/ne2000.cpp
@@ -1666,7 +1666,7 @@ public:
65536, // portion of the packet to capture
// 65536 = whole packet
true, // promiscuous mode
- -1, // read timeout
+ 2250, // read timeout
errbuf // error buffer
) ) == NULL)

Dont' ask me why it works, or I will send PR 3 years before:) Its just a transform of the original patch.

Reply 22 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
palxex wrote:
In fact DOSBox-X cannot patch libpcap for macOS, since its compiled by aapl and only binary delivered. But in fact we can emulat […]
Show full quote

In fact DOSBox-X cannot patch libpcap for macOS, since its compiled by aapl and only binary delivered.
But in fact we can emulate same modification by modify DOSBox-X code:

diff --git a/src/hardware/ne2000.cpp b/src/hardware/ne2000.cpp
index 16703ea4e..d35ea7402 100644
--- a/src/hardware/ne2000.cpp
+++ b/src/hardware/ne2000.cpp
@@ -1666,7 +1666,7 @@ public:
65536, // portion of the packet to capture
// 65536 = whole packet
true, // promiscuous mode
- -1, // read timeout
+ 2250, // read timeout
errbuf // error buffer
) ) == NULL)

Dont' ask me why it works, or I will send PR 3 years before:) Its just a transform of the original patch.

OK, now how do I modify this? I went to the file and edited it manually. Then compiled dosbox-x. Then I ran Dosbox as root with a disk image of Win95 and was checking the console while the system booted. Network list addresses still came with no description, no device to use for.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 23 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie
bfcastello wrote:
palxex wrote:
In fact DOSBox-X cannot patch libpcap for macOS, since its compiled by aapl and only binary delivered. But in fact we can emulat […]
Show full quote

In fact DOSBox-X cannot patch libpcap for macOS, since its compiled by aapl and only binary delivered.
But in fact we can emulate same modification by modify DOSBox-X code:

diff --git a/src/hardware/ne2000.cpp b/src/hardware/ne2000.cpp
index 16703ea4e..d35ea7402 100644
--- a/src/hardware/ne2000.cpp
+++ b/src/hardware/ne2000.cpp
@@ -1666,7 +1666,7 @@ public:
65536, // portion of the packet to capture
// 65536 = whole packet
true, // promiscuous mode
- -1, // read timeout
+ 2250, // read timeout
errbuf // error buffer
) ) == NULL)

Dont' ask me why it works, or I will send PR 3 years before:) Its just a transform of the original patch.

OK, now how do I modify this? I went to the file and edited it manually. Then compiled dosbox-x. Then I ran Dosbox as root with a disk image of Win95 and was checking the console while the system booted. Network list addresses still came with no description, no device to use for.

I'm not sure the emulated NE2000 hardware could be detected by emulated windows, since I don't have one. What I could verify is FreeDOS fdnpkg/ping works - wattcp/mtcp stack both works, on packet driver.
Some point:
0. add [ne2000] block in dosbox.conf, remember the macaddr. my:

[ne2000]
ne2000=true
nicbase=300
nicirq=3
macaddr=AC:DE:48:88:99:AA
realnic=en0

1. run with root.
2. passthrough an LAN interface like en0(realnic), WLAN never works.
3. ignore the "(no description)", as network already work.( on my machine, without this patch - like dosbox-x official macOS build, will complains 'Unable to open the interface: en0: BIOCSRTIMEOUT: Invalid argument.' after this line )
4. in DOSBox shell, run ne2000 packet driver(ne2000.com 0x60 3), and ensure the MAC got is same as step 0, not FF:FF:FF:FF:FF:FF ( on my machine without this patch will get it every time) - or the configuration FAILED, check dosbox-x build and/or your configuation again.
Once done, another limitation: direct IP access never works. for example, ping google.com will work and ping 192.168.1.1 will not. After compare to windows version, seems it's a limitation on root permission( normal run no such limit, run with administrator has ), but on macOS we don't have choise.

The attachment capture.png is no longer available

On Windows I'm not sure whether you need to manual load the packet driver and windows able to use it( either directly or via shims ), or Windows will able to install a NDIS driver for it. Good luck:)
found a tutorial on DOSBOX+Win95+NE2000: ftp://elanda.kiev.ua/Games/Arh/Zed/db/DOCS/SV … /db_ne2000.html

Reply 24 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

I am still getting FF:FF:FF:FF:FF:FF. Even when I run as sudo.

Unless I have compiled it wrong (both SDL1 and SDL2 versions of DosBox-X) I see no reason why it should fail on me.

Before I went for DOSBox, I tried VirtualBox 6.0.4, network does work there easily but the sound is terrible, choppy. Something is broken in VirtualBox's SB16 emulation.

It also works on VMWare Fusion (my fav option) but there is no sound (Fusion does not have SB16 emulation, only Ensoniq Audio PCI cards like the ES1371 and there is no Win 3.x drivers for these). I haven't tried QEMU because it looked far more complicated than DOSBox to set up.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 25 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie

My compilation is SDL2. This patch works for me since Sierra, till Mojave - but I'm not sure whether it has relation with hardware, just tested on my mac mini 2012.
Could you upload your dosbox-x git hash, patched ne2000.cpp, config.log, dosbox.conf and `dosbox-x --debug` output for further analysis?

Reply 26 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
palxex wrote:

My compilation is SDL2. This patch works for me since Sierra, till Mojave - but I'm not sure whether it has relation with hardware, just tested on my mac mini 2012.
Could you upload your dosbox-x git hash, patched ne2000.cpp, config.log, dosbox.conf and `dosbox-x --debug` output for further analysis?

I had deleted the files thinking it wouldn't work, but I can compile again and try again just to get these files for you, after my work tonight.

But hum... git hash?

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 27 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie

By `git hash` I mean the git commit id:) Which resides on top of git log. I thought you clone the official dosbox-x github repo, if not, please tell me the source tarball name.

Reply 28 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
bfcastello wrote:
palxex wrote:

My compilation is SDL2. This patch works for me since Sierra, till Mojave - but I'm not sure whether it has relation with hardware, just tested on my mac mini 2012.
Could you upload your dosbox-x git hash, patched ne2000.cpp, config.log, dosbox.conf and `dosbox-x --debug` output for further analysis?

I had deleted the files thinking it wouldn't work, but I can compile again and try again just to get these files for you, after my work tonight.

But hum... git hash?

OK, I'm home, just sat in front of my computer right now. Let's see...

I cloned (and also tried downloading the tarball before) this one:
The 'master' branch, https://github.com/joncampbell123/dosbox-x and commit hash I think it is b6c1394 it seems.

I'll provide the other files in some minutes, need to try to compile again for the log and debug files. Where is the config.log ?

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 29 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
palxex wrote:

By `git hash` I mean the git commit id:) Which resides on top of git log. I thought you clone the official dosbox-x github repo, if not, please tell me the source tarball name.

Here are the files. https://we.tl/t-lIP5u5xw8y

I had trouble tonight trying to clone it, every time I tried it was returning an error, so I got the tarball and compiled.

I just couldn't get the dosbox --debug, No idea how to. Sry

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 30 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie
bfcastello wrote:
Here are the files. https://we.tl/t-lIP5u5xw8y […]
Show full quote
palxex wrote:

By `git hash` I mean the git commit id:) Which resides on top of git log. I thought you clone the official dosbox-x github repo, if not, please tell me the source tarball name.

Here are the files. https://we.tl/t-lIP5u5xw8y

I had trouble tonight trying to clone it, every time I tried it was returning an error, so I got the tarball and compiled.

I just couldn't get the dosbox --debug, No idea how to. Sry

OK, the provided logfile is already debug output.
I've found the problem. So seems you're manually appling patch, but misunderstand the patch syntax. The line that began with minus means the original line(to be patch), and those began with plus means new added(patched). In code, the patch expected to patch the non-win32 part, but you modified the win32 part, which does nothing for macOS - that's why BIOCSRTIMEOUT error is observed, as official version 🙁 Next time please save patch as file and let the CLI patch utility handles it.
I've uploaded correctly patched ne2000.cpp, please replace it directly.

Reply 31 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
palxex wrote:
OK, the provided logfile is already debug output. I've found the problem. So seems you're manually appling patch, but misunderst […]
Show full quote
bfcastello wrote:
Here are the files. https://we.tl/t-lIP5u5xw8y […]
Show full quote
palxex wrote:

By `git hash` I mean the git commit id:) Which resides on top of git log. I thought you clone the official dosbox-x github repo, if not, please tell me the source tarball name.

Here are the files. https://we.tl/t-lIP5u5xw8y

I had trouble tonight trying to clone it, every time I tried it was returning an error, so I got the tarball and compiled.

I just couldn't get the dosbox --debug, No idea how to. Sry

OK, the provided logfile is already debug output.
I've found the problem. So seems you're manually appling patch, but misunderstand the patch syntax. The line that began with minus means the original line(to be patch), and those began with plus means new added(patched). In code, the patch expected to patch the non-win32 part, but you modified the win32 part, which does nothing for macOS - that's why BIOCSRTIMEOUT error is observed, as official version 🙁 Next time please save patch as file and let the CLI patch utility handles it.
I've uploaded correctly patched ne2000.cpp, please replace it directly.

Jesus Christ, I really misunderstood it. Epic facepalm for me. I'll test it right now. You're right... I didn't understand the syntax - I am not really familiar with it. I'm a designer, not a programmer ( I was one, when I was very young and had motivation) but my passion for design was bigger than programming 😜

Thank you so much for your help. It's great when there is a community with people that share together the same passion for retro computing 😀

I have just another question, more like a doubt... I normally do my things more on my iPad Pro than my current desktop Hackintosh (which is really just a Dell G7 dual-booting W10 and macOS Mojave, and I rarely use it). I have iDOS2 from litchie's GitHub repo on my iPad Pro (at least I compiled something correctly, hurrah) and I noticed two things: There are some iOS apps that do some packet capture work, so from my logic could the ne2000 patch be modified to work with the version of DOSBox that exists in iDOS2 too? Currently, for iDOS2 to connect to the internet, I have to run a script on my rPi3, then on iDOS2 with WFW311 and Winsock, I can connect to the internet through the rPi3. Works great, but I would rather not have to turn on my rPi3 just for that...

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 32 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

Oh... seems that there is an error when I run the ./build-macosx :

In file included from ne2000.cpp:58:
In file included from /usr/include/pcap.h:43:
/usr/include/pcap/pcap.h:544:12: fatal error: 'remote-ext.h' file not found
#include <remote-ext.h>
^~~~~~~~~~~~~~
1 error generated.
make[4]: *** [ne2000.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

EDIT: Seems that your ne2000.cpp is different from the one in dosbox-x, so I decided to try and patch it again by myself following your observation and this time it seems to be working, I am yet to install the TCP/IP stuff to test but NE2000.COM 0x60 3 reported the correct macaddr this time!

EDIT2: I decided to compile again with SDL1.x instead of SDL2. SDL2 only supports overlay=surface, I needed OpenGL. (Yes, I know that Apple is pushing Metal against OpenGL in macOS. "surface" isn't bad when I use HDPI, except when I am on fullscreen mode, then the image gets centered on my 40" TV screen. Right, this isn't bad either. I'll keep playing with the SDL1.x compiled version for now.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 33 of 39, by palxex

User metadata
Rank Newbie
Rank
Newbie

Glad it works:)
I've to say I'm not a network guru:( This patch is just a transform, when I found libpcap on macOS cannot modify, I turned to the linux one(which is open source), found the to_ms parameter will just be converted and filled with the needed value that the original patch specified, and it turns follow same transform on macOS.
In fact I don't even know why this patch could not work with Wifi. I guess its caused by some key difference between IEEE802.3 and 802.11 packet, but I don't have enough experience on bridging them.

Last edited by palxex on 2019-03-21, 02:01. Edited 1 time in total.

Reply 34 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie
palxex wrote:

Glad it works:)
I've to say I'm not a network guru:( This patch is just a transform, when I found libpcap on macOS cannot modify, I turned to the linux one(which is open source), found the to_ms parameter will just be converted and filled with the needed value that the original patch specified, and it turns follow same transform on macOS.
In fact I don't even know why this patch could not work with Wifi. I guess its caused by some key difference between IEEE801.3 and 801.11 packet, but I don't have enough experience on bridging them.

Indeed, it doesn't work with wifi. Once I took my laptop off ethernet cable, and tried to run dosbox with WFW311 networking, WFW will crash. Oh well...

What happens is when I try to run with wifi, WFW311 will crash, first black screen after the splash screen, then I get a BSOD complaining about DHCP.

I'd try on Virtualbox since it's a great and free option, but VBox does not emulate well the SB16 card. There is some crackling sound instead of the original sounds being played. Older VBox versions used to do it well, but since 5.2.x it's broken. I cannot downgrade VirtualBox because Mojave does not let me run them.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 35 of 39, by ttimpe

User metadata
Rank Newbie
Rank
Newbie

I'm running Big Sur now, is it possible to get networking running in WfW 3.11? I have already set up the config file as follows:

[ne2000]
ne2000=true
nicirq=10
realnic=en0
nicbase=300
macaddr=6e:bd:32:da:ae:e1

Running dosbox-x as root with this config file still doesn't allow Windows to enable networking (using the NE 2000 Compatible driver, IRQ10 and base address 300.

Is there anything else I need to set up?

Reply 36 of 39, by Bruninho

User metadata
Rank Oldbie
Rank
Oldbie

This only works with an ethernet connection. If the host machine is using wifi, it won't work. Only ethernet.

"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
READ: Right to Repair sucks and is illegal!

Reply 38 of 39, by ttimpe

User metadata
Rank Newbie
Rank
Newbie

I am not using WiFi, this machine is just connected via a regular old Ethernet cable.