HP85 GPIB Disk Emulator
1.0
HP85GPIBDiskEmulator
|
Go to the source code of this file.
Macros | |
#define | MAX_DIR 0x200000 /* Max size of FAT directory */ |
#define | MAX_DIR_EX 0x10000000 /* Max size of exFAT directory */ |
#define | MAX_FAT12 0xFF5 /* Max FAT12 clusters (differs from specs, but right for real DOS/Windows behavior) */ |
#define | MAX_FAT16 0xFFF5 /* Max FAT16 clusters (differs from specs, but right for real DOS/Windows behavior) */ |
#define | MAX_FAT32 0x0FFFFFF5 /* Max FAT32 clusters (not specified, practical limit) */ |
#define | MAX_EXFAT 0x7FFFFFFD /* Max exFAT clusters (differs from specs, implementation limit) */ |
#define | IsUpper(c) ((c) >= 'A' && (c) <= 'Z') |
#define | IsLower(c) ((c) >= 'a' && (c) <= 'z') |
#define | IsDigit(c) ((c) >= '0' && (c) <= '9') |
#define | IsSurrogate(c) ((c) >= 0xD800 && (c) <= 0xDFFF) |
#define | IsSurrogateH(c) ((c) >= 0xD800 && (c) <= 0xDBFF) |
#define | IsSurrogateL(c) ((c) >= 0xDC00 && (c) <= 0xDFFF) |
#define | FA_SEEKEND 0x20 /* Seek to end of the file on file open */ |
#define | FA_MODIFIED 0x40 /* File has been modified */ |
#define | FA_DIRTY 0x80 /* FIL.buf[] needs to be written-back */ |
#define | AM_VOL 0x08 /* Volume label */ |
#define | AM_LFN 0x0F /* LFN entry */ |
#define | AM_MASK 0x3F /* Mask of defined bits */ |
#define | NSFLAG 11 /* Index of the name status byte */ |
#define | NS_LOSS 0x01 /* Out of 8.3 format */ |
#define | NS_LFN 0x02 /* Force to create LFN entry */ |
#define | NS_LAST 0x04 /* Last segment */ |
#define | NS_BODY 0x08 /* Lower case flag (body) */ |
#define | NS_EXT 0x10 /* Lower case flag (ext) */ |
#define | NS_DOT 0x20 /* Dot entry */ |
#define | NS_NOLFN 0x40 /* Do not find LFN */ |
#define | NS_NONAME 0x80 /* Not followed */ |
#define | ET_BITMAP 0x81 /* Allocation bitmap */ |
#define | ET_UPCASE 0x82 /* Up-case table */ |
#define | ET_VLABEL 0x83 /* Volume label */ |
#define | ET_FILEDIR 0x85 /* File and directory */ |
#define | ET_STREAM 0xC0 /* Stream extension */ |
#define | ET_FILENAME 0xC1 /* Name extension */ |
#define | BS_JmpBoot 0 /* x86 jump instruction (3-byte) */ |
#define | BS_OEMName 3 /* OEM name (8-byte) */ |
#define | BPB_BytsPerSec 11 /* Sector size [byte] (WORD) */ |
#define | BPB_SecPerClus 13 /* Cluster size [sector] (BYTE) */ |
#define | BPB_RsvdSecCnt 14 /* Size of reserved area [sector] (WORD) */ |
#define | BPB_NumFATs 16 /* Number of FATs (BYTE) */ |
#define | BPB_RootEntCnt 17 /* Size of root directory area for FAT [entry] (WORD) */ |
#define | BPB_TotSec16 19 /* Volume size (16-bit) [sector] (WORD) */ |
#define | BPB_Media 21 /* Media descriptor byte (BYTE) */ |
#define | BPB_FATSz16 22 /* FAT size (16-bit) [sector] (WORD) */ |
#define | BPB_SecPerTrk 24 /* Number of sectors per track for int13h [sector] (WORD) */ |
#define | BPB_NumHeads 26 /* Number of heads for int13h (WORD) */ |
#define | BPB_HiddSec 28 /* Volume offset from top of the drive (DWORD) */ |
#define | BPB_TotSec32 32 /* Volume size (32-bit) [sector] (DWORD) */ |
#define | BS_DrvNum 36 /* Physical drive number for int13h (BYTE) */ |
#define | BS_NTres 37 /* WindowsNT error flag (BYTE) */ |
#define | BS_BootSig 38 /* Extended boot signature (BYTE) */ |
#define | BS_VolID 39 /* Volume serial number (DWORD) */ |
#define | BS_VolLab 43 /* Volume label string (8-byte) */ |
#define | BS_FilSysType 54 /* Filesystem type string (8-byte) */ |
#define | BS_BootCode 62 /* Boot code (448-byte) */ |
#define | BS_55AA 510 /* Signature word (WORD) */ |
#define | BPB_FATSz32 36 /* FAT32: FAT size [sector] (DWORD) */ |
#define | BPB_ExtFlags32 40 /* FAT32: Extended flags (WORD) */ |
#define | BPB_FSVer32 42 /* FAT32: Filesystem version (WORD) */ |
#define | BPB_RootClus32 44 /* FAT32: Root directory cluster (DWORD) */ |
#define | BPB_FSInfo32 48 /* FAT32: Offset of FSINFO sector (WORD) */ |
#define | BPB_BkBootSec32 50 /* FAT32: Offset of backup boot sector (WORD) */ |
#define | BS_DrvNum32 64 /* FAT32: Physical drive number for int13h (BYTE) */ |
#define | BS_NTres32 65 /* FAT32: Error flag (BYTE) */ |
#define | BS_BootSig32 66 /* FAT32: Extended boot signature (BYTE) */ |
#define | BS_VolID32 67 /* FAT32: Volume serial number (DWORD) */ |
#define | BS_VolLab32 71 /* FAT32: Volume label string (8-byte) */ |
#define | BS_FilSysType32 82 /* FAT32: Filesystem type string (8-byte) */ |
#define | BS_BootCode32 90 /* FAT32: Boot code (420-byte) */ |
#define | BPB_ZeroedEx 11 /* exFAT: MBZ field (53-byte) */ |
#define | BPB_VolOfsEx 64 /* exFAT: Volume offset from top of the drive [sector] (QWORD) */ |
#define | BPB_TotSecEx 72 /* exFAT: Volume size [sector] (QWORD) */ |
#define | BPB_FatOfsEx 80 /* exFAT: FAT offset from top of the volume [sector] (DWORD) */ |
#define | BPB_FatSzEx 84 /* exFAT: FAT size [sector] (DWORD) */ |
#define | BPB_DataOfsEx 88 /* exFAT: Data offset from top of the volume [sector] (DWORD) */ |
#define | BPB_NumClusEx 92 /* exFAT: Number of clusters (DWORD) */ |
#define | BPB_RootClusEx 96 /* exFAT: Root directory start cluster (DWORD) */ |
#define | BPB_VolIDEx 100 /* exFAT: Volume serial number (DWORD) */ |
#define | BPB_FSVerEx 104 /* exFAT: Filesystem version (WORD) */ |
#define | BPB_VolFlagEx 106 /* exFAT: Volume flags (WORD) */ |
#define | BPB_BytsPerSecEx 108 /* exFAT: Log2 of sector size in unit of byte (BYTE) */ |
#define | BPB_SecPerClusEx 109 /* exFAT: Log2 of cluster size in unit of sector (BYTE) */ |
#define | BPB_NumFATsEx 110 /* exFAT: Number of FATs (BYTE) */ |
#define | BPB_DrvNumEx 111 /* exFAT: Physical drive number for int13h (BYTE) */ |
#define | BPB_PercInUseEx 112 /* exFAT: Percent in use (BYTE) */ |
#define | BPB_RsvdEx 113 /* exFAT: Reserved (7-byte) */ |
#define | BS_BootCodeEx 120 /* exFAT: Boot code (390-byte) */ |
#define | DIR_Name 0 /* Short file name (11-byte) */ |
#define | DIR_Attr 11 /* Attribute (BYTE) */ |
#define | DIR_NTres 12 /* Lower case flag (BYTE) */ |
#define | DIR_CrtTime10 13 /* Created time sub-second (BYTE) */ |
#define | DIR_CrtTime 14 /* Created time (DWORD) */ |
#define | DIR_LstAccDate 18 /* Last accessed date (WORD) */ |
#define | DIR_FstClusHI 20 /* Higher 16-bit of first cluster (WORD) */ |
#define | DIR_ModTime 22 /* Modified time (DWORD) */ |
#define | DIR_FstClusLO 26 /* Lower 16-bit of first cluster (WORD) */ |
#define | DIR_FileSize 28 /* File size (DWORD) */ |
#define | LDIR_Ord 0 /* LFN: LFN order and LLE flag (BYTE) */ |
#define | LDIR_Attr 11 /* LFN: LFN attribute (BYTE) */ |
#define | LDIR_Type 12 /* LFN: Entry type (BYTE) */ |
#define | LDIR_Chksum 13 /* LFN: Checksum of the SFN (BYTE) */ |
#define | LDIR_FstClusLO 26 /* LFN: MBZ field (WORD) */ |
#define | XDIR_Type 0 /* exFAT: Type of exFAT directory entry (BYTE) */ |
#define | XDIR_NumLabel 1 /* exFAT: Number of volume label characters (BYTE) */ |
#define | XDIR_Label 2 /* exFAT: Volume label (11-WORD) */ |
#define | XDIR_CaseSum 4 /* exFAT: Sum of case conversion table (DWORD) */ |
#define | XDIR_NumSec 1 /* exFAT: Number of secondary entries (BYTE) */ |
#define | XDIR_SetSum 2 /* exFAT: Sum of the set of directory entries (WORD) */ |
#define | XDIR_Attr 4 /* exFAT: File attribute (WORD) */ |
#define | XDIR_CrtTime 8 /* exFAT: Created time (DWORD) */ |
#define | XDIR_ModTime 12 /* exFAT: Modified time (DWORD) */ |
#define | XDIR_AccTime 16 /* exFAT: Last accessed time (DWORD) */ |
#define | XDIR_CrtTime10 20 /* exFAT: Created time subsecond (BYTE) */ |
#define | XDIR_ModTime10 21 /* exFAT: Modified time subsecond (BYTE) */ |
#define | XDIR_CrtTZ 22 /* exFAT: Created timezone (BYTE) */ |
#define | XDIR_ModTZ 23 /* exFAT: Modified timezone (BYTE) */ |
#define | XDIR_AccTZ 24 /* exFAT: Last accessed timezone (BYTE) */ |
#define | XDIR_GenFlags 33 /* exFAT: General secondary flags (BYTE) */ |
#define | XDIR_NumName 35 /* exFAT: Number of file name characters (BYTE) */ |
#define | XDIR_NameHash 36 /* exFAT: Hash of file name (WORD) */ |
#define | XDIR_ValidFileSize 40 /* exFAT: Valid file size (QWORD) */ |
#define | XDIR_FstClus 52 /* exFAT: First cluster of the file data (DWORD) */ |
#define | XDIR_FileSize 56 /* exFAT: File/Directory size (QWORD) */ |
#define | SZDIRE 32 /* Size of a directory entry */ |
#define | DDEM 0xE5 /* Deleted directory entry mark set to DIR_Name[0] */ |
#define | RDDEM 0x05 /* Replacement of the character collides with DDEM */ |
#define | LLEF 0x40 /* Last long entry flag in LDIR_Ord */ |
#define | FSI_LeadSig 0 /* FAT32 FSI: Leading signature (DWORD) */ |
#define | FSI_StrucSig 484 /* FAT32 FSI: Structure signature (DWORD) */ |
#define | FSI_Free_Count 488 /* FAT32 FSI: Number of free clusters (DWORD) */ |
#define | FSI_Nxt_Free 492 /* FAT32 FSI: Last allocated cluster (DWORD) */ |
#define | MBR_Table 446 /* MBR: Offset of partition table in the MBR */ |
#define | SZ_PTE 16 /* MBR: Size of a partition table entry */ |
#define | PTE_Boot 0 /* MBR PTE: Boot indicator */ |
#define | PTE_StHead 1 /* MBR PTE: Start head */ |
#define | PTE_StSec 2 /* MBR PTE: Start sector */ |
#define | PTE_StCyl 3 /* MBR PTE: Start cylinder */ |
#define | PTE_System 4 /* MBR PTE: System ID */ |
#define | PTE_EdHead 5 /* MBR PTE: End head */ |
#define | PTE_EdSec 6 /* MBR PTE: End sector */ |
#define | PTE_EdCyl 7 /* MBR PTE: End cylinder */ |
#define | PTE_StLba 8 /* MBR PTE: Start in LBA */ |
#define | PTE_SizLba 12 /* MBR PTE: Size in LBA */ |
#define | GPTH_Sign 0 /* GPT: Header signature (8-byte) */ |
#define | GPTH_Rev 8 /* GPT: Revision (DWORD) */ |
#define | GPTH_Size 12 /* GPT: Header size (DWORD) */ |
#define | GPTH_Bcc 16 /* GPT: Header BCC (DWORD) */ |
#define | GPTH_CurLba 24 /* GPT: Main header LBA (QWORD) */ |
#define | GPTH_BakLba 32 /* GPT: Backup header LBA (QWORD) */ |
#define | GPTH_FstLba 40 /* GPT: First LBA for partitions (QWORD) */ |
#define | GPTH_LstLba 48 /* GPT: Last LBA for partitions (QWORD) */ |
#define | GPTH_DskGuid 56 /* GPT: Disk GUID (16-byte) */ |
#define | GPTH_PtOfs 72 /* GPT: Partation table LBA (QWORD) */ |
#define | GPTH_PtNum 80 /* GPT: Number of table entries (DWORD) */ |
#define | GPTH_PteSize 84 /* GPT: Size of table entry (DWORD) */ |
#define | GPTH_PtBcc 88 /* GPT: Partation table BCC (DWORD) */ |
#define | SZ_GPTE 128 /* GPT: Size of partition table entry */ |
#define | GPTE_PtGuid 0 /* GPT PTE: Partition type GUID (16-byte) */ |
#define | GPTE_UpGuid 16 /* GPT PTE: Partition unique GUID (16-byte) */ |
#define | GPTE_FstLba 32 /* GPT PTE: First LBA (QWORD) */ |
#define | GPTE_LstLba 40 /* GPT PTE: Last LBA inclusive (QWORD) */ |
#define | GPTE_Flags 48 /* GPT PTE: Flags (QWORD) */ |
#define | GPTE_Name 56 /* GPT PTE: Name */ |
#define | ABORT(fs, res) { fp->err = (BYTE)(res); LEAVE_FF(fs, res); } |
#define | LEAVE_FF(fs, res) return res |
#define | LD2PD(vol) (BYTE)(vol) /* Each logical drive is associated with the same physical drive number */ |
#define | LD2PT(vol) 0 /* Find first valid partition or in SFD */ |
#define | SS(fs) ((fs)->ssize) /* Variable sector size */ |
#define | GET_FATTIME() get_fattime() |
#define | TBL_CT437 |
#define | TBL_CT720 |
#define | TBL_CT737 |
#define | TBL_CT771 |
#define | TBL_CT775 |
#define | TBL_CT850 |
#define | TBL_CT852 |
#define | TBL_CT855 |
#define | TBL_CT857 |
#define | TBL_CT860 |
#define | TBL_CT861 |
#define | TBL_CT862 |
#define | TBL_CT863 |
#define | TBL_CT864 |
#define | TBL_CT865 |
#define | TBL_CT866 |
#define | TBL_CT869 |
#define | TBL_DC932 {0x81, 0x9F, 0xE0, 0xFC, 0x40, 0x7E, 0x80, 0xFC, 0x00, 0x00} |
#define | TBL_DC936 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0x80, 0xFE, 0x00, 0x00} |
#define | TBL_DC949 {0x81, 0xFE, 0x00, 0x00, 0x41, 0x5A, 0x61, 0x7A, 0x81, 0xFE} |
#define | TBL_DC950 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0xA1, 0xFE, 0x00, 0x00} |
#define | MERGE_2STR(a, b) a ## b |
#define | MKCVTBL(hd, cp) MERGE_2STR(hd, cp) |
#define | MAXDIRB(nc) ((nc + 44U) / 15 * SZDIRE) /* exFAT: Size of directory entry block scratchpad buffer needed for the name length */ |
#define | DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer */ |
#define | INIT_NAMBUF(fs) { lfn = ff_memalloc((FF_MAX_LFN+1)*2); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; } |
#define | FREE_NAMBUF() ff_memfree(lfn) |
#define | LEAVE_MKFS(res) { if (!work) ff_memfree(buf); return res; } |
#define | MAX_MALLOC (FF_MAX_SS*4) /* Must be >=FF_MAX_SS */ |
#define | CODEPAGE FF_CODE_PAGE |
#define | DIR_READ_FILE(dp) dir_read(dp, 0) |
#define | DIR_READ_LABEL(dp) dir_read(dp, 1) |
#define | N_SEC_TRACK 63 /* Sectors per track for determination of drive CHS */ |
#define | GPT_ALIGN 0x100000 /* Alignment of partitions in GPT [byte] (>=128KB) */ |
#define | GPT_ITEMS 128 /* Number of GPT table size (>=128, sector aligned) */ |
Functions | |
static WORD | ld_word (const BYTE *ptr) |
static DWORD | ld_dword (const BYTE *ptr) |
static void | st_word (BYTE *ptr, WORD val) |
static void | st_dword (BYTE *ptr, DWORD val) |
static void | mem_cpy (void *dst, const void *src, UINT cnt) |
static void | mem_set (void *dst, int val, UINT cnt) |
static int | mem_cmp (const void *dst, const void *src, UINT cnt) |
static int | chk_chr (const char *str, int chr) |
static int | dbc_1st (BYTE c) |
static int | dbc_2nd (BYTE c) |
static DWORD | tchar2uni (const TCHAR **str) |
static BYTE | put_utf (DWORD chr, TCHAR *buf, UINT szb) |
static FRESULT | sync_window (FATFS *fs) |
static FRESULT | move_window (FATFS *fs, LBA_t sect) |
static FRESULT | sync_fs (FATFS *fs) |
static LBA_t | clst2sect (FATFS *fs, DWORD clst) |
static DWORD | get_fat (FFOBJID *obj, DWORD clst) |
static FRESULT | put_fat (FATFS *fs, DWORD clst, DWORD val) |
static FRESULT | remove_chain (FFOBJID *obj, DWORD clst, DWORD pclst) |
static DWORD | create_chain (FFOBJID *obj, DWORD clst) |
static DWORD | clmt_clust (FIL *fp, FSIZE_t ofs) |
static FRESULT | dir_clear (FATFS *fs, DWORD clst) |
static FRESULT | dir_sdi (DIR *dp, DWORD ofs) |
static FRESULT | dir_next (DIR *dp, int stretch) |
static FRESULT | dir_alloc (DIR *dp, UINT nent) |
static DWORD | ld_clust (FATFS *fs, const BYTE *dir) |
static void | st_clust (FATFS *fs, BYTE *dir, DWORD cl) |
static int | cmp_lfn (const WCHAR *lfnbuf, BYTE *dir) |
static int | pick_lfn (WCHAR *lfnbuf, BYTE *dir) |
static void | put_lfn (const WCHAR *lfn, BYTE *dir, BYTE ord, BYTE sum) |
static void | gen_numname (BYTE *dst, const BYTE *src, const WCHAR *lfn, UINT seq) |
static BYTE | sum_sfn (const BYTE *dir) |
static FRESULT | dir_read (DIR *dp, int vol) |
static FRESULT | dir_find (DIR *dp) |
static FRESULT | dir_register (DIR *dp) |
static FRESULT | dir_remove (DIR *dp) |
static void | get_fileinfo (DIR *dp, FILINFO *fno) |
static DWORD | get_achar (const TCHAR **ptr) |
static int | pattern_matching (const TCHAR *pat, const TCHAR *nam, int skip, int inf) |
static FRESULT | create_name (DIR *dp, const TCHAR **path) |
static FRESULT | follow_path (DIR *dp, const TCHAR *path) |
static int | get_ldnumber (const TCHAR **path) |
static UINT | check_fs (FATFS *fs, LBA_t sect) |
static UINT | find_volume (FATFS *fs, UINT part) |
static FRESULT | mount_volume (const TCHAR **path, FATFS **rfs, BYTE mode) |
static FRESULT | validate (FFOBJID *obj, FATFS **rfs) |
FRESULT | f_mount (FATFS *fs, const TCHAR *path, BYTE opt) |
FRESULT | f_open (FIL *fp, const TCHAR *path, BYTE mode) |
FRESULT | f_read (FIL *fp, void *buff, UINT btr, UINT *br) |
FRESULT | f_write (FIL *fp, const void *buff, UINT btw, UINT *bw) |
FRESULT | f_sync (FIL *fp) |
FRESULT | f_close (FIL *fp) |
FRESULT | f_chdrive (const TCHAR *path) |
FRESULT | f_chdir (const TCHAR *path) |
FRESULT | f_getcwd (TCHAR *buff, UINT len) |
FRESULT | f_lseek (FIL *fp, FSIZE_t ofs) |
FRESULT | f_opendir (DIR *dp, const TCHAR *path) |
FRESULT | f_closedir (DIR *dp) |
FRESULT | f_readdir (DIR *dp, FILINFO *fno) |
FRESULT | f_findnext (DIR *dp, FILINFO *fno) |
FRESULT | f_findfirst (DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern) |
FRESULT | f_stat (const TCHAR *path, FILINFO *fno) |
FRESULT | f_getfree (const TCHAR *path, DWORD *nclst, FATFS **fatfs) |
FRESULT | f_truncate (FIL *fp) |
FRESULT | f_unlink (const TCHAR *path) |
FRESULT | f_mkdir (const TCHAR *path) |
FRESULT | f_rename (const TCHAR *path_old, const TCHAR *path_new) |
FRESULT | f_chmod (const TCHAR *path, BYTE attr, BYTE mask) |
FRESULT | f_utime (const TCHAR *path, const FILINFO *fno) |
FRESULT | f_getlabel (const TCHAR *path, TCHAR *label, DWORD *vsn) |
FRESULT | f_setlabel (const TCHAR *label) |
FRESULT | f_expand (FIL *fp, FSIZE_t fsz, BYTE opt) |
static FRESULT | create_partition (BYTE drv, const LBA_t plst[], UINT sys, BYTE *buf) |
FRESULT | f_mkfs (const TCHAR *path, const MKFS_PARM *opt, void *work, UINT len) |
Variables | |
static FATFS * | FatFs [FF_VOLUMES] |
static WORD | Fsid |
static BYTE | CurrVol |
static const BYTE | LfnOfs [] = {1,3,5,7,9,14,16,18,20,22,24,28,30} |
static const BYTE | ExCvt [] = MKCVTBL(TBL_CT, FF_CODE_PAGE) |
#define BPB_BkBootSec32 50 /* FAT32: Offset of backup boot sector (WORD) */ |
#define BPB_BytsPerSecEx 108 /* exFAT: Log2 of sector size in unit of byte (BYTE) */ |
#define BPB_DataOfsEx 88 /* exFAT: Data offset from top of the volume [sector] (DWORD) */ |
#define BPB_DrvNumEx 111 /* exFAT: Physical drive number for int13h (BYTE) */ |
#define BPB_FatOfsEx 80 /* exFAT: FAT offset from top of the volume [sector] (DWORD) */ |
#define BPB_FSInfo32 48 /* FAT32: Offset of FSINFO sector (WORD) */ |
#define BPB_HiddSec 28 /* Volume offset from top of the drive (DWORD) */ |
#define BPB_NumClusEx 92 /* exFAT: Number of clusters (DWORD) */ |
#define BPB_NumHeads 26 /* Number of heads for int13h (WORD) */ |
#define BPB_RootClus32 44 /* FAT32: Root directory cluster (DWORD) */ |
#define BPB_RootClusEx 96 /* exFAT: Root directory start cluster (DWORD) */ |
#define BPB_RootEntCnt 17 /* Size of root directory area for FAT [entry] (WORD) */ |
#define BPB_RsvdSecCnt 14 /* Size of reserved area [sector] (WORD) */ |
#define BPB_SecPerClusEx 109 /* exFAT: Log2 of cluster size in unit of sector (BYTE) */ |
#define BPB_SecPerTrk 24 /* Number of sectors per track for int13h [sector] (WORD) */ |
#define BPB_TotSec16 19 /* Volume size (16-bit) [sector] (WORD) */ |
#define BPB_TotSec32 32 /* Volume size (32-bit) [sector] (DWORD) */ |
#define BPB_TotSecEx 72 /* exFAT: Volume size [sector] (QWORD) */ |
#define BPB_VolIDEx 100 /* exFAT: Volume serial number (DWORD) */ |
#define BPB_VolOfsEx 64 /* exFAT: Volume offset from top of the drive [sector] (QWORD) */ |
#define BS_BootSig32 66 /* FAT32: Extended boot signature (BYTE) */ |
#define BS_DrvNum 36 /* Physical drive number for int13h (BYTE) */ |
#define BS_DrvNum32 64 /* FAT32: Physical drive number for int13h (BYTE) */ |
#define BS_FilSysType32 82 /* FAT32: Filesystem type string (8-byte) */ |
#define BS_VolID32 67 /* FAT32: Volume serial number (DWORD) */ |
#define BS_VolLab32 71 /* FAT32: Volume label string (8-byte) */ |
#define CODEPAGE FF_CODE_PAGE |
#define DDEM 0xE5 /* Deleted directory entry mark set to DIR_Name[0] */ |
#define DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer */ |
#define DIR_FstClusHI 20 /* Higher 16-bit of first cluster (WORD) */ |
#define DIR_FstClusLO 26 /* Lower 16-bit of first cluster (WORD) */ |
#define FA_SEEKEND 0x20 /* Seek to end of the file on file open */ |
#define FREE_NAMBUF | ( | ) | ff_memfree(lfn) |
#define FSI_LeadSig 0 /* FAT32 FSI: Leading signature (DWORD) */ |
#define FSI_Nxt_Free 492 /* FAT32 FSI: Last allocated cluster (DWORD) */ |
#define FSI_StrucSig 484 /* FAT32 FSI: Structure signature (DWORD) */ |
#define GET_FATTIME | ( | ) | get_fattime() |
#define GPT_ALIGN 0x100000 /* Alignment of partitions in GPT [byte] (>=128KB) */ |
#define GPT_ITEMS 128 /* Number of GPT table size (>=128, sector aligned) */ |
#define GPTE_LstLba 40 /* GPT PTE: Last LBA inclusive (QWORD) */ |
#define GPTE_PtGuid 0 /* GPT PTE: Partition type GUID (16-byte) */ |
#define GPTE_UpGuid 16 /* GPT PTE: Partition unique GUID (16-byte) */ |
#define GPTH_FstLba 40 /* GPT: First LBA for partitions (QWORD) */ |
#define GPTH_LstLba 48 /* GPT: Last LBA for partitions (QWORD) */ |
#define GPTH_PtNum 80 /* GPT: Number of table entries (DWORD) */ |
#define INIT_NAMBUF | ( | fs | ) | { lfn = ff_memalloc((FF_MAX_LFN+1)*2); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; } |
#define LD2PD | ( | vol | ) | (BYTE)(vol) /* Each logical drive is associated with the same physical drive number */ |
#define LD2PT | ( | vol | ) | 0 /* Find first valid partition or in SFD */ |
#define LEAVE_MKFS | ( | res | ) | { if (!work) ff_memfree(buf); return res; } |
#define MAX_EXFAT 0x7FFFFFFD /* Max exFAT clusters (differs from specs, implementation limit) */ |
#define MAX_FAT12 0xFF5 /* Max FAT12 clusters (differs from specs, but right for real DOS/Windows behavior) */ |
#define MAX_FAT16 0xFFF5 /* Max FAT16 clusters (differs from specs, but right for real DOS/Windows behavior) */ |
#define MAX_FAT32 0x0FFFFFF5 /* Max FAT32 clusters (not specified, practical limit) */ |
#define MAXDIRB | ( | nc | ) | ((nc + 44U) / 15 * SZDIRE) /* exFAT: Size of directory entry block scratchpad buffer needed for the name length */ |
#define MBR_Table 446 /* MBR: Offset of partition table in the MBR */ |
#define MKCVTBL | ( | hd, | |
cp | |||
) | MERGE_2STR(hd, cp) |
#define N_SEC_TRACK 63 /* Sectors per track for determination of drive CHS */ |
#define RDDEM 0x05 /* Replacement of the character collides with DDEM */ |
#define TBL_CT437 |
#define TBL_CT720 |
#define TBL_CT737 |
#define TBL_CT771 |
#define TBL_CT775 |
#define TBL_CT850 |
#define TBL_CT852 |
#define TBL_CT855 |
#define TBL_CT857 |
#define TBL_CT860 |
#define TBL_CT861 |
#define TBL_CT862 |
#define TBL_CT863 |
#define TBL_CT864 |
#define TBL_CT865 |
#define TBL_CT866 |
#define TBL_CT869 |
#define TBL_DC932 {0x81, 0x9F, 0xE0, 0xFC, 0x40, 0x7E, 0x80, 0xFC, 0x00, 0x00} |
#define TBL_DC936 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0x80, 0xFE, 0x00, 0x00} |
#define TBL_DC949 {0x81, 0xFE, 0x00, 0x00, 0x41, 0x5A, 0x61, 0x7A, 0x81, 0xFE} |
#define TBL_DC950 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0xA1, 0xFE, 0x00, 0x00} |
#define XDIR_CaseSum 4 /* exFAT: Sum of case conversion table (DWORD) */ |
#define XDIR_FileSize 56 /* exFAT: File/Directory size (QWORD) */ |
#define XDIR_FstClus 52 /* exFAT: First cluster of the file data (DWORD) */ |
#define XDIR_NumLabel 1 /* exFAT: Number of volume label characters (BYTE) */ |
#define XDIR_NumName 35 /* exFAT: Number of file name characters (BYTE) */ |
#define XDIR_SetSum 2 /* exFAT: Sum of the set of directory entries (WORD) */ |
#define XDIR_Type 0 /* exFAT: Type of exFAT directory entry (BYTE) */ |
#define XDIR_ValidFileSize 40 /* exFAT: Valid file size (QWORD) */ |
Definition at line 3299 of file ff.c.
Referenced by find_volume().
|
static |
Definition at line 729 of file ff.c.
Referenced by create_name(), and f_setlabel().
Definition at line 1168 of file ff.c.
Referenced by dir_clear(), dir_next(), dir_sdi(), f_lseek(), f_open(), f_read(), f_rename(), f_write(), mount_volume(), and remove_chain().
Definition at line 1907 of file ff.c.
Referenced by dir_find().
Definition at line 2865 of file ff.c.
Referenced by follow_path().
|
static |
Definition at line 737 of file ff.c.
Referenced by create_name(), f_getlabel(), f_setlabel(), gen_numname(), get_achar(), get_fileinfo(), and tchar2uni().
|
static |
Definition at line 757 of file ff.c.
Referenced by create_name(), f_setlabel(), get_achar(), get_fileinfo(), and tchar2uni().
Definition at line 1828 of file ff.c.
Referenced by dir_register(), and f_setlabel().
Definition at line 1680 of file ff.c.
Referenced by dir_next(), and f_mkdir().
Definition at line 2448 of file ff.c.
Referenced by dir_register(), and follow_path().
Definition at line 1767 of file ff.c.
Referenced by dir_alloc(), dir_find(), dir_read(), dir_register(), dir_remove(), f_getcwd(), and f_readdir().
Definition at line 2529 of file ff.c.
Referenced by f_mkdir(), f_open(), and f_rename().
Definition at line 2635 of file ff.c.
Referenced by f_rename(), and f_unlink().
Definition at line 1719 of file ff.c.
Referenced by dir_alloc(), dir_find(), dir_register(), dir_remove(), f_getcwd(), f_getlabel(), f_opendir(), f_readdir(), f_setlabel(), f_unlink(), and follow_path().
Definition at line 5218 of file ff.c.
Referenced by chmod(), and fatfs_tests().
Definition at line 4193 of file ff.c.
Referenced by close(), dbf_close(), and open().
Definition at line 4637 of file ff.c.
Referenced by closedir(), and fatfs_ls().
Definition at line 4703 of file ff.c.
Referenced by f_findfirst().
Definition at line 4790 of file ff.c.
Referenced by fatfs_ls(), and fatfs_status().
Definition at line 5312 of file ff.c.
Referenced by fatfs_status().
Definition at line 4408 of file ff.c.
Referenced by dbf_lseek(), fatfs_getc(), ftruncate(), lseek(), open(), and truncate().
Definition at line 5838 of file ff.c.
Referenced by fatfs_tests(), and mkfs().
Definition at line 3649 of file ff.c.
Referenced by fatfs_tests(), mkfs(), and mmc_init().
Definition at line 3697 of file ff.c.
Referenced by dbf_open(), open(), and truncate().
Definition at line 4571 of file ff.c.
Referenced by f_findfirst(), fatfs_ls(), fatfs_scan_files(), and opendir().
Definition at line 3889 of file ff.c.
Referenced by dbf_read(), fatfs_getc(), and read().
Definition at line 4667 of file ff.c.
Referenced by f_findnext(), fatfs_ls(), fatfs_scan_files(), and readdir().
Definition at line 4880 of file ff.c.
Referenced by ftruncate(), and truncate().
Definition at line 3990 of file ff.c.
Referenced by dbf_write(), fatfs_putc(), and write().
Definition at line 3322 of file ff.c.
Referenced by mount_volume().
Definition at line 3066 of file ff.c.
Referenced by f_chdir(), f_chmod(), f_mkdir(), f_open(), f_opendir(), f_rename(), f_stat(), f_unlink(), and f_utime().
Definition at line 2018 of file ff.c.
Referenced by dir_register().
Definition at line 2787 of file ff.c.
Referenced by pattern_matching().
Definition at line 1185 of file ff.c.
Referenced by create_chain(), dir_next(), dir_sdi(), f_expand(), f_getfree(), f_lseek(), f_open(), f_read(), f_truncate(), and remove_chain().
Definition at line 2681 of file ff.c.
Referenced by f_getcwd(), f_readdir(), and f_stat().
|
static |
Definition at line 3153 of file ff.c.
Referenced by f_chdrive(), f_mkfs(), f_mount(), f_rename(), and mount_volume().
Definition at line 1870 of file ff.c.
Referenced by f_chdir(), f_getcwd(), f_open(), f_opendir(), f_rename(), f_unlink(), and follow_path().
Definition at line 625 of file ff.c.
Referenced by f_chdir(), f_getfree(), f_getlabel(), f_mkfs(), f_open(), find_volume(), follow_path(), get_fat(), get_fileinfo(), mount_volume(), and put_fat().
Definition at line 616 of file ff.c.
Referenced by check_fs(), cmp_lfn(), dir_find(), f_getfree(), f_getlabel(), f_mkfs(), f_rename(), get_fat(), get_fileinfo(), ld_clust(), mount_volume(), and pick_lfn().
|
static |
Definition at line 715 of file ff.c.
Referenced by check_fs(), dir_find(), f_mkfs(), and find_volume().
|
static |
Definition at line 690 of file ff.c.
Referenced by create_partition(), dir_register(), f_mkdir(), f_mkfs(), f_read(), f_rename(), f_setlabel(), f_write(), and gen_numname().
|
static |
Definition at line 704 of file ff.c.
Referenced by create_name(), create_partition(), dir_clear(), dir_register(), f_mkdir(), f_mkfs(), f_open(), f_setlabel(), and sync_fs().
Definition at line 3376 of file ff.c.
Referenced by f_chdir(), f_chmod(), f_getcwd(), f_getfree(), f_getlabel(), f_mkdir(), f_mount(), f_open(), f_opendir(), f_rename(), f_setlabel(), f_stat(), f_unlink(), and f_utime().
Definition at line 1100 of file ff.c.
Referenced by check_fs(), dir_alloc(), dir_find(), dir_read(), dir_register(), dir_remove(), f_getcwd(), f_getfree(), f_getlabel(), f_open(), f_read(), f_rename(), f_sync(), f_write(), find_volume(), get_fat(), mount_volume(), and put_fat().
Definition at line 2818 of file ff.c.
Referenced by f_findnext().
Definition at line 1943 of file ff.c.
Referenced by dir_read().
Definition at line 1262 of file ff.c.
Referenced by create_chain(), f_expand(), and remove_chain().
Definition at line 1981 of file ff.c.
Referenced by dir_register().
Definition at line 854 of file ff.c.
Referenced by f_getlabel(), and get_fileinfo().
Definition at line 1452 of file ff.c.
Referenced by f_mkdir(), f_open(), f_truncate(), and f_unlink().
Definition at line 654 of file ff.c.
Referenced by create_partition(), f_mkfs(), f_rename(), f_setlabel(), f_sync(), put_fat(), put_lfn(), st_clust(), and sync_fs().
Definition at line 2076 of file ff.c.
Referenced by dir_find(), dir_read(), and dir_register().
Definition at line 1131 of file ff.c.
Referenced by f_chmod(), f_mkdir(), f_rename(), f_setlabel(), f_sync(), f_unlink(), and f_utime().
Definition at line 1078 of file ff.c.
Referenced by dir_clear(), f_write(), move_window(), and sync_fs().
Definition at line 781 of file ff.c.
Referenced by create_name(), f_setlabel(), and get_achar().
Definition at line 3605 of file ff.c.
Referenced by f_close(), f_closedir(), f_expand(), f_lseek(), f_read(), f_readdir(), f_sync(), f_truncate(), and f_write().
|
static |
Definition at line 469 of file ff.c.
Referenced by f_chdir(), f_chdrive(), f_getcwd(), and get_ldnumber().
|
static |
Definition at line 594 of file ff.c.
Referenced by create_name(), f_setlabel(), and get_achar().
|
static |
|
static |
Definition at line 466 of file ff.c.
Referenced by mount_volume().