diff options
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/vfs/makefile | 2 | ||||
-rw-r--r-- | src/sys/vfs/vfs_init.C | 39 | ||||
-rw-r--r-- | src/sys/vfs/vfs_main.C | 23 |
3 files changed, 43 insertions, 21 deletions
diff --git a/src/sys/vfs/makefile b/src/sys/vfs/makefile index 767b09204..3567870da 100644 --- a/src/sys/vfs/makefile +++ b/src/sys/vfs/makefile @@ -1,5 +1,5 @@ ROOTPATH = ../../.. -OBJS = vfs_main.o +OBJS = vfs_main.o vfs_init.o include ${ROOTPATH}/config.mk diff --git a/src/sys/vfs/vfs_init.C b/src/sys/vfs/vfs_init.C new file mode 100644 index 000000000..24c55fda9 --- /dev/null +++ b/src/sys/vfs/vfs_init.C @@ -0,0 +1,39 @@ +#include <sys/vfs.h> +#include <kernel/console.H> + +VfsSystemModule VFS_MODULES[VFS_MODULE_MAX]; +uint64_t VFS_LAST_ADDRESS; + +void vfs_module_init() +{ + printk("Initializing modules.\n"); + + VfsSystemModule* module = &VFS_MODULES[0]; + while ('\0' != module->module[0]) + { + printk("\tIniting module %s...", module->module); + if (NULL != module->init) + (module->init)(NULL); + printk("done.\n"); + + module++; + } + + printk("Modules initialized."); +} + +void (*vfs_module_find_start(const char* modName))(void*) +{ + VfsSystemModule* module = &VFS_MODULES[0]; + while ('\0' != module->module[0]) + { + if (0 == strcmp(modName, module->module)) + { + return module->start; + } + + module++; + } + + return NULL; +} diff --git a/src/sys/vfs/vfs_main.C b/src/sys/vfs/vfs_main.C index 3efb99002..417a8ae14 100644 --- a/src/sys/vfs/vfs_main.C +++ b/src/sys/vfs/vfs_main.C @@ -11,8 +11,8 @@ const char* VFS_ROOT = "/"; const char* VFS_ROOT_BIN = "/bin/"; const char* VFS_ROOT_DATA = "/data/"; const char* VFS_ROOT_MSG = "/msg/"; -VfsSystemModule VFS_MODULES[VFS_MODULE_MAX]; -uint64_t VFS_LAST_ADDRESS; + +void vfs_module_init(); struct VfsPath { @@ -31,23 +31,6 @@ struct VfsEntry VfsEntry* prev; }; -void vfs_module_init() -{ - printk("Initializing modules.\n"); - - VfsSystemModule* module = &VFS_MODULES[0]; - while ('\0' != module->module[0]) - { - printk("\tIniting module %s...", module->module); - (module->init)(NULL); - printk("done.\n"); - - module++; - } - - printk("Modules initialized."); -} - void vfs_main(void* unused) { // Create message queue, register with kernel. @@ -75,7 +58,7 @@ void vfs_main(void* unused) e->msg_q = (msg_q_t) msg->data[0]; vfsContents.insert(e); - printk("VFS: Registering %lx as %s\n", + printk("VFS: Registering %p as %s\n", e->msg_q, e->key.key); msg_respond(vfsMsgQ, msg); } |