[hfs-user] HFS and HFS+ wrapper

Mark Day mday@apple.com
Thu, 11 Apr 2002 10:21:21 -0700


On Thursday, April 11, 2002, at 03:53  AM, Biswaroop(External) wrote:

>    Then in older Macs if we read a filesystem of type
>    HFS+ in a HFS wrapper, do that wrapper also
>    take care for the internal differences in Data structures.
>  
>     A more summary of this wrapper concept would
>     satisfy my interest. Anybody can just give a more
>     basic understanding of this Wrapper and its functionalities would 
> be wonderfull.

A wrapper does NOT allow files on the HFS Plus volume to be accessed as 
an HFS volume.  It's not like a hybrid ISO/HFS disk where the same 
content appears in both directory structures.  If we had been able to 
make the increased storage efficiency of HFS Plus accessible using HFS 
directory structures, we wouldn't have needed to invent a new volume 
format...

A wrapper is merely a way to store an HFS Plus volume inside an HFS 
volume.  It is sort of like the way a DOS disk can have primary 
partitions that contain secondary partitions.  It is an HFS volume where 
some contiguous but otherwise unused space has been set aside to contain 
an HFS Plus volume.  It helps solve a couple of backwards compatibility 
problems:

1. Improve the user experience on systems that don't understand HFS Plus

Consider what would happen if you took a pure HFS Plus volume (no 
wrapper) and tried to mount it on a system that doesn't understand HFS 
Plus at all, but does understand HFS.  The signature fields in the 
Volume Header won't match anything the OS knows about (not even HFS).  
Most consumer operating systems will display a dialog telling you that 
the disk has no recognizable contents.  It may even offer to format the 
disk for you.  That's just asking for the user to accidentally format 
the disk and lose all of their data.

If the HFS Plus volume has a wrapper, and the OS understands HFS, the 
wrapper mounts as an ordinary HFS volume.  The user gets feedback that 
the computer recognized their disk, so they know it isn't blank.

But they also won't see the files they are expecting.  But since the 
wrapper is just an HFS volume, it can contain files.  When Apple's code 
produces wrappers, it puts a "Read Me" file in the wrapper.  When the 
wrapper mounts on an HFS-only system, the user will hopefully see and 
read that "Read Me" file.  It contains text that explains that the 
volume is really HFS Plus and that they need a newer version of system 
software to be able to use the files on the disk.  We think that makes 
for a much friendlier user experience than the "Do you want to format 
this disk?" dialog they would otherwise get.

2. Allow booting on machines without built-in support for HFS Plus

At the time HFS Plus was first released, no Apple computers had HFS Plus 
support in ROM.  But we wanted to be able to boot from an HFS Plus 
volume.  The wrapper makes that possible.

Apple created wrappers contain a tiny System file (the basic part of the 
operating system that gets loaded by the boot code in ROM).  This isn't 
an entire operating system.  In fact, it is only enough code to find the 
embedded HFS Plus volume and read the System file stored there.  The 
real System file in the embedded HFS Plus volume contains all the code 
to read and write HFS Plus volumes, so the rest of the boot process 
proceeds normally, and completely ignorant of the HFS wrapper.

-Mark