diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 22:00:05 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 22:00:05 +0100 |
commit | 2a69b085432cd486f7ea73478393e76815f9f45d (patch) | |
tree | 662710db97ce48af64b558fd34d43a9e48659490 /src/kernel/core | |
parent | 6050a11052626d530d0676b633e2b30d7aa3e65e (diff) | |
download | kogata-2a69b085432cd486f7ea73478393e76815f9f45d.tar.gz kogata-2a69b085432cd486f7ea73478393e76815f9f45d.zip |
Nullfs in good shape : can read a ram file.
Diffstat (limited to 'src/kernel/core')
-rw-r--r-- | src/kernel/core/kmain.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index e5012b3..9b1cd12 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -271,9 +271,20 @@ void kernel_init_stage2(void* data) { (void*)mods[i].mod_start, mods[i].mod_end - mods[i].mod_start, false, - FM_READ)); + FM_READ | FM_MMAP)); } + // TEST : read /cmdline + dbg_printf("Trying to read /cmdline... "); + fs_handle_t *f = fs_open(devfs_fs, "/cmdline", FM_READ); + ASSERT(f != 0); + char buf[256]; + size_t l = file_read(f, 0, 255, buf); + ASSERT(l > 0); + buf[l] = 0; + unref_file(f); + dbg_printf("got '%s'.\n", buf); + //TODO : // - (OK) populate devfs with information regarding kernel command line & modules // - create user process with init module provided on command line |