Made some basic functions for file system driver. These functions are fundamental functions for file operations.
struct file_system_driver {
virtual bool check(blockdev::block_device *device);
virtual bool create(file_info *new_file , file_info *directory);
// fill out the structure
virtual bool open(file_info *file , int option);
virtual bool close(file_info *file);
virtual bool remove(file_info *file);
virtual bool rename(file_info *new_file);
virtual bool move(file_info *new_file , file_info *new_directory);
virtual int read(file_info *file , size_t size , void *buffer);
virtual int write(file_info *file , size_t size , const void *buffer);
virtual int lseek(file_info *file , max_t cursor , int option);
virtual int read_directory(file_info *file , max_t cursor);
char fs_string[32];
};
I will add things if necessary. This is not the final version of the driver!
Also changed directory path. Not a drastic change but very handy modification. (Check the github.. )
Actually I'm quite having a hard time figuring out about this file system stuff. I'm wondering and wondering how should I implement the system. Not gonna lie, this is very vary more arduous than I initially expected. This feels like.. creating something from Literally Nothing. I'm concerned and anxious.
Please wish me luck.