From ce13b28b90e8f7d8083658e083831c6528847099 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 1 Apr 2020 22:58:54 +0200 Subject: Static address linking approach for userspace Kinda works but loading an statically linked binary into memory via kmalloc seems to create a crash which results in a bootloop. --- src/kernel/fs/vfs.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/kernel/fs/vfs.c (limited to 'src/kernel/fs/vfs.c') diff --git a/src/kernel/fs/vfs.c b/src/kernel/fs/vfs.c deleted file mode 100644 index f97a69b..0000000 --- a/src/kernel/fs/vfs.c +++ /dev/null @@ -1,47 +0,0 @@ -#include - -fs_node_t *fs_root = 0; - -uint32_t read_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) -{ - if (node->read != 0) - return node->read(node, offset, size, buffer); - else - return 0; -} - -uint32_t write_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) -{ - if (node->write != 0) - return node->write(node, offset, size, buffer); - else - return 0; -} - -void open_fs(fs_node_t *node, uint8_t read, uint8_t write) -{ - if (node->open != 0) - return node->open(node); -} - -void close_fs(fs_node_t *node) -{ - if (node->close != 0) - return node->close(node); -} - -struct dirent *readdir_fs(fs_node_t *node, uint32_t index) -{ - if ((node->flags & 0x7) == FS_DIRECTORY && node->readdir != 0) - return node->readdir(node, index); - else - return 0; -} - -fs_node_t *finddir_fs(fs_node_t *node, char *name) -{ - if ((node->flags & 0x7) == FS_DIRECTORY && node->finddir != 0) - return node->finddir(node, name); - else - return 0; -} \ No newline at end of file -- cgit v1.2.3