diff options
author | Marvin Borner | 2021-01-07 18:48:40 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-07 18:48:40 +0100 |
commit | 8fb2349d12e21868c77f2c975dbd958eb2536499 (patch) | |
tree | 59c6c5e60d701e3b317717a9352c3b0c47c8d0db /kernel | |
parent | 016a9b0ed1d1246cb490d475bf35c2f502c70b2c (diff) |
Several things
Sorry :D
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/features/fs.c | 14 | ||||
-rw-r--r-- | kernel/inc/fs.h | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c index e168022..670a195 100644 --- a/kernel/features/fs.c +++ b/kernel/features/fs.c @@ -20,8 +20,7 @@ struct device *vfs_mounted(const char *path) struct node *iterator = mount_points->head; while (iterator) { struct mount_info *m = iterator->data; - printf("Looping %s\n", m->path); - if (!strcmp(m->path, path)) + if (!strncmp(m->path, path, strlen(m->path))) return m->dev; iterator = iterator->next; } @@ -41,6 +40,16 @@ u32 vfs_mount(struct device *dev, const char *path) return 1; } +void vfs_list_mounts() +{ + struct node *iterator = mount_points->head; + while (iterator) { + struct mount_info *m = iterator->data; + printf("%s on %s type: %s\n", m->dev->name, m->path, m->dev->vfs->name); + iterator = iterator->next; + } +} + void vfs_install(void) { mount_points = list_new(); @@ -80,6 +89,7 @@ void device_install(void) dev->vfs = vfs; device_add(dev); vfs_mount(dev, "/dev/"); + vfs_list_mounts(); } /** diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h index 8fd0707..e2a3aad 100644 --- a/kernel/inc/fs.h +++ b/kernel/inc/fs.h @@ -27,7 +27,7 @@ void device_install(void); struct vfs { const char *name; //u8 (*read)(char *, char *, struct device *, void *); - u8 (*mount)(struct device *, void *); + //u8 (*mount)(struct device *, void *); }; struct mount_info { |