diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 21:36:50 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 21:36:50 +0100 |
commit | 6050a11052626d530d0676b633e2b30d7aa3e65e (patch) | |
tree | 80fa3562dd3461eb7914b62d33ef5b41a1cd759b /src/kernel/core | |
parent | 8bfbc4b05b219950e3eb8ac377b8cb3020ddb9ab (diff) | |
download | kogata-6050a11052626d530d0676b633e2b30d7aa3e65e.tar.gz kogata-6050a11052626d530d0676b633e2b30d7aa3e65e.zip |
Remove file that shouldn't be here.
Diffstat (limited to 'src/kernel/core')
-rw-r--r-- | src/kernel/core/kmain.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index 4ced0da..e5012b3 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -173,14 +173,19 @@ void kmain(multiboot_info_t *mbd, int32_t mb_magic) { // Also check that kernel_data_end is after all modules, otherwise // we might overwrite something. mbd->cmdline += K_HIGHHALF_ADDR; + size_t cmdline_end = mbd->cmdline + strlen((char*)mbd->cmdline); + void* cmdline_end_pa = (void*)((cmdline_end & 0xFFFFF000) + 0x1000); + if (cmdline_end_pa > kernel_data_end) kernel_data_end = cmdline_end_pa; + mbd->mods_addr += K_HIGHHALF_ADDR; multiboot_module_t *mods = (multiboot_module_t*)mbd->mods_addr; for (unsigned i = 0; i < mbd->mods_count; i++) { mods[i].mod_start += K_HIGHHALF_ADDR; mods[i].mod_end += K_HIGHHALF_ADDR; mods[i].string += K_HIGHHALF_ADDR; - if ((void*)mods[i].mod_end > kernel_data_end) - kernel_data_end = (void*)((mods[i].mod_end & 0xFFFFF000) + 0x1000); + void* mod_end_pa = (void*)((mods[i].mod_end & 0xFFFFF000) + 0x1000); + if (mod_end_pa > kernel_data_end) + kernel_data_end = mod_end_pa; } gdt_init(); dbg_printf("GDT set up.\n"); @@ -240,6 +245,12 @@ void kernel_init_stage2(void* data) { nullfs_t *devfs = as_nullfs(devfs_fs); ASSERT(devfs != 0); + // Add kernel command line to devfs + dbg_printf("Kernel command line: '%s'\n", (char*)mbd->cmdline); + ASSERT(nullfs_add_ram_file(devfs, "/cmdline", + (void*)mbd->cmdline, strlen((char*)mbd->cmdline), + false, FM_READ)); + // Populate devfs with files for kernel modules multiboot_module_t *mods = (multiboot_module_t*)mbd->mods_addr; for (unsigned i = 0; i < mbd->mods_count; i++) { @@ -254,7 +265,7 @@ void kernel_init_stage2(void* data) { strcpy(name, "/mod/"); strcpy(name+5, modname); - dbg_printf("Adding model to VFS: %s\n", name); + dbg_printf("Adding module to VFS: '%s'\n", name); ASSERT(nullfs_add_ram_file(devfs, name, (void*)mods[i].mod_start, |