aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/kmain.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-09 15:43:44 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-09 15:43:44 +0100
commit436418e575b68fd7e85f7fdaf039e03874ec1cb9 (patch)
treea18413eaa89ce9a9fffb40617b5dddfef9bc5d97 /src/kernel/core/kmain.c
parenta9a2ea9125f89347e0aa038a136ebd43e6b251b4 (diff)
downloadkogata-436418e575b68fd7e85f7fdaf039e03874ec1cb9.tar.gz
kogata-436418e575b68fd7e85f7fdaf039e03874ec1cb9.zip
Nullfs now uses pager.
Diffstat (limited to 'src/kernel/core/kmain.c')
-rw-r--r--src/kernel/core/kmain.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c
index 7cdd109..9c81ca3 100644
--- a/src/kernel/core/kmain.c
+++ b/src/kernel/core/kmain.c
@@ -216,7 +216,7 @@ fs_t *setup_iofs(multiboot_info_t *mbd) {
{
dbg_printf("Kernel command line: '%s'\n", (char*)mbd->cmdline);
size_t len = strlen((char*)mbd->cmdline);
- ASSERT(nullfs_add_ram_file(iofs, "/cmdline", (char*)mbd->cmdline, len, false, FM_READ));
+ ASSERT(nullfs_add_ram_file(iofs, "/cmdline", (char*)mbd->cmdline, len, FM_READ | FM_MMAP));
}
// Populate iofs with files for kernel modules
@@ -240,7 +240,7 @@ fs_t *setup_iofs(multiboot_info_t *mbd) {
ASSERT(nullfs_add_ram_file(iofs, name,
(char*)mods[i].mod_start,
- len, false, FM_READ));
+ len, FM_READ | FM_MMAP));
}
return iofs;
@@ -292,7 +292,8 @@ void launch_init(btree_t *cmdline, fs_t *iofs, fs_t *rootfs) {
if (init_fs == 0) PANIC("Invalid file system specification for init file.");
// Launch INIT
- fs_handle_t *init_bin = fs_open(init_fs, init_file, FM_READ);
+ fs_handle_t *init_bin = fs_open(init_fs, init_file, FM_READ | FM_MMAP);
+ if (init_bin == 0) init_bin = fs_open(init_fs, init_file, FM_READ);
if (init_bin == 0) PANIC("Could not open init file.");
if (!is_elf(init_bin)) PANIC("init.bin is not valid ELF32 binary");
@@ -309,6 +310,8 @@ void launch_init(btree_t *cmdline, fs_t *iofs, fs_t *rootfs) {
unref_file(init_bin);
+ dbg_dump_proc_memmap(init_p);
+
ASSERT(start_process(init_p, e));
}