[klibc] why mtd root device number is __makedev(0,254)

Andrea Adami andrea.adami at gmail.com
Wed Mar 24 16:37:45 PDT 2010


>> +static int vfat_image(const unsigned char *buf, unsigned long *blocks)
>> +{
>> +        const struct romfs_super_block *sb =
>> +               (const struct romfs_super_block *)buf;
>
> hmm using *romfs* sb to check against vfat.
>

Art least I think I know why:
* Most file system types can be recognized by a `magic' number
   in the superblock.  Note that the order of the tests is
   significant: by coincidence a filesystem can have the
   magic numbers for several file system types simultaneously.
   For example, the romfs magic lives in the 1st sector;
   xiafs does not touch the 1st sector and has its magic in
   the 2nd sector; ext2 does not touch the first two sectors. */

Regards

Andrea



More information about the klibc mailing list