An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
.disk_label file format?
#15933 06/08/11 08:51 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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
Re: .disk_label file format?
Virtual1 #15934 06/08/11 09:30 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
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?

Last edited by Hal Itosis; 06/08/11 09:34 PM.
Re: .disk_label file format?
Virtual1 #15935 06/08/11 09:48 PM
Joined: Aug 2009
Likes: 3
Moderator
Offline
Moderator

Joined: Aug 2009
Likes: 3

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
Re: .disk_label file format?
Hal Itosis #15936 06/08/11 09:49 PM
Joined: Aug 2009
Likes: 3
Moderator
Offline
Moderator

Joined: Aug 2009
Likes: 3

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



dkmarsh—member, FineTunedMac Co-op Board of Directors
Re: .disk_label file format?
Virtual1 #15937 06/08/11 09:55 PM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
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
Re: .disk_label file format?
tacit #15956 06/09/11 05:12 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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
Re: .disk_label file format?
Hal Itosis #15957 06/09/11 05:16 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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

Moderated by  alternaut, cyn 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.016s Queries: 28 (0.012s) Memory: 0.6034 MB (Peak: 0.6769 MB) Data Comp: Zlib Server Time: 2024-03-29 13:40:24 UTC
Valid HTML 5 and Valid CSS