[En-Nut-Discussion] Retrieve a partition label

Mathieu SOULARD kazh29 at gmail.com
Sun Jan 10 12:32:53 CET 2010


Hi,


I would like to get the volume label of the inserted SD card partition. I
had explored a little the API and some source files of Nut/OS and I didn't
found anything about that.

In my opinion, the label name could be retrieved from the function
PathVolMount which already retrieves information from the boot sector where
the volume label is available.
(see
http://en.wikipedia.org/wiki/File_Allocation_Table#Extended_BIOS_Parameter_Block
)

It could be possible to extend the structure PATHVOL with a new char array
field with a length of 11+1 bytes where the volume label could be copied at
mount operation.

* I would like to know your opinion about that update *

I would like to try it, but I'm confused about the way to retrieve this
information in my application from the device ID I get when I call
ID = _open(DEV_MMCARD_NAME ":1/PHAT0", _O_RDWR | _O_BINARY);

Maybe something like that:

NUTFILE *fp = (NUTFILE *) ((uintptr_t) ID);
PHATVOL *vol;
vol = (PHATVOL *) fp->nf_dev->dev_dcb;

But it does not seem to be the nice way...

* Does someone could help me to understand the way to retrieve the PATHVOL
structure associated to the MMC device ? *



Thanks
Regards

Mathieu



More information about the En-Nut-Discussion mailing list