Optional: ne2000 patch (WIP)

Discussion of development and patch submission.
Post Reply
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Optional: ne2000 patch (WIP)

Post by SA1988 »

I know it isn't of high priority at the current time, but it would be good a suggestion for some users.

https://mega.co.nz/#!cMUy1Y4I!Q-CZToc76 ... JUFsJ2pkb4

Please notice that the patch is a WIP so don't be harsh.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Optional: ne2000 patch (WIP)

Post by ppgrainbow »

The patch looks pretty good so far.

Even though the networking capabilities are not high priority, would it be also possible to implement SLiRP networking?

Bochs recently has SLiRP networking since Bochs 2.6.5 and it's working good so far.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Optional: ne2000 patch (WIP)

Post by SarahWalker »

When I said it was low priority, I meant I wasn't going to spend time on it. If you're going to develop this though, without me having to do anything, then I'm very happy to take the patches!

Couple of minor suggestions (based on a VERY quick look at the patch) :
* Can you ensure the files from QEMU are in their own directory, similar to how the DOSBox OPL code is?
* Please remove the whitespace changes from the patch. It's just noise, making it more difficult to see what you've changed.
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

Finally, networking!
In case of that the CMPXCHG8B instruction is added, could both PNP and non-PNP versions be supported, XP only supports the PNP version, 2000 supports both.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

https://github.com/TC1995/src-9 placeholder, until it gets fully working (that is, connecting to the internet from within the emulator) and getting to the upstream one.
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

SA1988 wrote:https://github.com/TC1995/src-9 placeholder, until it gets fully working (that is, connecting to the internet from within the emulator) and getting to the upstream one.
I cannot compile your build of PCem, the compiler crashes with a fatal error when ne2000.c (or .h) links to pcap.h, which does not exist.
AnnaWu
Posts: 44
Joined: Mon 12 May, 2014 6:10 pm
Location: Germany
Contact:

Re: Optional: ne2000 patch (WIP)

Post by AnnaWu »

WinPcap is necessary.
I guess you need the WinPcap Developer's Pack (WpdPack).
A note about it on the GitHub server can be helpful.

Image
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

AnnaWu wrote:WinPcap is necessary.
I guess you need the WinPcap Developer's Pack (WpdPack).
A note about it on the GitHub server can be helpful.

Image
Added WinPCap .h and .c files to the folder, still throws the error.
Still unable to get the thing to compile.
AnnaWu, send me the compiled version please.

More speciffically, I need a file called pcap/pcap.h (exactly like that)
Actually, just send me the exact source (including Pcap) that you compiled from AnnaWu.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

Finished updating my ne2000 patchset (for now)

https://mega.co.nz/#!QF11VJRD!uKJ7UiEQ2 ... EUyaPfO7yQ
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Optional: ne2000 patch (WIP)

Post by ender »

Here's my compile: http://eternallybored.org/misc/pcem/
Image

Set netinterface = 255 in pcem.cfg, run PCem.exe once (it'll exit immediately) and check pclog.txt for the list of your physical interfaces. Set netinterface to the number of physical interface you want to share with PCem before running it again.
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

ender wrote:Here's my compile: http://eternallybored.org/misc/pcem/
Image

Set netinterface = 255 in pcem.cfg, run PCem.exe once (it'll exit immediately) and check pclog.txt for the list of your physical interfaces. Set netinterface to the number of physical interface you want to share with PCem before running it again.
For me it instantly crashes with no error log generated.
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Optional: ne2000 patch (WIP)

Post by ender »

Try to download again, I updated my compiler and recompiled (also made it unconditionally print the list of network interfaces; you can still set netinterface = 255 for PCem to exit after printing them though).
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

ender wrote:Try to download again, I updated my compiler and recompiled (also made it unconditionally print the list of network interfaces; you can still set netinterface = 255 for PCem to exit after printing them though).
I got it all set up, but in 98SE, I cannot use the network at all.
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Optional: ne2000 patch (WIP)

Post by ender »

In Windows 2000, while the network card was detected automatically (by the Add New Hardware wizard), I had to set the IRQ myself (Windows defaulted to 3, while it was set to 10 in PCem).
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

ender wrote:In Windows 2000, while the network card was detected automatically (by the Add New Hardware wizard), I had to set the IRQ myself (Windows defaulted to 3, while it was set to 10 in PCem).
I set the IRQ to 10 in 98SE, and the address to the correct one, so the drivers properly started.
But I can't browse my network nor the internet in PCem.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

if you don't want to deal with winpcap's installer, use Wireshark (it includes the latest release of winpcap)
AnnaWu
Posts: 44
Joined: Mon 12 May, 2014 6:10 pm
Location: Germany
Contact:

Re: Optional: ne2000 patch (WIP)

Post by AnnaWu »

ender wrote:In Windows 2000, while the network card was detected automatically (by the Add New Hardware wizard), I had to set the IRQ myself (Windows defaulted to 3, while it was set to 10 in PCem).
On Win95 the same, NE2000 compatible card detected.
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

AnnaWu wrote:
ender wrote:In Windows 2000, while the network card was detected automatically (by the Add New Hardware wizard), I had to set the IRQ myself (Windows defaulted to 3, while it was set to 10 in PCem).
On Win95 the same, NE2000 compatible card detected.
98SE same, but network can't be used for some strange reason:
Config:
SiS 496/497
Am5x86/P75
24 MB RAM
NE2000, IRQ 10, address 0x300
504 MB hard disk
98SE (no updates)
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

have you set the network interface number that matches the host number of your physical network interface? (No Microsoft Loopback or VMware or VirtualBox host-only interfaces)
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

SA1988 wrote:have you set the network interface number that matches the host number of your physical network interface? (No Microsoft Loopback or VMware or VirtualBox host-only interfaces)
I set it to 3, which is my physical one (used by my actual networK).
Still not working.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

nerd73 wrote:
SA1988 wrote:have you set the network interface number that matches the host number of your physical network interface? (No Microsoft Loopback or VMware or VirtualBox host-only interfaces)
I set it to 3, which is my physical one (used by my actual networK).
Still not working.
ok, have you manually set the IP address, DNS and Gateway as well inside the guests of PCem (Win98SE in your case, check winipcfg.exe to see the configuration of TCP/IP, which is vital for the Internet to work).
nerd73
Posts: 116
Joined: Wed 24 Sep, 2014 11:16 pm

Re: Optional: ne2000 patch (WIP)

Post by nerd73 »

SA1988 wrote:
nerd73 wrote:
SA1988 wrote:have you set the network interface number that matches the host number of your physical network interface? (No Microsoft Loopback or VMware or VirtualBox host-only interfaces)
I set it to 3, which is my physical one (used by my actual networK).
Still not working.
ok, have you manually set the IP address, DNS and Gateway as well inside the guests of PCem (Win98SE in your case, check winipcfg.exe to see the configuration of TCP/IP, which is vital for the Internet to work).
No. But I can use ipconfig to find those out.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

ipconfig isn't on Win98SE, its functionality is in winipcfg (ipconfig is used on NT and successors, including Win7, 8, 8.1 and the in-development 10).
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Optional: ne2000 patch (WIP)

Post by ender »

Just installed Win98SE, network works for me:
Image

(ipconfig is present in Win98, but I encountered a glitch running it)
therock247uk
Posts: 29
Joined: Fri 25 Apr, 2014 2:55 pm

Re: Optional: ne2000 patch (WIP)

Post by therock247uk »

/me wonders how hard it would be to made a slirp for pcem? or allowing it to work with wifi connections somehow: i read this http://www.vogons.org/viewtopic.php?f=3 ... ss#p242415 but i doubt its that easy.
amadama
Posts: 57
Joined: Mon 25 Aug, 2014 9:47 pm

Re: Optional: ne2000 patch (WIP)

Post by amadama »

Image

Works fantastic with Windows for Workgroups 3.11
Great patch! Great addition to a great emulator!
Thanks!
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Optional: ne2000 patch (WIP)

Post by ender »

Interesting, I haven't been able to get it to work with Windows 3.11 (neither with Microsoft TCP/IP-32, nor with Trumpet Winsock).
amadama
Posts: 57
Joined: Mon 25 Aug, 2014 9:47 pm

Re: Optional: ne2000 patch (WIP)

Post by amadama »

Image

First make sure you have the right network configured in your pcem.cfg file.
Then, make sure your NE2000 is configured properly in Windows 3.11 (see screen above)
Also, make sure to use MS TCP32b.exe (the newest ver is found here: http://www.gaby.de/ftp/pub/win3x/tcp32b.exe
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Optional: ne2000 patch (WIP)

Post by SA1988 »

DHCP is fully supported. And remember, guys, this is ported directly from dosbox-x if the wrong irq is set and running successfully (without a yellow mark on win95) (like on PCem's config, irq10 as default, irq5, for example, as set on win95), that's normal, it happens on dosbox-x too, just manually select the irq matching the PCem's config one and you're up to go to the Internet :D.
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Optional: ne2000 patch (WIP)

Post by startmenu »

SA1988 wrote:Finished updating my ne2000 patchset (for now)

https://mega.co.nz/#!QF11VJRD!uKJ7UiEQ2 ... EUyaPfO7yQ
I cannot compile this one. I commit this patch to Rev186 manually.
Maybe there's something wrong with this line in pc.c:

Code: Select all

network_card_current = config_get_int(NULL, "netcard", NE2000);
The compiler (GCC 4.8.1) said, error: expected expression before ')' token.

But when I made that line a comment, the compiler failed to link PCem.exe

Code: Select all

        gfxcard = config_get_int(NULL, "gfxcard", 0);
        video_speed = config_get_int(NULL, "video_speed", 3);
        sound_card_current = config_get_int(NULL, "sndcard", SB2);
	//network_card_current = config_get_int(NULL, "netcard", NE2000);

        p = (char *)config_get_string(NULL, "disc_a", "");
        if (p) strcpy(discfns[0], p);
        else   strcpy(discfns[0], "")
Post Reply