Networking discussion

Discussion of development and patch submission.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: v10 rough timetable

Post by neozeed »

ppgrainbow wrote:
te_lanus wrote:Another "Feature" I'd like to see is that PCem "remembers" more intelligently where stuff is stored. IE Hdd's is under I:\Emu\PCem\Hdd and Floppies is under G:\Backup\Emu\PC\.

would be great if you use the floppy selector ant it opens where last you opened a floppy, and the same with the HDD selector. Currently it uses whatever was opened last.
I agree.

I have added support for the CT486 machine (AMI 486 clone with the CS4031 chipset) using XTIDE option ROM and Bochs BIOS! I also added support for up to 8 IDE hard drives to use with Bochs and XTIDE! :D

I also got word from Neozeed that he is finally going to try to implement SLiRP networking to use with PCem! What do you all think? :D

If SLiRP is successfully implemented and if it does work with PCem, you can expect SLiRP-based networking to be buggy, but if any bugs are found, it will get fixed somehow.

Yeah I have the code all in for slirp, the ne2000 responds enough for the packet driver to find it, but sending frames does nothing, it never fires for some reason, and the poller never runs either.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: v10 rough timetable

Post by ppgrainbow »

neozeed wrote:Yeah I have the code all in for slirp, the ne2000 responds enough for the packet driver to find it, but sending frames does nothing, it never fires for some reason, and the poller never runs either.
Oh dear, that doesn't sound right. I'm wondering if SA1988 or AnnaWu can look into what could be causing the SLiRP-based NE2000 driver to not work correctly.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: v10 rough timetable

Post by neozeed »

Thanks to startmenu for posting that diff, it made it easier to see what goes where...

I didn't touch the resource files, but I do have a preliminary slirp version working.

Image

I can't get this bit to work for the life of me..

Code: Select all

int delay=60*TIMER_USEC;
timer_add(slirp_tic,&delay,TIMER_ALWAYS_ENABLED,NULL);
I would think this would fire the procedure slirp_tic every 60 ms? Anyways even an empty procedure hangs the system. So clearly I'm wrong. Instead I'm resorting to some horrible hack that sits inside the ne2000_poller procedure, something like this:

Code: Select all

fizz++;
if(fizz>60*TIMER_USEC){fizz=0;slirp_tic();}
Since it looks like it fired once every millisecond. Or an incredible amount of times when I logged it!

So it's enough that I can telnet to my OS/2 BBS, and poke around, although the telnet client really leaves a lot to be desired. I need to inject one of those TCP Fossil drivers so I can use a 'real' terminal program.

Obviously the benefit is that this doesn't require any drivers, or other insanity, 'it just works', all in user mode. Things like ftp won't work so don't excited. No you can't ping http://www.google, and if you do a manual IP config it *MUST* be:
ip 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3
If you love to ping, ping 10.0.2.2 which just confirms that SLiRP is alive. It's under a BSD license, since SLiRP is part of the old FreeBSD TCP/IP stack.

Give me a few minutes, and I'll have binaries, and diffs....

Also as a suggestion changing the link libs/flags from:

Code: Select all

LIBS = -mwindows -lwinmm -lalut -lopenal32 -lddraw -ldinput -ldxguid -ld3d9 -lstdc++
to

Code: Select all

LIBS = -mwindows -lwinmm -lalut -lopenal32 -lddraw -ldinput -ldxguid -ld3d9 -lwsock32 -liphlpapi -lstdc++ -static-libstdc++ -static-libgcc -static
Gives an executable that only needs alut.dll, which makes redistribution much easier...

Ok, binary is here, sorry you have to deal with passwords, it's in the 404 (it changed from time to time). :roll:
http://vpsland.superglobalmegacorp.com/ ... 0ece930.7z

And the diff:
http://vpsland.superglobalmegacorp.com/ ... 0ece930.7z

This is for the latest rev, which I think is 318.

Oh and configure your NE2000 for 0x300 IRQ 10 (so I guess no 8bit ISA machines...)

and in the pcem.cfg you need to add the lines:

Code: Select all

netinterface = 1
netcard = 1
Yeah I know. ugh. Setting these to zero disables the card. I have other stuff to do, but playing around with the rc scripts should make it easy enough to change the port/irq, and enable/disable.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

For the 64-bit executable, for statical linking of libraries, you also need to add: -lopenal32.dll . Otherwise, the linker will complain about stuff in soundopenal.c.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: v10 rough timetable

Post by ppgrainbow »

Battler wrote:
ppgrainbow wrote:Like I said, Win10Pcap is not mentioned to be compatible with Windows Vista. I attempted to installed and stated that the operating system (Windows Vista) is not supported...so, I will have to stick with WinPcap. Sorry.
Then use WinPCap on Vista and Win10PCap on 10. Also, I have no problems with it and my wireless adapter on Windows 7.
I have tried to use WinPcap to communicate with the network on PCem, but it didn't work. Infact, Winpcap (and its variants) will not work correctly with most Wi-Fi adapters.
Last edited by ppgrainbow on Sun 23 Aug, 2015 3:44 pm, edited 1 time in total.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

neozeed wrote:Thanks to startmenu for posting that diff, it made it easier to see what goes where...

I didn't touch the resource files, but I do have a preliminary slirp version working.

Image

I can't get this bit to work for the life of me..

Code: Select all

int delay=60*TIMER_USEC;
timer_add(slirp_tic,&delay,TIMER_ALWAYS_ENABLED,NULL);
I would think this would fire the procedure slirp_tic every 60 ms? Anyways even an empty procedure hangs the system. So clearly I'm wrong. Instead I'm resorting to some horrible hack that sits inside the ne2000_poller procedure, something like this:

Code: Select all

fizz++;
if(fizz>60*TIMER_USEC){fizz=0;slirp_tic();}
Since it looks like it fired once every millisecond. Or an incredible amount of times when I logged it!

So it's enough that I can telnet to my OS/2 BBS, and poke around, although the telnet client really leaves a lot to be desired. I need to inject one of those TCP Fossil drivers so I can use a 'real' terminal program.

Obviously the benefit is that this doesn't require any drivers, or other insanity, 'it just works', all in user mode. Things like ftp won't work so don't excited. No you can't ping http://www.google, and if you do a manual IP config it *MUST* be:
ip 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3
If you love to ping, ping 10.0.2.2 which just confirms that SLiRP is alive. It's under a BSD license, since SLiRP is part of the old FreeBSD TCP/IP stack.

Give me a few minutes, and I'll have binaries, and diffs....

Also as a suggestion changing the link libs/flags from:

Code: Select all

LIBS = -mwindows -lwinmm -lalut -lopenal32 -lddraw -ldinput -ldxguid -ld3d9 -lstdc++
to

Code: Select all

LIBS = -mwindows -lwinmm -lalut -lopenal32 -lddraw -ldinput -ldxguid -ld3d9 -lwsock32 -liphlpapi -lstdc++ -static-libstdc++ -static-libgcc -static
Gives an executable that only needs alut.dll, which makes redistribution much easier...

Ok, binary is here, sorry you have to deal with passwords, it's in the 404 (it changed from time to time). :roll:
http://vpsland.superglobalmegacorp.com/ ... 0ece930.7z

And the diff:
http://vpsland.superglobalmegacorp.com/ ... 0ece930.7z

This is for the latest rev, which I think is 318.

Oh and configure your NE2000 for 0x300 IRQ 10 (so I guess no 8bit ISA machines...)

and in the pcem.cfg you need to add the lines:

Code: Select all

netinterface = 1
netcard = 1
Yeah I know. ugh. Setting these to zero disables the card. I have other stuff to do, but playing around with the rc scripts should make it easy enough to change the port/irq, and enable/disable.
It's really awesome to see that you're getting SLiRP networking to work without the use in WinPcap! :D Once it's working, I can't wait to use the networking on my emulated MS-DOS machine!
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: v10 rough timetable

Post by neozeed »

ppgrainbow wrote:
Battler wrote:
ppgrainbow wrote:Like I said, Win10Pcap is not mentioned to be compatible with Windows Vista. I attempted to installed and stated that the operating system (Windows Vista) is not supported...so, I will have to stick with WinPcap. Sorry.
Then use WinPCap on Vista and Win10PCap on 10. Also, I have no problems with it and my wireless adapter on Windows 7.
I have tried to use WinPcap to communicate with the network on PCem, but it didn't work.
pcap won't work with wifi. Just don't go do the road.
therock247uk
Posts: 29
Joined: Fri 25 Apr, 2014 2:55 pm

Re: Networking discussion

Post by therock247uk »

Ive gotten it to work like once with lots of playing around using the loopback adapter even then its a pain. slirp is the way to go.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: v10 rough timetable

Post by ppgrainbow »

neozeed wrote:pcap won't work with wifi. Just don't go do the road.
I have to agree. Winpcap (and its derivatives) will not work correctly, if not at all with most Wi-Fi adapters.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

therock247uk wrote:Ive gotten it to work like once with lots of playing around using the loopback adapter even then its a pain. slirp is the way to go.
I'm with you on this one! :D
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

therock247uk wrote:Ive gotten it to work like once with lots of playing around using the loopback adapter even then its a pain. slirp is the way to go.
Yeah, basically you use the loopback, and then NAT onto your wifi adapter. I used to do the same with VPC 2004 ... 11 years ago. But it's much easier to hit the 'user mode networking' button... :D
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

apparently 60*TIMER_USEC never really fires. I dont know how on earth I missed that, must have not actually tested that binary. So I'm trying 120 as a magical value. Works great for telnet and pentiums. but for some reason a 486 can't run telnet32. weird. I need to load up QuakeWorld or Quake2.. Give it a real test.

Ive upated my binaries, and patch.

PCem-core2.exe
This one I built -march=core2 -msse -msse2 -msse3 ... since I have a new(ish) processor. maybe you do too.

PCem.exe
This is built with the normal flags.

PCem-debug.exe
This is with -g -O0 and SLIRP debugging turned on. It'll dump a text file showing what it's doing.


Anyone that's downloaded it in the last few hours, I HIGHLY HIGHLY recommend downloading it again, this time the 'normal' exe's will work, in addition to the debug exe.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

Again, all SLiRP does is emulating an Internet connection, not complete networking. If PCem is going to emulate a network adapter, it should be able to provide all network services, like a real network adapter would.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

Battler wrote:Again, all SLiRP does is emulating an Internet connection, not complete networking. If PCem is going to emulate a network adapter, it should be able to provide all network services, like a real network adapter would.
The problem is that you get people trying to shove pcap onto wifi adapters that'll never work, and then they wonder why. tun tap is a disaster from any normal user, and what are they going to try anyways?

Glancing at the pcap code, there is some parts of it called statically, and there is no capture filter set, so I can clean that part up. I've had really good luck with Basilisk II, and SheepShaver. I want to add pcap to Previous as well, although it's reliance on cmake, makes it such a PITA to deal with.. But I can finally build on OS X, and cross to Windows.

The gamespy sdk is out there, and a friend has an almost complete gamespy server, so I guess the next phase is something like HECNet that users discover via something like gamespy and try to run IPX/SPX stuff over. UDP tunneling ought to be a snap as well. But none of that will be super ready in 5 days.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

neozeed wrote:apparently 60*TIMER_USEC never really fires. I dont know how on earth I missed that, must have not actually tested that binary. So I'm trying 120 as a magical value. Works great for telnet and pentiums. but for some reason a 486 can't run telnet32. weird. I need to load up QuakeWorld or Quake2.. Give it a real test.

Ive upated my binaries, and patch.

PCem-core2.exe
This one I built -march=core2 -msse -msse2 -msse3 ... since I have a new(ish) processor. maybe you do too.

PCem.exe
This is built with the normal flags.

PCem-debug.exe
This is with -g -O0 and SLIRP debugging turned on. It'll dump a text file showing what it's doing.


Anyone that's downloaded it in the last few hours, I HIGHLY HIGHLY recommend downloading it again, this time the 'normal' exe's will work, in addition to the debug exe.
Okay, I'm gonna update the PCem binaries to r318 and the SLiRP networking feature to see if it works.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

Well...look at this! It worked! I can NOW get basic networking capabilities under PCem...all without the use in Winpcap! Here's a screenshot for proof:
PCem with SLiRP.png
PCem with SLiRP.png (85.81 KiB) Viewed 21366 times
The screenshot above that I can at least access the Google homepage.

With Neozeed's SLiRP patch, I can NOW go online with the Arachne browser. The speed is slow, but the networking is usable on this Award SiS 496/497 machine! Let's hope that the SLiRP networking capabilities get incorporated in future revisions of PCem even if it's not going to make it in v10.

:D

Here's what the PCem homepage looks like when browsing with the Arachne web browser using 1024 x 768 @ 256 colours:
PCem homepage.png
PCem homepage.png (108.98 KiB) Viewed 21366 times
Sorry that I got carried away a bit, I'm glad to see that networking is definitely usable with SLiRP and you may encounter any bugs. And in any event newer revisions of PCem come out and if you apply them, networking capabilities will be lost! Neozeed, if you plan to update to a later revision of PCem, be sure that you re-apply SLiRP networking again. :)
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Networking discussion

Post by leilei »

Cool!
Attachments
pcemslirp.png
pcemslirp.png (54.26 KiB) Viewed 21359 times
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

leilei wrote:Cool!
I agree. We can now access the internet with SLiRP networking...thanks to Neozeed! :)
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Networking discussion

Post by startmenu »

but it seems not to work on Windows 98...
QQ图片20150824215857.png
QQ图片20150824215857.png (181.48 KiB) Viewed 21312 times
IP config:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 8.8.8.8
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

startmenu wrote:but it seems not to work on Windows 98...
QQ图片20150824215857.png
IP config:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 8.8.8.8
Do you have the DNS set at 10.0.2.3? Setting it other than that will not work.
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Networking discussion

Post by startmenu »

ppgrainbow wrote:
startmenu wrote:but it seems not to work on Windows 98...
QQ图片20150824215857.png
IP config:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 8.8.8.8
Do you have the DNS set at 10.0.2.3? Setting it other than that will not work.
I tried. But still couldn't get it work... ping 10.0.2.3, but timed out.
Does the slirp build support WLAN environment? I didn't plug the ethernet cable.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

startmenu wrote:
ppgrainbow wrote:
startmenu wrote:but it seems not to work on Windows 98...
QQ图片20150824215857.png
IP config:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 8.8.8.8
Do you have the DNS set at 10.0.2.3? Setting it other than that will not work.
I tried. But still couldn't get it work... ping 10.0.2.3, but timed out.
Does the slirp build support WLAN environment? I didn't plug the ethernet cable.
I'll have to ask Neozeed if the SLiRP build supports the WLAN environment. 10.0.2.3 is the DNS not the IP. You need to ping 10.0.2.15. If it still doesn't work, I'm gonna address this issue with Neozeed.

Neozeed, I have one question. Does your SLiRP build support the WLAN environment? Just curious to ask.
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Networking discussion

Post by startmenu »

current settings:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3

I can ping the 10.0.2.2 and 10.0.2.15... but ping 10.0.2.3 turns out timed out
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

ppgrainbow wrote:
Neozeed, I have one question. Does your SLiRP build support the WLAN environment? Just curious to ask.
You can *ONLY* ping 10.0.2.2

It works in WLAN setups, I am writing this on a MacBook Air, and running it through wine... Although I test on my Windows machine when I'm in the office, but that is a whole other story.

so 10.0.2.3 is the DNS that will be intercepted and it calls the DNS servers that your laptop is configured with. If you want to use a different DNS server you could, but some older OSes have issues with modern DNS servers (8.8.8.8 being one of the ones that wont work with old stuff)... And I didn't want to go down there. You can try 4.2.2.2 and 4.2.2.4, although I'm on the other side of the planet from those, and I dont feel like the latency.

SO yeah, 10.0.2.15 is the VM's ip address, 10.0.2.2 is the gateway, and 10.0.2.3 is DNS.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

startmenu wrote:current settings:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3

I can ping the 10.0.2.2 and 10.0.2.15... but ping 10.0.2.3 turns out timed out
That is the way it works. Try and connect to something. I got QuakeWorld and Quake2 to work!
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

startmenu wrote:but it seems not to work on Windows 98...


IP config:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 8.8.8.8
Change the DNS to 10.0.2.3

If you ping say google.com you should get it to resolve. nslookup gives better results to be honest. The google multicast DNS of 8.8.8.8 won't work properly for older OSes through slirp. 10.0.2.3 uses the iphlpapi dll which then queries whatever DNS you have setup on the host, and relays it back. SO if your laptop is setup for 8.8.8.8, set the VM to 10.0.2.3 and it'll pass the DNS requests to 8.8.8.8 by itself. Normal non multicast DNS servers ought to work as well.

You can ONLY ping 10.0.2.2 This just verifies that slirp is working. Things that require sockets to be opened back and forth (ftp) will not work in active mode, try passive mode. HTTP and unidrectional stuff works, I tested QuakeWorld and Quake 2.
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Networking discussion

Post by startmenu »

neozeed wrote:
startmenu wrote:current settings:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3

I can ping the 10.0.2.2 and 10.0.2.15... but ping 10.0.2.3 turns out timed out
That is the way it works. Try and connect to something. I got QuakeWorld and Quake2 to work!
Now my laptop is on Ethernet and I disconnect WLAN... (after restarting host OS)
But still can't get it work... IE (and Arachne on MS-DOS) can't connect to the Internet.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

startmenu wrote:
neozeed wrote:
startmenu wrote:current settings:
IP 10.0.2.15
mask 255.255.255.0
gateway 10.0.2.2
DNS 10.0.2.3

I can ping the 10.0.2.2 and 10.0.2.15... but ping 10.0.2.3 turns out timed out
That is the way it works. Try and connect to something. I got QuakeWorld and Quake2 to work!
Now my laptop is on Ethernet and I disconnect WLAN... (after restarting host OS)
But still can't get it work... IE (and Arachne on MS-DOS) can't connect to the Internet.
What OS? what config in PCem? What OS are you running in PCem? How did you configure the virtual network adapter? port? irq?
startmenu
Posts: 104
Joined: Sat 29 Nov, 2014 7:39 am

Re: Networking discussion

Post by startmenu »

I'm using your slirp build to run Windows 98 on Windows 7 x64
config:

Code: Select all

gameblaster = 0
gus = 0
ssi2001 = 0
voodoo = 1
model = 34
cpu_manufacturer = 0
cpu = 8
gfxcard = 15
video_speed = 5
sndcard = 8
cpu_speed = 12
has_fpu = 1
slow_video = 1
cache = 3
cga_composite = 0
disc_a = 
disc_b = 
mem_size = 64
cdrom_drive = 77
cdrom_enabled = 1
vid_resize = 0
vid_api = 0
video_fullscreen_scale = 1
video_fullscreen_first = 0
hdc_sectors = 63
hdc_heads = 16
hdc_cylinders = 10361
hdc_fn = 98.img
hdd_sectors = 0
hdd_heads = 0
hdd_cylinders = 0
hdd_fn = 
hde_sectors = 0
hde_heads = 0
hde_cylinders = 0
hde_fn = 
hdf_sectors = 0
hdf_heads = 0
hdf_cylinders = 0
hdf_fn = 
cpu_use_dynarec = 1
netinterface = 1
netcard = 1

[3DFX Voodoo Graphics]
framebuffer_memory = 4
texture_memory = 4
bilinear = 1
dacfilter = 1

[Phoenix S3 Trio64]
memory = 4

[ATI Mach64GX]
memory = 4

[Trident TVGA 8900D]
memory = 512
ne2000 address 0x300
irq 10
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

Image

I just installed Windows 95, since I have it handy, and copied in Internet Explorer 3, and it works fine... I let the adapter configure via DHCP. try dhcp?
Post Reply