From a8a80d326de9550b2a25b1255a2093ab43219ede Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 27 Jan 2024 23:14:29 -0500 Subject: keyboard input --- kernel/entry.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'kernel/entry.cpp') diff --git a/kernel/entry.cpp b/kernel/entry.cpp index 3a42df7..cc74e69 100644 --- a/kernel/entry.cpp +++ b/kernel/entry.cpp @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include #include "../limine/limine.h" @@ -184,12 +186,6 @@ extern "C" [[noreturn]] void entry() { } -[[noreturn]] static void print_and_halt(const char *msg) { - terminal::put_string_sz(msg); - while (1) - asm ("hlt"); -} - extern "C" [[noreturn]] void start_user_mode( uint64_t rip, uint64_t rsp, uint64_t p4_paddr); @@ -208,22 +204,25 @@ extern "C" [[noreturn]] void start_user_mode( if (initfs_fs->get_root_node(initfs_root.dir_entry.node) != storage::fs_result::success) - print_and_halt("failed to get root node of initfs."); + panic("failed to get root node of initfs."); vfile::set_root(initfs_root); + input::init_input(); + utility::string init_path_string("/bin/init.elf", 13); vfile::canon_path init_path; vfile::canonize_path(init_path_string, init_path); vfile::vfile init_file; - if (vfile::lookup_path(init_path, init_file) != storage::fs_result::success) - print_and_halt("failed to look up /bin/init.elf."); + if (vfile::lookup_path(init_path, init_file, true) != + storage::fs_result::success) + panic("failed to look up /bin/init.elf."); application::app_instance *init; if (application::create_app(init_file, init, initfs_root) != application::create_app_result::success) - print_and_halt("failed to parse /bin/init.elf."); + panic("failed to parse /bin/init.elf."); application::running_app = init; start_user_mode(init->saved_regs.rip, init->saved_regs.rsp, init->p4_paddr); -- cgit v1.2.3