Login  •  Register


The time is now: Mon Jan 23, 2017 8:43 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 2 [ 43 posts ]    Go to page 1, 2  Next
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sun Apr 06, 2014 7:14 pm 
Offline
Tinkerer

Joined: Thu Aug 14, 2008 9:05 am
Posts: 77
This is a pretty old project that's been sitting on my back burner, 95% complete, for a long time. I finally decided to dust it off and complete it, and at the present time it seems to be working pretty well.

http://www.charlessoft.com/HFS_Disk_Maker.zip

This is an app which will let you easily create an HFS disk image for any file and/or folder on your hard disk. This is intended to make it easy to import files into emulators such as Mini vMac, Basilisk, etc. which typically run operating systems that only support HFS. This tool will let you create an HFS disk image without having to resort to installing system-wide extensions like FUSE.

Usage is pretty simple; you just launch the app, choose a file or folder, then choose a filename for the disk image. Alternatively, you can just drag-and-drop a file or folder onto the app and it will make a disk image from it.

The disk image is made completely from scratch by assembling all of the HFS data structures, catalog file, etc. by hand. It is independent of any support for HFS in the operating sytem. Resource forks, HFS type codes, and other HFS metadata are preserved.

After creating a disk image, fsck_hfs is run on it to make sure no errors were inadvertently introduced into its structure while creating the image.

I hope you find this app useful.

_________________
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 07, 2014 4:35 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
Wow! This is a creat util now that OS X has such lacklustre support for HFS images. Any chance of doing the reverse as well (allowing extraction of files from an HFS NDIF image)?

Also, is this code portable to other OSes?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Apr 09, 2014 2:50 am 
Offline
Tinkerer

Joined: Thu Aug 14, 2008 9:05 am
Posts: 77
The reverse would certainly be possible, but since OS X still has read support for HFS images, it doesn't seem necessary to me, as you can just double-click the image and drag its contents out via the Finder. However, if there is enough demand for it, I may end up doing it.

The code is all in Objective-C and as such is probably not portable to other OSes without the use of tools such as GNUStep or Cocotron. However, there is a program called HFVExplorer which lets you create and manipulate HFS images on Windows.

_________________
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Apr 09, 2014 4:57 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
OS X still has read support for HFS, but no longer supports NDIF images; they have to be converted before reading, and I've started to find that my older images can't even be converted correctly under 10.9 (including my old Apple Update CD images). I'd rather have a working replacement before they kill off support in Disk Utlity altogether, rather than afterwards :)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Apr 09, 2014 5:18 pm 
Offline
Tinkerer

Joined: Thu Aug 14, 2008 9:05 am
Posts: 77
Reading from an uncompressed NDIF image would be pretty easy to do, given that I've already done most of the work for this project. The trouble is that some of them are compressed, and the compression algorithms used are proprietary. Reading those would require reverse-engineering the algorithms (and there's more than one of them). That would take a *lot* of work.

_________________
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Apr 09, 2014 8:34 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
Yeah; don't worry about compressed NDIF; that was only supported by a few versions of Disk Utility and is much more modern than most of the systems we're trying to work with here. Identifying it as compressed and throwing an error might be worthwhile though.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Apr 10, 2014 11:51 am 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
I tried HFS Disk Maker in OSX 10.9.2 with folders and with separate files.

Each attempt results in an image file that indeed works in the emulators, but with also this message:
Quote:
Creating disk image.

Checking validity of image:

Attaching image failed: Error Domain=com.charlessoft.CSFoundation.ErrorDomain Code=-1 "imageinfo failed - image not recognized
" UserInfo=0x7fd0fd0d96c0 {CSErrorKey=true, NSLocalizedDescription=imageinfo failed - image not recognized
, NSLocalizedFailureReason=imageinfo failed - image not recognized
}

Image verification failed. It is likely that this disk image is corrupted, possibly due to a bug in this program. Use this disk image only at your own risk.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Apr 10, 2014 4:43 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
What does Disk Utility say about them?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Apr 10, 2014 5:47 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
Oops! This was an unfinished text that I did not intend to post. I have no time now to explain, have to go to a business meeting. I'll come back later.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Apr 10, 2014 9:43 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
While I was composing the text that I accidentally posted, I realized what could be a cause for the error message. And it appeared to be that indeed.

The validation error occurs when I do not give the file to be created a file name extension in the Save dialog. The resulting image file itself is fine and can be used in Mini vMac, BasiliskII, and SheepShaver.

When I try to add a wrong extension in the Save dialog, I will get a warning, but not when I do not add an extension.

If I add an .img extension to the name in the Save dialog, verification is successful and the resulting image can also be mounted (of course read-only) fine in OSX.


Last edited by Ronald P. Regensburg on Thu Apr 10, 2014 9:45 pm, edited 1 time in total.
 


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Apr 11, 2014 5:19 pm 
Offline
Tinkerer

Joined: Thu Aug 14, 2008 9:05 am
Posts: 77
Ah, sorry about that. I forgot that hdiutil (which I use to attach the image so that I can run fsck on it) is fussy about filename extensions. I've updated the app, which should now disallow any filename extension that hdiutil doesn't recognize.

_________________
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Apr 11, 2014 6:31 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
Hmm; hdiutil for fsck sounds like a good idea; however, if hdiutil stops supporting the format, this verification will die. Can't think of an alternative method to verify offhand though (except maybe a custom Mini vMac-based tool).

As long as it's purely informative as you've done now, it's probably good as-is :)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Apr 13, 2014 1:11 am 
Offline
Tinkerer

Joined: Thu Aug 14, 2008 9:05 am
Posts: 77
The "format" for an uncompressed disk image is just the raw bits and bytes of the disk copied straight into a file. If you copy the bytes straight from /dev/rdiskN to a file, you've basically just made an uncompressed disk image. Actually, you can actually create a completely empty file containing nothing but zeroes, stick a ".dmg" extension on it, and hdiutil -nomount will attach it. It won't mount on the Desktop, of couse, but it will show up as a non-formatted hard drive that you can then format using the standard tools, after which it's a perfectly ordinary disk image.

An uncompressed NDIF and an uncompressed DMG are pretty much exactly the same thing. In fact, if you have one of those NDIF images that the Finder gives you that "legacy image should be converted" error for, if it's uncompressed, you can make a copy of it, nuke the resource fork, and nuke the type/creator code, and suddenly it will mount just fine with no errors at all. This is because the bits in the resource fork and HFS metadata that identify the format as NDIF are the only thing that distinguish an uncompressed NDIF from an uncompressed DMG. Where the two differ are when you start doing fancy stuff like compression, encryption, etc. And since just writing out the structure of an HFS volume straight to a file is exactly what my tool is doing, I'm not worried about hdiutil ever discontinuing support for it.

What could happen is fsck eventually losing support for scanning HFS volumes, but that's not a problem either since it's open source software. If and when HFS support is removed from the current fsck (and I'm sure it'll happen eventually), all I'd have to do is download the source code for the last version of fsck that supported HFS, bundle it with the app, and add the appropriate attributions to the documentation in accordance with the terms of the APSL. Theoretically, I could even modify the fsck code so that it could read directly from my image and cut out the hdiutil middleman completely (and then I could go back to supporting .dsk and other arbitrary extensions that hdiutil doesn't like), although as long as HFS support remains in the trunk, I might as well just continue using that and automatically get any improvements Apple happens to make to it in future OS X releases.

_________________
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 14, 2014 12:52 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
A very useful tool indeed, especially now that we cannot write to HFS volumes anymore in later OSX versions.

I added a link to this topic on the Downloads page in our wiki: http://www.emaculation.com/doku.php/downloads


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 14, 2014 6:03 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1387
CharlesS wrote:
...the bits in the resource fork and HFS metadata that identify the format as NDIF are the only thing that distinguish an uncompressed NDIF from an uncompressed DMG.


Aha! This it the bit that was troubling me, as I couldn't figure out why Disk Utility was erroring on NDIF when I couldn't see any difference between them myself. I think I'll write up an "Uncompressed NDIF to DMG converter" when I get home tonight... I could probably even make it work in both directions :) Since the resource fork won't have anything in it pertaining to the contents (just the image itself), I think such a thing would be pretty safe.

Then again, you could roll this into your disk maker too ;)

Now to see if I can make this work with my HFS CD images.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon May 05, 2014 1:41 pm 
Offline
Student Driver

Joined: Mon Jul 07, 2008 9:22 pm
Posts: 10
Location: Valencia, Spain
Seems diskmaker crashses on Mavricks? Anyone else got the same problems. I'm trying to create a HFS image for Shoebill.

Thanks,
Rob


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon May 05, 2014 2:12 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
robbo007 wrote:
Seems diskmaker crashses on Mavricks?

Must be something else. HFS Disk Maker works fine here in Mavericks (10.9.2).


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon May 05, 2014 2:49 pm 
Offline
Student Driver

Joined: Mon Jul 07, 2008 9:22 pm
Posts: 10
Location: Valencia, Spain
I'm trying to get A/ux running under Shoebill. You don't happen to have a created HFS volume do you?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon May 05, 2014 7:20 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
robbo007 wrote:
You don't happen to have a created HFS volume do you?

Not sure why you ask. Isn't that what HFS Disk Maker does? I used it to make a HFS disk image from a folder with files.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun May 11, 2014 12:27 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
Apparently HFS Disk Maker works only in OSX 10.9 (Mavericks). Maybe because it was compiled on 10.9? I wonder if it could be created fro 10.6 and up.

In the meantime I will add this information in the link's label in the download area in our wiki.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 06, 2015 12:03 am 
Offline
Student Driver
User avatar

Joined: Mon Jan 05, 2015 11:55 pm
Posts: 18
Hi and sorry if this a really dumb question, but this app only seems to run in Classic mode. I thought you'd create a disk image in OSX and then open that in the emulator? Is that not how it's supposed to work?

Thanks,
cardioid

_________________
MacPro with OSX 10.6.8, Mini vMac 3.2.3 with 6.0.7


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 06, 2015 8:53 am 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
The app runs in OSX. It did run fine here in OSX 10.9.x (Mavericks) and still does in 10.10.1 (Yosemite). It creates HFS volumes that can be used with emulators that run MacOS versions (8.0 and earlier) that cannot use HFS+ volumes.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 07, 2015 8:42 pm 
Offline
Student Driver
User avatar

Joined: Mon Jan 05, 2015 11:55 pm
Posts: 18
Ok, the app requires 10.9. I have 10.6.8 and I get an error message that it requires 10.9. An interesting message actually, since I never knew there could be messages that refer to a future system...

Do you know of a tool that creates an image under 10.6 or a link where I can download one?

Thanks,
cardioid

_________________
MacPro with OSX 10.6.8, Mini vMac 3.2.3 with 6.0.7


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 07, 2015 9:01 pm 
Online
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4634
Location: Amsterdam, Netherlands
(The file info.plist inside the application states that minimum system version is 10.9. That's how your system knows about a future system version.)

With which emulator do you want to use the disk images?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 07, 2015 11:28 pm 
Offline
Student Driver
User avatar

Joined: Mon Jan 05, 2015 11:55 pm
Posts: 18
Ronald P. Regensburg wrote:
(The file info.plist inside the application states that minimum system version is 10.9. That's how your system knows about a future system version.)

With which emulator do you want to use the disk images?


I'm using Mini vMac. I just used my wife's MacBook Pro which has 10.9 (go figure) and now it worked. So I now have bootable disk image transfered via a USB stick to my SL machine with all my goodies. Unfortunately, I can't get ImportFL to work, but I'll post that into a new thread.

Thanks!

_________________
MacPro with OSX 10.6.8, Mini vMac 3.2.3 with 6.0.7


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 2 [ 43 posts ]    Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group