ext2/vfs: implement read fs call

also implement the cat command!
This commit is contained in:
Michael Shaw 2023-10-21 00:45:38 -04:00
commit ad2de927e2
8 changed files with 128 additions and 9 deletions

View file

@ -3,9 +3,12 @@
#ifndef __ASM__
#include <stdbool.h>
void console_init();
void console_resize();
void console_input(char c);
void console_clear();
bool console_ready();
void console_write(char c);

View file

@ -7,6 +7,7 @@
#define EINVAL 3
#define EBADF 4
#define ENOTDIR 5
#define EISDIR 6
const char *strerror(int errnum);

View file

@ -84,8 +84,8 @@ struct file_descriptor {
};
struct fs_ops {
int (*read)(struct fs *fs, struct file *file, void *buf, size_t size);
int (*write)(struct fs *fs, struct file *file, void *buf, size_t size);
int (*read)(struct fs *fs, struct file *file, void *buf, size_t offset, size_t size);
int (*write)(struct fs *fs, struct file *file, void *buf, size_t offset, size_t size);
int (*open)(struct fs *fs, struct file *file, const char *path);
int (*close)(struct fs *fs, struct file *file);
int (*seek)(struct fs *fs, struct file *file, size_t offset);