Implemented creating, removing and writing to files

This commit is contained in:
2021-06-14 23:09:30 +02:00
parent f4413a2d06
commit ca7f1b3684
2 changed files with 293 additions and 13 deletions

View File

@@ -5,15 +5,12 @@
#include "fatfs.h"
#include <sys/types.h>
typedef struct {
// Block and size are in blocks of 128
uint8_t user;
char name[8];
char ext[3];
uint32_t size;
uint16_t allocation[8];
char* filename;
} DiskEntry;
struct DirtyBlock {
uint32_t block;
struct DirtyBlock* next;
uint8_t size;
uint8_t* data;
};
typedef struct {
FATFS *fs;
@@ -25,6 +22,7 @@ typedef struct {
uint8_t* buffer;
uint8_t* directory;
unsigned int size;
struct DirtyBlock* dirty_block;
} Storage;
typedef struct {