diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 19:24:42 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 19:24:42 +0100 |
commit | 440d9dc470703d20a55365b3a560196e71d450d4 (patch) | |
tree | bcc864c7aeb0af7a81c4fcd7430fa8c3001f8383 /src/kernel/core | |
parent | caf842864bdc0794e387f9580af96ab1036996f4 (diff) | |
download | kogata-440d9dc470703d20a55365b3a560196e71d450d4.tar.gz kogata-440d9dc470703d20a55365b3a560196e71d450d4.zip |
Start work on filesystems.
Diffstat (limited to 'src/kernel/core')
-rw-r--r-- | src/kernel/core/kmain.c | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index 6024b77..2782cc1 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -13,6 +13,9 @@ #include <thread.h> +#include <vfs.h> +#include <nullfs.h> + #include <slab_alloc.h> #include <hashtbl.h> @@ -150,23 +153,8 @@ void test_thread(void* a) { if (i % 8 == 0) yield(); } } -void kernel_init_stage2(void* data) { - dbg_print_region_info(); - dbg_print_frame_stats(); - - test_hashtbl_1(); - test_hashtbl_2(); - - thread_t *tb = new_thread(test_thread, 0); - resume_thread(tb, false); - for (int i = 0; i < 120; i++) { - dbg_printf("a"); - for (int x = 0; x < 100000; x++) asm volatile("xor %%ebx, %%ebx":::"%ebx"); - } - PANIC("Reached kmain end! Falling off the edge."); -} - +void kernel_init_stage2(void* data); void kmain(struct multiboot_info_t *mbd, int32_t mb_magic) { dbglog_setup(); @@ -212,4 +200,33 @@ void kmain(struct multiboot_info_t *mbd, int32_t mb_magic) { PANIC("Should never come here."); } +void kernel_init_stage2(void* data) { + dbg_print_region_info(); + dbg_print_frame_stats(); + + test_hashtbl_1(); + test_hashtbl_2(); + + thread_t *tb = new_thread(test_thread, 0); + resume_thread(tb, false); + + for (int i = 0; i < 120; i++) { + dbg_printf("a"); + for (int x = 0; x < 100000; x++) asm volatile("xor %%ebx, %%ebx":::"%ebx"); + } + + register_nullfs_driver(); + fs_t *devfs = make_fs("nullfs", 0, ""); + ASSERT(devfs != 0); + + //TODO : + // - populate devfs with information regarding kernel command line & modules + // - create user process with init module provided on command line + // - give it rights to devfs + // - launch it + // - just return, this thread is done + + PANIC("Reached kmain end! Falling off the edge."); +} + /* vim: set ts=4 sw=4 tw=0 noet :*/ |