Sparsebundle support, and new builds of SS & B2

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
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Sparsebundle support, and new builds of SS & B2

Post by vasi »

I've implemented support for sparsebundles in SheepShaver and BasiliskII, and wanted to share, so I've made a few builds for you fine folks!


'Sparsebundles' are an alternative, more flexible format of disk images. Without them, you have to decide in advance exactly how much space you want to use. So if I create a 500 MB SheepShaver .img, that takes up 500 MB of disk space even if it's empty. If I later fill up the disk image completely, I have to create a bigger one and transfer all my data.

Instead, I can now create a sparsebundle that claims to be 20 GB, but only takes up as much disk space as the data stored on it in SheepShaver. When it's empty, it uses barely any disk space. As I add files to it in SheepShaver, it expands to accommodate the new data. Since the maximum size is so large, I never have to worry about filling it up.

Sparsebundles are an Apple technology, and are fully supported in Mac OS X 10.5 or later. Specifically:
  • You can mount them by double-clicking on them, assuming they contain an HFS+ file system.
  • You can manipulate them with Disk Utility and hdiutil.
  • To create a sparsebundle, use Disk Utility and make sure to choose "Image format: sparse bundle disk image". Or, at the command line: "hdiutil create -type SPARSEBUNDLE -size 20g test.sparsebundle".
SheepShaver/BasiliskII on Linux can support sparsebundles too!
  • You can mount them with sparsebundlefs.
  • To create them, you can use a tool I wrote called rhfs.
To use a sparsebundle with SS/B2, just add it to the VM like any other disk. So your prefs file will have a line like this:

Code: Select all

disk /Users/vasi/Desktop/test.sparsebundle
You can do this manually, or with any of the available GUIs. When you launch SS/B2, it will offer to format the sparsebundle, just like any other disk. You can even install MacOS and boot from a sparsebundle.

Some notes:
  • If you make very large sparsebundles, I recommend formatting them as HFS+ (aka "Mac OS Extended") if you can. Plain HFS ("Mac OS Standard") wastes a lot of space on large disks, but it's the only option on Mac OS 8.0 and lower.
  • Other emulators like Mini vMac can't read sparsebundles yet, so continue to use regular disk images for data you want to share with those emulators.
  • Sparsebundles grow as you add data, but don't automatically shrink when you remove data. You can use my rhfs tool to reclaim this unused space in a sparsebundle. (On OS X, you can also use "hdiutil compact" on most disks, but not ones you've booted from.)
  • Backing up sparsebundles is often more efficient. For example, every time you boot SheepShaver, Time Machine must make a complete copy of any regular disk image SS used. With sparsebundles, it will copy only the necessary parts.
  • Sparsebundles are different from the kind of sparse files that Linux already supports. Those sparse files are unfortunately less portable, and hard to keep sparse, so I decided to work on sparsebundles instead.

Now have some builds of SheepShaver and BasiliskII! These all include sparsebundle support. Please let me know how your experience with them goes.

For Mac:
  • BasiliskII.app.zip: 32-bit, 10.6+. Compiled on 10.6.
  • BasiliskIIGUI.app.zip: My GTK+-based (not very Mac-like) GUI, 32-bit, 10.6+. Compiled on 10.6.
  • SheepShaver.app.zip: Universal (32/64/PPC, but I haven't tested PPC), 10.4+. Compiled on 10.7. I recommend running it in 32-bit mode.
  • SheepShaverLauncher.app.zip: Manager for your SheepShaver VMs, universal, 10.4+. Compiled on 10.7.
For Linux, inside macemu-linux.tgz:
  • BasiliskII64, SheepShaver64: Just the emulator, 64-bit, SDL-based. Full screen seems to work. Note that there's a known bug of crashing when slirp Ethernet is used.
  • BasiliskII, SheepShaver: Just the emulator, 32-bit, SDL. Full screen ok, slirp ok. If you want to run it on a 64-bit system, you'll need to install a 32-bit libstdc++, and (optionally) a 32-bit audio system. On modern Ubuntu, that's "apt-get install libstdc++6:i386 libpulse0".
  • BasiliskIIGUI, BasiliskIIGUI64, SheepShaverGUI, SheepShaverGUI64: GTK+ standalone preferences editors. You should be able to use SheepShaverGUI64 with a 32-bit SheepShaver, if you want.
These Linux binaries are very portable, you should be able to run them on any i386/amd64 Linux system since 2007. They were built on very old versions of Debian, statically link SDL, and use SDL's dynamic loading feature so they don't pull in extra dependencies.

Enjoy, everyone. And don't forget to report bugs!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Ronald P. Regensburg »

Tried SheepShaver OSX in 32-bit mode, traditional setup (no VM), in OSX 10.8.3.

Created with Disk Utility a 20GB HFS+ formatted sparsebundle image. I could not add the test.sparsebundle volume using the built-in prefs editor because it would open the bundle instead of adding it. I could add it using the stand-alone prefs editor.
The volume seems to work as expected. Could also erase it (HFS+) inside SheepShaver without loss of the sparsebundle properties.

I will try to do more testing later this week. Little time now because of family obligations.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Cat_7 »

Hi,

Thanks for your effort!
Some comments on running on PPC 10.5.8:
-The sheepshaver launcher from your download doesn't run (architecture not supported)
-SheepShaver is extremely unstable on PPC. I've seen this on most of the recent builds, only a build from Oct. 2009 behaves "nicely".

Some info from the logs from different attempts to run your build:

SheepShaver_vasi.app/Contents/MacOS/SheepShaver[125]: CPSGetCurrentProcess(): This call is deprecated and should not be called anymore.

ERROR: Your Mac program made an illegal word read access to address 0x61ce61e6.
Apr 6 23:32:34 hsps-Power-Mac-G5 [0x0-0x12012].SheepShaver_vasi[125]: (pc 0x1d891340, 68k pc 0x1d4a15f4, sp 0x1b3a6346)


Best,
Cat_7
Last edited by Cat_7 on Sat Apr 06, 2013 9:39 pm, edited 1 time in total.
Reason:  
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by vasi »

Unfortunately I have no PPC box to test on, but if you can narrow down what's causing the bug, I'll do my part.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Cat_7 »

Hi,

I tried to debug the PPC version with gdb. This is what I got so far:
(gdb) run
Starting program: /Users/hsp/SheepShaver/SheepShaver_vasi.app/Contents/MacOS/SheepShaver
unable to read unknown load command 0x24
unable to read unknown load command 0x26
unable to read unknown load command 0x24
unable to read unknown load command 0x26
Reading symbols for shared libraries .++++++++++........................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
SheepShaver V2.4 by Christian Bauer and Mar"c" Hellwig
Paranoia checks...
[emul_thread] waiting for tick thread to initialize
[tick_thread] waiting for emul thread to initialize
[emul_thread] filling in registers and waiting for interrupt
[tick_thread] trigger interrupt

Program received signal SIGUSR2, User defined signal 2.
0x780d4448 in emul_func ()
(gdb) s
Single stepping until exit from function _Z9emul_funcPv,
which has no line number information.
SIGUSR2 caught
0x780d46dc in paranoia_check ()
(gdb) s
Single stepping until exit from function _Z14paranoia_checkv,
which has no line number information.
...passed
0x780af9d8 in SDL_main ()
(gdb) s
Single stepping until exit from function SDL_main,
which has no line number information.
Reading ROM file...
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Using SDL/coreaudio audio output
WARNING: Cannot open /dev/sheep_net (No such file or directory). Ethernet will not be available.
Reading symbols for shared libraries . done

Program received signal SIGUSR2, User defined signal 2.
0x91e4ca6c in setpriority ()
(gdb) s
Single stepping until exit from function setpriority,
which has no line number information.
0x91e9fdb4 in nice ()
(gdb) s
Single stepping until exit from function nice,
which has no line number information.
0x91f4cc34 in dyld_stub_getpriority ()
(gdb) s
Single stepping until exit from function dyld_stub_getpriority,
which has no line number information.
0x91e86a74 in getpriority ()
(gdb) s
Single stepping until exit from function getpriority,
which has no line number information.
0x780ac58c in emul_func ()
(gdb) s
Single stepping until exit from function _Z9emul_funcPv,
which has no line number information.

Program received signal SIGUSR2, User defined signal 2.
0x1d71406c in ?? ()
(gdb) s
Cannot find bounds of current function

I ran with both jit on and off. The error reported is the same.

I also exchanged the SDL framework between the 1.2.10 and 1.2.15 versions. This makes no difference. A crash will happen.

Please let me know how to generate a more useful crash report.

Best,
Cat_7
Last edited by Cat_7 on Sun Apr 07, 2013 7:30 am, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

Vasi,

This is really excellent! Thank you!

May I ask one small enhancement: in the SheepShaver Preferences, could it be programmed so that "mydisk.sparsebundle" can be selected, and not open the contents of the package? That would make it easier for non-expert users to work with the preferences.

But that is a small request. Thank you again!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Ronald P. Regensburg »

emendelson wrote:could it be programmed so that "mydisk.sparsebundle" can be selected, and not open the contents of the package?
If that would be changed, could SheepShaver built-in prefs editor still access files inside .sheepvm packages?
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by vasi »

emendelson wrote:in the SheepShaver Preferences, could it be programmed so that "mydisk.sparsebundle" can be selected, and not open the contents of the package?
Oops! I remembered to make this change for SheepShaverLauncher, but not for the built-in preferences. See the issue here: https://github.com/cebix/macemu/pull/25 ... t-15898901

I'll make sure to include that in the next build. Don't worry Ronald, it won't remove the ability to access files inside .sheepvm—go ahead and try it in SheepShaverLauncher, both uses work ok.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

Here's a strange result. I replaced Ronald's most recent build with your new build in the application I use for launching WordPerfect for the Mac. It uses OS 8.6.

SheepShaver launches successfully only every SECOND time I launch it. Every OTHER time, it stops with the OS 8.6 splash-screen progress bar at around 10%. I then use Ctrl-Esc to shut it down - and then I restart it successfully. Then, the next time, it stops again at 10%. This pattern is absolutely consistent.

The console says the same thing each time, whether it fails or succeeds:

4/8/13 2:25:24.904 PM SheepShaver[47733]: CPSGetCurrentProcess(): This call is deprecated and should not be called anymore.
4/8/13 2:25:24.905 PM SheepShaver[47733]: CPSSetForegroundOperationState(): This call is deprecated and should not be called anymore.

Apparently there's an extension that's causing the problem, because it always starts successfully if I start with Extensions Off. I'll try to narrow it down to see if I can find the one that's causing the problem.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Ronald P. Regensburg »

emendelson wrote:The console says the same thing each time, whether it fails or succeeds:

4/8/13 2:25:24.904 PM SheepShaver[47733]: CPSGetCurrentProcess(): This call is deprecated and should not be called anymore.
4/8/13 2:25:24.905 PM SheepShaver[47733]: CPSSetForegroundOperationState(): This call is deprecated and should not be called anymore.
Probably not related to the weird issue you encounter. You will find these lines also when you launch my latest SheepShaver build. (Also, 'deprecated' calls usually work normally. It is a warning that they may not work anymore in a future OSX version.)
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by vasi »

emendelson wrote:SheepShaver launches successfully only every SECOND time I launch it. Every OTHER time, it stops with the OS 8.6 splash-screen progress bar at around 10%. I then use Ctrl-Esc to shut it down - and then I restart it successfully. Then, the next time, it stops again at 10%. This pattern is absolutely consistent.
Weeeeird. Are you running in 32-bit or 64-bit mode? The network driver is known to be buggy on 64-bit.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Ronald P. Regensburg »

I do not see this strange issue with a MacOS 8.6 setup in OSX 10.8.3, regardless 32-bit or 64-bit mode.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

vasi wrote:
emendelson wrote:SheepShaver launches successfully only every SECOND time I launch it. Every OTHER time, it stops with the OS 8.6 splash-screen progress bar at around 10%. I then use Ctrl-Esc to shut it down - and then I restart it successfully. Then, the next time, it stops again at 10%. This pattern is absolutely consistent.
Weeeeird. Are you running in 32-bit or 64-bit mode? The network driver is known to be buggy on 64-bit.
My application opens the SheepShaver unix executable from the command line (using the "open -a /path/to/sheepshaver") command, so I assume I'm running it in 64-bit mode. Is there a command-line switch that would set it to 32-bit mode?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

Ronald P. Regensburg wrote:I do not see this strange issue with a MacOS 8.6 setup in OSX 10.8.3, regardless 32-bit or 64-bit mode.
So it's presumably an extension in my setup. I'll report back later with any details that I discover.
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by vasi »

emendelson wrote:My application opens the SheepShaver unix executable from the command line (using the "open -a /path/to/sheepshaver") command, so I assume I'm running it in 64-bit mode. Is there a command-line switch that would set it to 32-bit mode?
You can check in Activity Monitor whether it's actually running in 32-bit or 64-bit mode. I believe the 'open' command respects the "Open in 32-bit mode" setting from the Get Info panel.

The networking bug is a memory-corruption issue, so it's perfectly possible for Ronald to observe no bug, but for me or you to fall victim to it, depending on all sorts of things: host OS, what other programs are running, phase of the moon... ;)
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Cat_7 »

Hi,

From our Appletalk guide:
SheepShaver -arch i386

Should do the trick.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

I think I found the cause of the problem. It's a control panel called "Dialog View". I'll zip it up and post a copy of it later. But right now, I seem to have solved the problem by disabling it. More details soon.

EDIT: Here it is:

http://www.jwwalker.com/pages/dv.html
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sparsebundle support, and new builds of SS & B2

Post by emendelson »

Just to confirm: As soon as I disabled Dialog View, the problem went away. I also tried trashing the preferences for it and letting the Control Panel recreate the preferences, but that didn't help. I had to disable it entirely.

For some reason, Dialog View does not cause problems with exactly the same disk image when run with Ronald's most recent build. Very strange!
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Cat_7 »

Hi,

It seems the standalone BasiliskGUI64 for Linux is missing the JIT tab.

Best,
Cat_7
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by vasi »

Cat_7 wrote:ERROR: Your Mac program made an illegal word read access to address 0x61ce61e6.
Well, I'm an idiot. Have you tried putting "ignoreillegal true" in your prefs?

I finally tried it on PPC hardware with OS X, and it works for me! It's a bit unstable, particularly double-clicking sometimes causes it to hang and corrupt the disk, but that happens with all other versions of SheepShaver as well.
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Sparsebundle support, and new builds of SS & B2

Post by Myrd »

Cat_7 wrote: -SheepShaver is extremely unstable on PPC. I've seen this on most of the recent builds, only a build from Oct. 2009 behaves "nicely".
Has anyone tried trying to find out at what point in the code this started to happen? I guess the first thing to try is to checkout the code as it was in Oct 2009 and build it to see if that build works the same as the one you've tried.

If it does work well, then some code change is responsible for the issue - so it should be possible to track that down to the specific bad change. On the other hand, if that build has the problem too, then it may be some build environment / configuration issue, which may be harder to debug.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sparsebundle support, and new builds of SS & B2

Post by Ronald P. Regensburg »

Scattered around the forum are indications that the October 2009 build is more stable on PPC than the July 2012 build. Some went back to the earlier build for that reason.
(The October 2009 build does have the issue on PPC of the odd "unexpectedly quit" message at launch that can be ignored. That issue was resolved somewhere between November 6, 2010 and February 11, 2012.)

If needed, I can still provide all my builds since July 2008.
ykai
Student Driver
Posts: 16
Joined: Mon Jan 14, 2008 12:53 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by ykai »

Hello,
To use a sparsebundle with SS/B2, just add it to the VM like any other disk. So your prefs file will have a line You can do this manually, or with any of the available GUIs. When you launch SS/B2, it will offer to format the sparsebundle, just like any other disk. You can even install MacOS and boot from a sparsebundle.
I tried this (with "SheepShaverLauncher") and the sparsebundle is shown in the prefs, as expected.
The sparsebundle is located in the same folder than Sheep Shaver.
When I start SheepShaver it ask to format the bundle (ProDOS 0 Ko, the only choice), BUT... it cannot do it because it is announced as "locked" and the volume is not shown when SS finished its start

Informations:
- I use SheepShave 2.4 (2012-07-15) on Mac OS Mountain Lion

- Sparsebundle was made with Disk utility with following choices:
Nom: Sheep
Taille: 1Go
Format: Mac OS étendu journalisé
Chiffrement: Aucun
Partitions: Partition unique, table de partition GUID
Format image: Image disque SparseBundle

- The permissions on the Sparsebundle are:
User (admin): read-write
staff: read only
everyone: read only

- I tried to give read-write access to all, but ... no difference.

Thank you for your help :smile:
Yves
NucAr
Tinkerer
Posts: 69
Joined: Mon Aug 13, 2012 1:42 am

Re: Sparsebundle support, and new builds of SS & B2

Post by NucAr »

ykai wrote: Informations:
- I use SheepShave 2.4 (2012-07-15) on Mac OS Mountain Lion
That build doesn't support sparse bundles. The test build does.

http://www.emaculation.com/forum/viewto ... =20&t=8021
ykai
Student Driver
Posts: 16
Joined: Mon Jan 14, 2008 12:53 pm

Re: Sparsebundle support, and new builds of SS & B2

Post by ykai »

NucAr wrote:
ykai wrote: Informations:
- I use SheepShave 2.4 (2012-07-15) on Mac OS Mountain Lion
That build doesn't support sparse bundles. The test build does.

http://www.emaculation.com/forum/viewto ... =20&t=8021
YES ! It works now.
Thank You :smile:
Post Reply