Experimental Sheep with PCAP for Windows.

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
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Experimental Sheep with PCAP for Windows.

Post by neozeed »

Image

Oh yes!

Well it works on my machine.... Which I know means pretty much nothing, from the last time I tried this.

I pulled the source from github and massaged in my pcap code from Basilisk, and managed to get it running. As you know building Sheepshaver on Windows is very temperamental. I ended up having to use gcc version 3.4.5 (mingw-vista special r3) to get it to build, and even then the dyngen.exe is particularly flakey. Although it does seem to like running under GDB for some reason. Othertimes it'll compile and build without issues.

I put in a 3 second (approx) wait until I start to send packets into the Sheep. Unlike Basilisk, if packets arrive too soon, it'll crash out the emulator. SLiRP is basically useless in this build. I didn't work at all, when I got Sheep to compile and link for the first time. I thought it was IE 5, or any of my TCP apps, but oddly enough they run find with PCAP. So very strange.

To enable to pcap support you'll need something like this:

Code: Select all

ether pcap
pcapdev \Device\NPF_{3DF7C849-BC3F-4A54-AE77-BEEFE9EBCAF4}
Of course the fun part is finding your pcapdev. So I included this fun tool, ethlist:

Code: Select all

C:\SheepShaver>ethlist.exe
Network devices:
  Number       NAME                                     (Description)
  0  \Device\NPF_{3DF7C849-BC3F-4A54-AE77-BEEFE9EBCAF4} (Local Area Connection 4)
  1  \Device\NPF_{A3F2C156-9D1C-4442-9766-2D745AB46145} (VMware Network AdapterVMnet8)
  2  \Device\NPF_{69E9FFD0-D3D6-4985-8823-CDA5937BB224} (Local Area Connection 3)
  3  \Device\NPF_{656B6ADB-13BF-4A58-96AD-BD0B61333E6A} (VMware Network AdapterVMnet13)
  4  \Device\NPF_{726F0EB3-CC94-45F5-891F-8A8AE8C7CEEB} (VMware Network AdapterVMnet1)
  5  \Device\NPF_{A542548C-1A7F-4C49-8CCC-1F8E890F026C} (tun0)
Press Enter to continue...
Which you can see that my physical Ethernet is called "(Local Area Connection 4)", with the GUID of \Device\NPF_{3DF7C849-BC3F-4A54-AE77-BEEFE9EBCAF4}

Easy, right?

No, it doesn't work over wifi. don't ask. Running this under wine is totally pointless. I would imagine the UNIX code for the Ethernet follows the same madness as the Windows code so adapting it might not prove too difficult. But I haven't looked.

So, what is it good for? AFP shares, over appletalk. Being able to use the networking without immediately crashing. Instead of a shared disk between Basilisk II, and SheepShaver, I can now use a Windows NT file server between them.

Oh well source and binaries on dropbox. Probably somewhere else later. You can attempt to compile on your own, GCC 4.8.1 did *NOT* like the games with the CPU emulation. Maybe a 4.0 or 4.2 might play nicely , I really don't know.
don't do today what you can put off until tomorrow.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: Experimental Sheep with PCAP for Windows.

Post by kikyoulinux »

Good job! a build that doesn't need basiliskii ethernet driver.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

kikyoulinux wrote:Good job! a build that doesn't need basiliskii ethernet driver.
yep, now just requires winpcap!

Let me know if it works, or fails.
don't do today what you can put off until tomorrow.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: Experimental Sheep with PCAP for Windows.

Post by kikyoulinux »

Yes it works. I got a localsheep and a remotesheep!
But it seems this build does not support physical CD-ROM on 64-bit host.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Experimental Sheep with PCAP for Windows.

Post by Cat_7 »

Hi,

The source for reading cd's in 64 bit can be had from me.
https://www.dropbox.com/s/0jgtiwnwui6gv ... 5.zip?dl=0

Best,
Cat_7
Last edited by Cat_7 on Thu Jul 23, 2015 2:01 pm, edited 1 time in total.
Reason:  
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

Cat_7 wrote:Hi,

The source for reading cd's in 64 bit can be had from me.
https://www.dropbox.com/s/0jgtiwnwui6gv ... 5.zip?dl=0

Best,
Cat_7
It seems everything is kind of scattered.. is there an index of all the forks? lol not to complain.

I'll certainly want to look at this improvement, I have been having a nightmare with Qemu/Bochs's TOC code as it's just magic values hopefully this one actually has data structures... Thanks for the update!
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

kikyoulinux wrote:Yes it works. I got a localsheep and a remotesheep!
But it seems this build does not support physical CD-ROM on 64-bit host.
All being well, I'll push an update tomorrow!
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

I updated those files, and re-compiled!

My machine doesn't have a CD-ROM drive, but I can verify that it still launches, and I'm able to talk to my NT server via AppleTalk.
don't do today what you can put off until tomorrow.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Experimental Sheep with PCAP for Windows.

Post by Cat_7 »

Yep,

Reads CDs on 64 bit windows.

Best,
Cat_7
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

Cat_7 wrote:Yep,

Reads CDs on 64 bit windows.

Best,
Cat_7
wow, that was a painless patch for once!

I did notice after jumping through a bunch of versions of MacOS that if AppleTalk is off, itll crash. I think i have an idea to fix it. I think if not protocols are registered, passing in traffic crashes the sheep. But without a debugger its a guesss.

Then i want to try to re—work the SLiRP .. as soon as SVN is restored on sourceforge.
don't do today what you can put off until tomorrow.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Experimental Sheep with PCAP for Windows.

Post by adespoton »

After all the latest activities on SourceForge, it might be worth migrating to Github.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

adespoton wrote:After all the latest activities on SourceForge, it might be worth migrating to Github.
My problem with github is that it's 100% VC based, they don't have a real revenue stream. So once the VC funding dries up, they'll evaporate like everyone else before them.

Sourceforge has been around since 1999 which is a lot more than I can say for anything else like it.

I know it's not 'hip' or 'trendy' because it's older than six weeks, but I really don't see github, bitbucket or any of these other sites having any future. Plus things like wiki's, forums or anything beyond simple repositories are either more $$$ per month, or simply not available, while all of those are available.
don't do today what you can put off until tomorrow.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Experimental Sheep with PCAP for Windows.

Post by adespoton »

I've been using SF since the beginning, but have been getting worried about the direction Dice Holdings is taking it recently, with the antics of moving closed or dormant projects and replacing the compiled offerings with bundleware downloaders. Seems like they might be having their own cash flow issues.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

So I got a few minutes with my windows dev machine.....

Code: Select all

int16 ether_attach_ph(uint16 type, uint32 handler)
Is never called. so much for that idea!

No find_protocol, none of that stuff.

I see that attaching a counter to ether_thread_write_packets seems to work. The idea being that if the OS isn't transmitting packets, it's not ready to receive packets. I can boot 7.5.3 up, which by default has no localtalk enabled, and it doesn't crash. Much nicer than the timer, especially since I can turn on localtalk, and then I see my server.


Ok, I've updated the dropbox link HERE.

Again, it works great for me, and let's me do what I wanted to do...

Still no idea what is up with SLiRP.
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

if anyone cares got it to 'compile' on 10.10 with gcc-4.2

You need to tell it to use 10.6 (maybe others?)

-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6

you can download individual SDK's...


and you'll need crt1.10.6.o to link.

Code: Select all

g++-4.2 -arch i386  -o SheepShaver -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -read_only_relocs suppress -L. -pagezero_size 0x3000 -Wl,-seg1addr,0x78048000 	obj/main.o obj/main_unix.o obj/prefs.o obj/prefs_items.o obj/prefs_unix.o obj/sys_unix.o obj/rom_patches.o obj/rsrc_patches.o obj/emul_op.o obj/name_registry.o obj/macos_util.o obj/timer.o obj/timer_unix.o obj/xpram.o obj/xpram_unix.o obj/adb.o obj/sony.o obj/disk.o obj/cdrom.o obj/scsi.o obj/gfxaccel.o obj/video.o obj/video_blit.o obj/audio.o obj/ether.o obj/thunks.o obj/serial.o obj/extfs.o obj/disk_sparsebundle.o obj/tinyxml2.o obj/about_window_unix.o obj/user_strings.o obj/user_strings_unix.o obj/vm_alloc.o obj/sigsegv.o obj/rpc_unix.o obj/sshpty.o obj/strlcpy.o obj/video_sdl.o obj/extfs_macosx.o obj/prefs_dummy.o obj/serial_unix.o obj/ether_dummy.o obj/scsi_dummy.o obj/audio_dummy.o obj/prefs_editor_dummy.o obj/sys_darwin.o obj/SDLMain.o obj/clip_dummy.o obj/utils_macosx.o obj/jit-cache.o obj/basic-dyngen.o obj/ppc-dyngen.o obj/ppc-jit.o obj/ieeefp.o obj/mathlib.o obj/ppc-cpu.o obj/ppc-decode.o obj/ppc-execute.o obj/ppc-translate.o obj/utils-cpuinfo.o obj/sheepshaver_glue.o obj/ppc-dis.o -lpthread -lm  -framework SDL -framework Carbon -framework IOKit -framework CoreFoundation -framework AppKit 
Darwin/lowmem SheepShaver
it'll start to run but it's not catching and continuing the SIGSEV exception. I copied the config.h, sysconfig.h and makefile from an earlier build.
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

Re: Experimental Sheep with PCAP for Windows.

Post by neozeed »

no dice on 10.8

Code: Select all

g++-4.2 -arch i386  -o SheepShaver -isysroot /Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8  -F /Library/Frameworks -F /System/Library/Frameworks  -pagezero_size 0x3000 -Wl,-seg1addr,0x78048000 -Wl,-no_pie 	obj/main.o obj/main_unix.o obj/prefs.o obj/prefs_items.o obj/prefs_unix.o obj/sys_unix.o obj/rom_patches.o obj/rsrc_patches.o obj/emul_op.o obj/name_registry.o obj/macos_util.o obj/timer.o obj/timer_unix.o obj/xpram.o obj/xpram_unix.o obj/adb.o obj/sony.o obj/disk.o obj/cdrom.o obj/scsi.o obj/gfxaccel.o obj/video.o obj/video_blit.o obj/audio.o obj/ether.o obj/thunks.o obj/serial.o obj/extfs.o obj/disk_sparsebundle.o obj/tinyxml2.o obj/about_window_unix.o obj/user_strings.o obj/user_strings_unix.o obj/vm_alloc.o obj/sigsegv.o obj/rpc_unix.o obj/sshpty.o obj/strlcpy.o obj/video_sdl.o obj/extfs_macosx.o obj/prefs_macosx.o obj/VMSettingsController.o obj/serial_unix.o obj/ether_pcap.o obj/scsi_file.o obj/audio_macosx.o obj/AudioBackEnd.o obj/AudioDevice.o obj/MacOSX_sound_if.o obj/prefs_editor_dummy.o obj/sys_darwin.o obj/SDLMain.o obj/clip_macosx.o obj/utils_macosx.o obj/jit-cache.o obj/basic-dyngen.o obj/ppc-dyngen.o obj/ppc-jit.o obj/ieeefp.o obj/mathlib.o obj/ppc-cpu.o obj/ppc-decode.o obj/ppc-execute.o obj/ppc-translate.o obj/utils-cpuinfo.o obj/sheepshaver_glue.o obj/ppc-dis.o obj/queue.o obj/bootp.o obj/ip_output.o obj/tcp_input.o obj/cksum.o obj/mbuf.o obj/tcp_output.o obj/debug.o obj/misc.o obj/tcp_subr.o obj/if.o obj/sbuf.o obj/tcp_timer.o obj/ip_icmp.o obj/slirp.o obj/tftp.o obj/ip_input.o obj/socket.o obj/udp.o -lpthread -lm  -framework SDL -framework Carbon -framework IOKit -framework CoreFoundation -framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework AppKit 
Darwin/lowmem SheepShaver
Jasons-MacBook-Air:Unix jsteve$ ./SheepShaver
SheepShaver V2.4 by Christian Bauer and Mar"c" Hellwig
ERROR: Cannot open ROM file.
EtherExit called
SCSIExit
Jasons-MacBook-Air:Unix jsteve$ cd ..
Jasons-MacBook-Air:src jsteve$ cd ..
Jasons-MacBook-Air:SheepShaver jsteve$ cd ..
Jasons-MacBook-Air:qemu-mac9 jsteve$ SheepShaver/src/Unix/SheepShaver
SheepShaver V2.4 by Christian Bauer and Mar"c" Hellwig
Reading ROM file...
Detected CPU features: MMX SSE SSE2 SSE3 SSSE3
PowerPC CPU emulator by Gwenole Beauchesne
No handler for exception_type = 1. Not fowarding
Segmentation fault: 11
Jasons-MacBook-Air:qemu-mac9 jsteve$ 
don't do today what you can put off until tomorrow.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: Experimental Sheep with PCAP for Windows.

Post by kikyoulinux »

This build is quite stable when browsing the Internet with IE and Netscape under pcap mode however it crashes as usual under slirp mode.
I think there must be something wrong with the slirp code on Windows and Linux.
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: Experimental Sheep with PCAP for Windows.

Post by kikyoulinux »

However when bridging to my real Ethernet card, the emulator encounters illegal instructions errors and crashes sometimes.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Experimental Sheep with PCAP for Windows.

Post by Cat_7 »

Did you set both the following settings to true in the prefs file?
ignoresegv
ignoreillegal

Best,
Cat_7
kikyoulinux
Tinkerer
Posts: 92
Joined: Sun Sep 28, 2014 11:53 am

Re: Experimental Sheep with PCAP for Windows.

Post by kikyoulinux »

yep, both were set to true.
but bridging to virtualbox host only adapter is much more stable. now sheep is able to access Internet via a virtual NAT server. I have to turn on the CentOS virtual machine(the router server) before using sheep.
Post Reply