aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/fs.h
diff options
context:
space:
mode:
authorMarvin Borner2021-01-08 22:49:54 +0100
committerMarvin Borner2021-01-08 22:49:54 +0100
commit45a9df836accd39cf2dbfbb2453496b0e4d93fa5 (patch)
treef2732f45d4b080644c1ab007be251c5b1eaf060e /kernel/inc/fs.h
parent3ad1fce1671c25c5db85977588fd1ceee436e1ba (diff)
Major IDE/ATA driver rewrite
This adds non-hardcoded multi-disk support. I just need to remove the boot/load.c loader and fix the max bootloader ext2 loading size. After that's done I'll try running it on real hardware.
Diffstat (limited to 'kernel/inc/fs.h')
-rw-r--r--kernel/inc/fs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index 06154e7..75cb49f 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -10,17 +10,22 @@
* Device
*/
+enum dev_type { DEV_BLOCK, DEV_CHAR };
+
struct device {
u32 id;
const char *name;
- int type; // TODO: Block, char device
+ enum dev_type type;
struct vfs *vfs;
+ void *data;
u32 (*read)(void *buf, u32 offset, u32 count, struct device *dev);
u32 (*write)(void *buf, u32 offset, u32 count, struct device *dev);
};
void device_install(void);
+void device_add(struct device *dev);
+
/**
* VFS
*/
@@ -42,6 +47,9 @@ struct mount_info {
void vfs_install(void);
+u32 vfs_path_mounted(const char *path);
+u32 vfs_mount(struct device *dev, const char *path);
+
u32 vfs_read(const char *path, void *buf, u32 offset, u32 count);
u32 vfs_write(const char *path, void *buf, u32 offset, u32 count);
u32 vfs_stat(const char *path, struct stat *buf);