diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-12 20:19:24 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-12 20:19:24 +0100 |
commit | 862b93742237ed959e9b8dc12a536880ea45d0cf (patch) | |
tree | 188360ae20f8524b36fad6941523c4fada5f0d70 /src/kernel/core/kmain.c | |
parent | 109b57ea2a8a3dfd88c37a9c00ad301602108efa (diff) | |
download | kogata-862b93742237ed959e9b8dc12a536880ea45d0cf.tar.gz kogata-862b93742237ed959e9b8dc12a536880ea45d0cf.zip |
Adjust nullfs header
Diffstat (limited to 'src/kernel/core/kmain.c')
-rw-r--r-- | src/kernel/core/kmain.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index c9a9d13..490d463 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -270,13 +270,21 @@ void kernel_init_stage2(void* data) { strcpy(name, "/mod/"); strcpy(name+5, modname); - dbg_printf("Adding module to VFS: '%s'\n", name); - size_t len = mods[i].mod_end - mods[i].mod_start; + + dbg_printf("Adding module to VFS: '%s' (size %d)\n", name, len); + + /* + // This would be the "good" way of doing it : fs_handle_t* mod_f = fs_open(devfs, name, FM_WRITE | FM_CREATE); ASSERT(mod_f != 0); ASSERT(file_write(mod_f, 0, len, (char*)mods[i].mod_start) == len); unref_file(mod_f); + */ + // But since we have a nullfs, we can do it that way to prevent useless data copies : + ASSERT(nullfs_add_ram_file(devfs, name, + (char*)mods[i].mod_start, + len, false, FM_READ, FM_MMAP)); } // TEST : read /cmdline |