msdos_fs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fat_boot_sector_t
 
struct  fat_boot_fsinfo_t
 
struct  msdos_dir_entry_t
 
struct  msdos_dir_slot_t
 

Macros

#define SECTOR_SIZE   512 /* sector size (bytes) */
 
#define SECTOR_BITS   9 /* log2(SECTOR_SIZE) */
 
#define MSDOS_DPB   (MSDOS_DPS) /* dir entries per block */
 
#define MSDOS_DPB_BITS   4 /* log2(MSDOS_DPB) */
 
#define MSDOS_DPS   (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
 
#define MSDOS_DPS_BITS   4 /* log2(MSDOS_DPS) */
 
#define MSDOS_LONGNAME   256 /* maximum name length */
 
#define MSDOS_ROOT_INO   1 /* The root inode number */
 
#define MSDOS_FSINFO_INO   2 /* Used for managing the FSINFO block */
 
#define MSDOS_DIR_BITS   5 /* log2(sizeof(struct msdos_dir_entry)) */
 
#define FAT_MAX_DIR_ENTRIES   (65536)
 
#define FAT_MAX_DIR_SIZE   (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
 
#define ATTR_NONE   0x0000 /* no attribute bits */
 
#define ATTR_RO   0x0001 /* read-only */
 
#define ATTR_HIDDEN   0x0002 /* hidden */
 
#define ATTR_SYS   0x0004 /* system */
 
#define ATTR_VOLUME   0x0008 /* volume label */
 
#define ATTR_DIR   0x0010 /* directory */
 
#define ATTR_ARCH   0x0020 /* archived */
 
#define ATTR_UNUSED   (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
 
#define ATTR_EXT   (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
 
#define CASE_LOWER_BASE   8 /* base is lower case */
 
#define CASE_LOWER_EXT   16 /* extension is lower case */
 
#define DELETED_FLAG   0xe5 /* marks file as deleted when in name[0] */
 
#define IS_FREE(n)   (!*(n) || *(n) == DELETED_FLAG)
 
#define FAT_LFN_LEN   255 /* maximum long name length */
 
#define MSDOS_NAME   11 /* maximum name length */
 
#define MSDOS_SLOTS   21 /* max # of slots for short and long names */
 
#define MSDOS_DOT   ". " /* ".", padded to MSDOS_NAME chars */
 
#define MSDOS_DOTDOT   ".. " /* "..", padded to MSDOS_NAME chars */
 
#define FAT_START_ENT   2
 
#define BAD_FAT12   0xFF7
 
#define BAD_FAT16   0xFFF7
 
#define BAD_FAT32   0x0FFFFFF7
 
#define EOF_FAT12   0xFFF
 
#define EOF_FAT16   0xFFFF
 
#define EOF_FAT32   0x0FFFFFFF
 
#define FAT_ENT_FREE   (0)
 
#define FAT_ENT_BAD   (BAD_FAT32)
 
#define FAT_ENT_EOF   (EOF_FAT32)
 
#define FAT_FSINFO_SIG1   0x41615252
 
#define FAT_FSINFO_SIG2   0x61417272
 
#define IS_FSINFO(x)   ((x)->signature1 == FAT_FSINFO_SIG1 && (x)->signature2 == FAT_FSINFO_SIG2)
 
#define FAT_STATE_DIRTY   0x01
 

Macro Definition Documentation

◆ ATTR_ARCH

#define ATTR_ARCH   0x0020 /* archived */

◆ ATTR_DIR

#define ATTR_DIR   0x0010 /* directory */

◆ ATTR_EXT

#define ATTR_EXT   (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)

◆ ATTR_HIDDEN

#define ATTR_HIDDEN   0x0002 /* hidden */

◆ ATTR_NONE

#define ATTR_NONE   0x0000 /* no attribute bits */

◆ ATTR_RO

#define ATTR_RO   0x0001 /* read-only */

◆ ATTR_SYS

#define ATTR_SYS   0x0004 /* system */

◆ ATTR_UNUSED

#define ATTR_UNUSED   (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)

◆ ATTR_VOLUME

#define ATTR_VOLUME   0x0008 /* volume label */

◆ BAD_FAT12

#define BAD_FAT12   0xFF7

◆ BAD_FAT16

#define BAD_FAT16   0xFFF7

◆ BAD_FAT32

#define BAD_FAT32   0x0FFFFFF7

◆ CASE_LOWER_BASE

#define CASE_LOWER_BASE   8 /* base is lower case */

◆ CASE_LOWER_EXT

#define CASE_LOWER_EXT   16 /* extension is lower case */

◆ DELETED_FLAG

#define DELETED_FLAG   0xe5 /* marks file as deleted when in name[0] */

◆ EOF_FAT12

#define EOF_FAT12   0xFFF

◆ EOF_FAT16

#define EOF_FAT16   0xFFFF

◆ EOF_FAT32

#define EOF_FAT32   0x0FFFFFFF

◆ FAT_ENT_BAD

#define FAT_ENT_BAD   (BAD_FAT32)

◆ FAT_ENT_EOF

#define FAT_ENT_EOF   (EOF_FAT32)

◆ FAT_ENT_FREE

#define FAT_ENT_FREE   (0)

◆ FAT_FSINFO_SIG1

#define FAT_FSINFO_SIG1   0x41615252

◆ FAT_FSINFO_SIG2

#define FAT_FSINFO_SIG2   0x61417272

◆ FAT_LFN_LEN

#define FAT_LFN_LEN   255 /* maximum long name length */

◆ FAT_MAX_DIR_ENTRIES

#define FAT_MAX_DIR_ENTRIES   (65536)

◆ FAT_MAX_DIR_SIZE

#define FAT_MAX_DIR_SIZE   (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)

◆ FAT_START_ENT

#define FAT_START_ENT   2

◆ FAT_STATE_DIRTY

#define FAT_STATE_DIRTY   0x01

◆ IS_FREE

#define IS_FREE (   n)    (!*(n) || *(n) == DELETED_FLAG)

◆ IS_FSINFO

#define IS_FSINFO (   x)    ((x)->signature1 == FAT_FSINFO_SIG1 && (x)->signature2 == FAT_FSINFO_SIG2)

◆ MSDOS_DIR_BITS

#define MSDOS_DIR_BITS   5 /* log2(sizeof(struct msdos_dir_entry)) */

◆ MSDOS_DOT

#define MSDOS_DOT   ". " /* ".", padded to MSDOS_NAME chars */

◆ MSDOS_DOTDOT

#define MSDOS_DOTDOT   ".. " /* "..", padded to MSDOS_NAME chars */

◆ MSDOS_DPB

#define MSDOS_DPB   (MSDOS_DPS) /* dir entries per block */

◆ MSDOS_DPB_BITS

#define MSDOS_DPB_BITS   4 /* log2(MSDOS_DPB) */

◆ MSDOS_DPS

#define MSDOS_DPS   (SECTOR_SIZE / sizeof(struct msdos_dir_entry))

◆ MSDOS_DPS_BITS

#define MSDOS_DPS_BITS   4 /* log2(MSDOS_DPS) */

◆ MSDOS_FSINFO_INO

#define MSDOS_FSINFO_INO   2 /* Used for managing the FSINFO block */

◆ MSDOS_LONGNAME

#define MSDOS_LONGNAME   256 /* maximum name length */

◆ MSDOS_NAME

#define MSDOS_NAME   11 /* maximum name length */

◆ MSDOS_ROOT_INO

#define MSDOS_ROOT_INO   1 /* The root inode number */

◆ MSDOS_SLOTS

#define MSDOS_SLOTS   21 /* max # of slots for short and long names */

◆ SECTOR_BITS

#define SECTOR_BITS   9 /* log2(SECTOR_SIZE) */

◆ SECTOR_SIZE

#define SECTOR_SIZE   512 /* sector size (bytes) */