An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#15933 - 06/08/11 03:51 PM .disk_label file format?
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Another obscure question from someone that's got his fingers in the machine fiddling with it... what is the file format of the file normally seen in
/System/Library/CoreServices/.disk_label
? It's a hidden file, and is created by the system when a volume is blessed for booting on intel. There is an associated file .disk_label.contentDetails that contains the name of the volume, but .disk_label is a graphic rendering of the words. This is the image drawn below the volume icon when using the boot picker by holding Option when booting. It uses this to be able to render the name in any alphabet without loading any font files I'm sure.

I believe in Helvetica 10pt. I understand the file format roughly, it's very basic. First byte is $01. 2-3 are the width in pixels, 4-5 are the height in pixels, and the w*h next bytes are the graphic. (size fits exactly, I'm confident I understand this part of it)

Problem is I'm not sure where the pixel data comes from. It's in row-major order, one byte per pixel. It's NOT greyscale. I'm presuming it's using a lookup table or color palate or something. I'd like to be able to place my own graphic on the labels, rather than relying on the OS to render it. Maybe add color if I can. Just playin' here, but been curious about this for awhile.

So, anyone know? Google doesn't work properly when searching for ".disk_label", it seems to search without the quotes which is unusual, and google is flooded with hits on the dos "disklabel" command.

Before you ask, I've already tried using preview and graphicconverter to save a shot of the label at the correct size but it always makes files much larger. (1-8k) The disklabel file in this case was something like 617 bytes, much smaller. Not tiff or bmp.
_________________________
I work for the Department of Redundancy Department

Top
#15934 - 06/08/11 04:30 PM Re: .disk_label file format? [Re: Virtual1]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
No idea.

I looked at its extended attributes and found these type and creator codes...

TYPE: tbxj
CREATOR: chrp

An initial google using that info turned up this page in Amit Singh's book “Mac OS X internals: a systems approach”

page 292


hmm, not much there maybe... but perhaps using tbxj in further searches will turn up something?


Edited by Hal Itosis (06/08/11 04:34 PM)

Top
#15935 - 06/08/11 04:48 PM Re: .disk_label file format? [Re: Virtual1]
dkmarsh Offline
Moderator

Registered: 08/04/09

Don't know about its format, but its type/creator are tbxj/chrp (found this out via

mdls /System/Library/CoreServices/.disk_label

after discovering that my boot volume, an APM-formatted volume which has only ever booted a PPC mini, has that very same file.)
_________________________

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top
#15936 - 06/08/11 04:49 PM Re: .disk_label file format? [Re: Hal Itosis]
dkmarsh Offline
Moderator

Registered: 08/04/09

Okay, the destination was redundant but the route was different. tongue
_________________________

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top
#15937 - 06/08/11 04:55 PM Re: .disk_label file format? [Re: Virtual1]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
Originally Posted By: Virtual1
Problem is I'm not sure where the pixel data comes from. It's in row-major order, one byte per pixel. It's NOT greyscale. I'm presuming it's using a lookup table or color palate or something.


Quite likely, it's an 8-bit index into the standard MacOS system color table--the one used if you create a GIF image and use the Macintosh color palette.

So it's essentially like a GIF, except that it is not LZW compressed and it does not have the color lookup table built in.
_________________________
Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Top
#15956 - 06/09/11 12:12 PM Re: .disk_label file format? [Re: tacit]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Originally Posted By: tacit
Quite likely, it's an 8-bit index into the standard MacOS system color table--the one used if you create a GIF image and use the Macintosh color palette.

So it's essentially like a GIF, except that it is not LZW compressed and it does not have the color lookup table built in.


ok that's kinda what I figured. (speculating the $01 at the start specifies to use a 'default palate'?) Now where might I find that color palate?
_________________________
I work for the Department of Redundancy Department

Top
#15957 - 06/09/11 12:16 PM Re: .disk_label file format? [Re: Hal Itosis]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Originally Posted By: Hal Itosis
No idea.

I looked at its extended attributes and found these type and creator codes...

TYPE: tbxj
CREATOR: chrp

An initial google using that info turned up this page in Amit Singh's book “Mac OS X internals: a systems approach”

page 292


hmm, not much there maybe... but perhaps using tbxj in further searches will turn up something?


tbx is a prefix associated with OS X boot loaders so that doesn't surpriseme. chrp I've seen before but I can't recall where.

"Common Hardware Reference Platform (CHRP)" ahh that. not that it helps.
_________________________
I work for the Department of Redundancy Department

Top

Moderator:  alternaut, cyn