diff options
author | Marvin Borner | 2020-04-28 18:32:36 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-28 18:32:36 +0200 |
commit | 4b8518b4e791c68154ec52badcc921b62afafb49 (patch) | |
tree | 9c855266cf7451f503bf3cb849e63ac72ae48e74 /src/kernel/kernel.c | |
parent | 46007d2598b7aef13895b21669cfb6f24272e5fe (diff) |
Maaaany fixes...
Sorry for the increasingly worse-getting commit messages :D
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r-- | src/kernel/kernel.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 662bb57..3461913 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -19,8 +19,12 @@ #include <kernel/cmos/rtc.h> #include <kernel/memory/alloc.h> -void kernel_main(uint32_t magic, uint32_t multiboot_address) +uint32_t stack_hold; + +void kernel_main(uint32_t magic, uint32_t multiboot_address, uint32_t esp) { + stack_hold = esp; + if (magic != MULTIBOOT_BOOTLOADER_MAGIC) { vga_log("Invalid boot magic!"); halt_loop(); @@ -58,19 +62,21 @@ void kernel_main(uint32_t magic, uint32_t multiboot_address) ata_init(); ext2_init_fs(); - log("%s", read_file("/etc/test")); load_binaries(); set_optimal_resolution(); + printf("%s", read_file("/etc/test")); syscalls_install(); struct process *proc = elf_load("/bin/user"); - proc->stdin = NULL; - proc->stdout = NULL; - proc->stderr = NULL; - process_init(proc); + if (proc) { + proc->stdin = NULL; + proc->stdout = NULL; + proc->stderr = NULL; + process_init(proc); + } + log("Okidoko!"); halt_loop(); - // asm ("div %0" :: "r"(0)); // Exception testing x/0 }
\ No newline at end of file |