Skip to content

Commit 1db5684

Browse files
Added proper fat error codes still under dev.
1 parent 8640bf2 commit 1db5684

File tree

7 files changed

+292
-94
lines changed

7 files changed

+292
-94
lines changed

disk.img

0 Bytes
Binary file not shown.

source/includes/commands/commands.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ int cmd_lspci(int argc, char** argv);
3535
int cmd_clear(int argc, char** argv);
3636
int cmd_lsblk(int argc, char** argv);
3737
int cmd_mount(int argc, char** argv);
38+
int cmd_mv(int argc, char** argv);
3839

3940
#endif

source/includes/filesystems/fat16.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,26 @@ typedef struct {
7777
uint16_t cluster;
7878
} fat16_file_t;
7979

80+
typedef enum {
81+
FAT_OK = 0,
82+
83+
// generic
84+
FAT_ERR_IO,
85+
FAT_ERR_INVALID,
86+
FAT_ERR_NOT_FOUND,
87+
FAT_ERR_EXISTS,
88+
FAT_ERR_NOT_DIR,
89+
FAT_ERR_IS_DIR,
90+
FAT_ERR_NO_SPACE,
91+
FAT_ERR_NAME_INVALID,
92+
FAT_ERR_NOT_EMPTY,
93+
94+
// filesystem corruption (meltdown-worthy)
95+
FAT_ERR_CORRUPT,
96+
FAT_ERR_FAT_LOOP,
97+
FAT_ERR_BAD_CLUSTER,
98+
} fat_err_t;
99+
80100
int detect_fat_type(int8* buf);
81101
int fat16_mount(int portno, uint32_t partition_lba, fat16_fs_t* fs) ;
82102
uint16_t fat16_read_fat_fs(fat16_fs_t* fs, uint16_t cluster);

0 commit comments

Comments
 (0)