fs: move fs init into kernel cmdline

Previously, any partition with an ext2 filesystem would be mounted by
the gpt header parser. With this patch, the kernel cmdline `root=val` is
responsible for mounting the root filesystem.
This commit is contained in:
Michael Shaw 2023-10-19 11:08:54 -04:00
commit 25a828437a
10 changed files with 150 additions and 32 deletions

View file

@ -40,14 +40,15 @@ struct file {
uint64_t size; /* size of the file */
uint64_t pos; /* current position in the file */
void *fs_data;
void *fs_file;
};
struct fs_ops {
int (*read)(void *fs, struct file *file, void *buf, size_t offset, size_t size);
int (*write)(void *fs, struct file *file, void *buf, size_t offset, size_t size);
int (*read)(void *fs, struct file *file, void *buf, size_t size);
int (*write)(void *fs, struct file *file, void *buf, size_t size);
int (*open)(void *fs, struct file *file, const char *path);
int (*close)(void *fs, struct file *file);
int (*seek)(void *fs, struct file *file, size_t offset);
};
struct fs {
@ -56,4 +57,6 @@ struct fs {
struct fs_ops ops;
};
void vfs_init(const char *rootfs);
#endif /* _VFS_H_ */