-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfatfs.h
52 lines (40 loc) · 1.57 KB
/
fatfs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* fatfs.h
*
* Definition of the structure used to represent a FAT filesystem.
*/
#ifndef FATFS_H
#define FATFS_H
#include <stdlib.h>
#include <stdint.h>
typedef enum {
FAT12 = 12,
FAT16 = 16,
FAT32 = 32
} FS_TYPE;
typedef struct {
// int file_descriptor; /* File descriptor returned by open(). */
FS_TYPE fs_type;
void *diskStart; /* This is where in memory the disk starts*/
uint16_t sector_size; /* Size of one sector on the disk. */
uint8_t cluster_size; /* Number of sectors per cluster. */
uint16_t rootdir_size; /* Number of entries in root directory. */
unsigned int sectors_per_fat; /* Number of sectors per fat. */
uint16_t hidden_sectors; /* Number of hidden sectors. */
uint16_t reserved_sectors; /* Number of reserved sectors. */
unsigned int sectors_for_root; /* Number of sectors for root directory. */
unsigned int fat_offset; /* First sector of the first FAT copy. */
unsigned int rootdir_offset; /* First sector of the root directory. */
unsigned int cluster_offset; /* Sector number of the first cluster. */
// If you need additional structure fields add them here
} filesystem_info;
/*
* Function to open the file system.
*/
void* open_filesystem(int argc, char *argv[]);
/*
* This function sets up information about a FAT filesystem that will be used to read from
* that file system.
*/
filesystem_info *initialize_filesystem_info(void *fg);
#endif