sheep_net connection dies

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

sheep_net connection dies

Post by Frank Carvalho »

Hi

I need the sheep_net connection to the internet, and I have compiled it, and made a script to install the kernal modul at startup. User rights are set correctly for /dev/sheep_net, and --eth is set to wlan0. Upon boot and start of Internet Explorer 4.5 it connects briefly to the net, but then after a few seconds the network connection times out. Same behaviour with Netscape 7 or any other browser I've tried.

I have tried with MacTCP Ping, and it manages to perform 4-5 pings before it starts timing out.

If I make any sort of change - in fact not changing anything, but saving what appears to be a new TCP setting to the Mac OS, it seems like I am resetting the connection, so I can get another 4-5 pings before it starts timing out again. I get this behaviour on all my SheepShaver installs of OS8.6 and OS9 on both my RPi4 and RPi2+.

What could be wrong. Any suggestions?

/Frank

P.S. And why would I need internet you may ask. Well, this project makes it worthwhile: http://theoldnet.com

Moderator edit: I fixed that link for you.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Some additional info. When I try ping to a specific IP it times out after 5-8 pings. But if I then try to ping another IP, it picks up the connection for another 5-8 pings before it times out again, and so on.... So it seems to initialize the connection to any IP, but cannot keep it alive for more than a few seconds. I really have no idea what to look for.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: sheep_net connection dies

Post by adespoton »

That sounds really really familiar. We had that connection while fixing up audio for one of the emulators a number of years ago. The problem ended up being a bug in the buffer handling routine; the buffer could get into a state where it wasn't completely full, and so didn't flush, blocking the next data.

Somewhere to start looking, anyway.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sheep_net connection dies

Post by Cat_7 »

Hi,

You say:
I need the sheep_net connection to the internet
If access to the internet is the only reason to try the sheep_net driver then you can also use the default slirp connection.

Best,
Cat_7
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

adespoton wrote: Wed Apr 21, 2021 1:33 am That sounds really really familiar. We had that connection while fixing up audio for one of the emulators a number of years ago. The problem ended up being a bug in the buffer handling routine; the buffer could get into a state where it wasn't completely full, and so didn't flush, blocking the next data.

Somewhere to start looking, anyway.
The buffer handling routine in sheep_net, or ...? Did you solve the problem? I am just compiling SS and sheep_net from the kanjitalk source.
Cat_7 wrote: Wed Apr 21, 2021 5:11 am If access to the internet is the only reason to try the sheep_net driver then you can also use the default slirp connection.
I couldn't get it to work, or rather, I couldn't find any info on the command line parameters needed to use slirp. It seems that --eth is only for sheep_net. I avoid the config GUI entirely and start with --no-gui, as the GUI always creates a prefs-file that I don't want. So I need to know the correct command line parameters.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sheep_net connection dies

Post by Cat_7 »

Hi,

On the command line that is --ether slirp
Then set Mac OS tcp/ip settings to dhcp and you should get 10.0.2.15 as ip address.

Best,
Cat_7
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Great, thanks! I'll try that as soon as I get home. It is also a simpler solution than installing sheep_net boot scripts.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: sheep_net connection dies

Post by adespoton »

Frank Carvalho wrote: Wed Apr 21, 2021 9:37 am
adespoton wrote: Wed Apr 21, 2021 1:33 am That sounds really really familiar. We had that connection while fixing up audio for one of the emulators a number of years ago. The problem ended up being a bug in the buffer handling routine; the buffer could get into a state where it wasn't completely full, and so didn't flush, blocking the next data.

Somewhere to start looking, anyway.
The buffer handling routine in sheep_net, or ...? Did you solve the problem? I am just compiling SS and sheep_net from the kanjitalk source.
Cat_7 wrote: Wed Apr 21, 2021 5:11 am If access to the internet is the only reason to try the sheep_net driver then you can also use the default slirp connection.
I couldn't get it to work, or rather, I couldn't find any info on the command line parameters needed to use slirp. It seems that --eth is only for sheep_net. I avoid the config GUI entirely and start with --no-gui, as the GUI always creates a prefs-file that I don't want. So I need to know the correct command line parameters.
That would likely be buffer handling in sheep_net that would need some attention. But unless you're doing AppleTalk, the SLIrP method is much easier/simpler/dependable -- especially now that it includes the option for port forwarding.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Hmmm. I don't seem to be able to make slirp work at all.
Tried --ether slirp and DHCP - only timeouts
Tried --ether slirp and manual setup of 10.0.2.5 - only timeouts
Checked to see that slirp was actually compiled, and it seems to be.
Not really sure what I am doing wrong here. It seems so simple from the descriptions....

Does slirp assume wired eth connection? I am using a wlan0 interface.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: sheep_net connection dies

Post by Ronald P. Regensburg »

When slirp networking is enabled using --ether slirp :
Set TCP/IP control panel in SheepShaver to Ethernet and DHCP server.
TCP/IP should get the addresses from the slirp networking as soon as you try IP network access (for instance with a web browser).

If that does not work, you can also configure TCP/IP control panel manually for slirp networking:
IP Address: 10.0.2.15
Subnet mask: 255.255.255.0
Router address: 10.0.2.2
Name-server address: 10.0.2.3

The active network connection of the host will be used. That does not need to be ethernet, can also be wlan.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Yes, this is what I did. I tried both DHCP and manual setup, but connections timed out nevertheless.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

I tried to start SS with the GUI anyway, but it seems like "slirp" is not available as a dropdown item in the networking tab?
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sheep_net connection dies

Post by Cat_7 »

Hi,

Then what is available in the drop down?

Best,
Cat_7
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Only my "wlan0". But then, choosing wlan0 requires sheep_net, as far as I understand.

Edit: Thinking about it, is it possible that the sheep_net module is still loaded in the kernel, even thought the /dev/sheep_net device is not initiated, and that SS still thinks it is running sheep_net? I guess I have to investigate with lsmod. I honestly though it wouldn't survive reboot.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

But no... Even with sheep_net completely removed I still cannot get slirp to do anything. And I still find it strange that I can't even select it as a drop-down value in the GUI.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: sheep_net connection dies

Post by Ronald P. Regensburg »

If the default "slirp" somehow happens to be replaced in the prefs file by "wlan0", that is what may appear in the GUI menu as only choice. Enter "slirp" (without quotes) in the menu manually (typing) and save the change. Or, alternatively, edit the prefs file in a text editor, changing

Code: Select all

ether wlan0
to

Code: Select all

ether slirp
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: sheep_net connection dies

Post by Cat_7 »

Hi,

If slirp is not available in the drop down, and you cannot set "--ether slirp" on the command line or "ether slirp" in the prefs, then perhaps something goes wrong while compiling.
Perhaps you are missing some dependency, but I would not be able to tell you how to check that.

How exactly do you compile SheepShaver?

Best,
Cat_7
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Ronald P. Regensburg wrote: Sun Apr 25, 2021 1:08 pm If the default "slirp" somehow happens to be replaced in the prefs file by "wlan0", that is what may appear in the GUI menu as only choice. Enter "slirp" (without quotes) in the menu manually (typing) and save the change. Or, alternatively, edit the prefs file in a text editor, changing

Code: Select all

ether wlan0
to

Code: Select all

ether slirp
Yes, I tried that too. The field was editable, so I had to try. And I also tried setting --ether slirp in my command line when going GUI-less. But it didn't work either, unfortunately.

Now, I tried to compile the whole thing on my Ubuntu 20.04 laptop, and here it actually works as it should with slirp, and same ROM and disk images and all. I could set theoldnet.com, port 1999, as proxy, and browse the internet like it's 1999, without timeouts! Same settings and same start command line.
So I begin to believe that something is behaving differently on the Raspberry Pi, as I can't get it to work on neither the RPi2+ or the RPi400.

/Frank
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Cat_7 wrote: Sun Apr 25, 2021 1:21 pm Hi,

If slirp is not available in the drop down, and you cannot set "--ether slirp" on the command line or "ether slirp" in the prefs, then perhaps something goes wrong while compiling.
Perhaps you are missing some dependency, but I would not be able to tell you how to check that.

How exactly do you compile SheepShaver?

Best,
Cat_7
To compile SheepShaver on the RPi, you have to configure slightly different, because of the direct addressing issue. These are my compile commands:

Code: Select all

cd SheepShaver/src/Unix/
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler --with-gtk --enable-addressing=direct,0x10000000
make
Without direct addressing, SS will give the "Cannot map global kernel parameters" error. See my thread about it here: (viewtopic.php?f=20&t=11017). I did get it to run, eventually.
This is the configuration result if I run vanilla ./autogen.sh on the RPi:

Code: Select all

SheepShaver configuration summary:

SDL support ...................... : none
SDL major-version ................ : 1
BINCUE support ................... : no
LIBVHD support ................... : no
FBDev DGA support ................ : yes
XFree86 DGA support .............. : yes
XFree86 VidMode support .......... : yes
Using PowerPC emulator ........... : yes
Enable JIT compiler .............. : no
Enable video on SEGV signals ..... : yes
ESD sound support ................ : yes
GTK user interface ............... : gtk2
mon debugger support ............. : no
Addressing mode .................. : real
Bad memory access recovery type .. : siginfo
I notice that it reports SDL version 1, even though I do have SDL 2 installed. Is that wrong?
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

OK, this whole SheepShaver-on-RaspberryPi-business is just SO weird.
As mentioned in the other thread I opened, I was able to compile and run SS on RPi2+ and RPi400, using a kanjitalk755 clone.

However, it seems that my compiles for both Pis were based on SDL1, and most likely this did not play well with slirp.

So I first tried to configure compile for SDL2 on a fresh kanjitalk755 clone on my Ubuntu 20.04 AMD64 as a reference. No problem. Everything works as expected. Slirp communicates with DHCP etc.

Did *exactly* the same on my RPi2+, start as root, and it refuses to map kernel memory and exits. Kernel parameter vm.mmap_min_addr = 0 is set as it should, and I am sure it is configured for SDL2 now. New configure with direct addressing to 0x10000000, make, and still no luck. It exits.

Eventually I decided to try on the RPi400. Same procedure. SDL2, autogen configure and compile with direct addressing to 0x10000000, min addr set to 0, start as root, and.... It works! With slirp functioning too, better than ever. No buffer issue like I had with sheep_net. Just happy browsing.

I am so confused.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: sheep_net connection dies

Post by adespoton »

Happy to know it works on the RPi4; the other compile thread for graphics speed should be able to do that too.

What OS is the RPi2+ running? Does it have SDL2 loaded and functioning with other software? I ask because the 2+ is old enough that SDL1.2 was pretty common, and SDL2, not so much. If it DOES have SDL2, it could be an older version -- and there's been lots of bugfixes in SDL2 over the past year alone.
Frank Carvalho
Student Driver
Posts: 24
Joined: Mon Jan 18, 2021 10:17 am

Re: sheep_net connection dies

Post by Frank Carvalho »

Before my experiments began, I installed a fresh copy of RetroPie 4.7.1 - same as on the RPi400. This was back in the beginning of january.
So, in principle the only difference between the two is the ARM processor.
Post Reply