diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-13 19:14:58 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-13 19:14:58 -0500 |
commit | e9898e829b8df7c0b16faec1ce490369c53fd78e (patch) | |
tree | 0959298e7af3e5b9e40ac4d6dec0cec089105eac /kernel/entry.cpp | |
parent | 4130562b1555cabe441efe9420cebe12e7ed8d39 (diff) | |
download | hilbert-os-e9898e829b8df7c0b16faec1ce490369c53fd78e.tar.gz |
minimal cpu exception handling
Diffstat (limited to 'kernel/entry.cpp')
-rw-r--r-- | kernel/entry.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/kernel/entry.cpp b/kernel/entry.cpp index f7ba71d..cce8066 100644 --- a/kernel/entry.cpp +++ b/kernel/entry.cpp @@ -184,15 +184,6 @@ extern "C" [[noreturn]] void entry() { } -static void print_mem() { - uint64_t used_vram_mib = (paging::get_used_vram_page_count() + 128) / 256; - uint64_t free_pram_mib = (paging::get_free_pram_page_count() + 128) / 256; - terminal::put_int_decimal(used_vram_mib); - terminal::put_string_sz(" MiB kernel memory mapped.\n"); - terminal::put_int_decimal(free_pram_mib); - terminal::put_string_sz(" MiB physical memory free.\n"); -} - [[noreturn]] static void print_and_halt(const char *msg) { terminal::put_string_sz(msg); while (1) @@ -230,25 +221,11 @@ extern "C" [[noreturn]] void start_user_mode( if (!init_file) print_and_halt("/bin/init.elf does not exist."); - terminal::put_string_sz("/bin/init.elf is "); - terminal::put_int_decimal(init_file->dir_entry.length); - terminal::put_string_sz(" bytes long.\n"); - application::app_instance *init; if (application::create_app(*init_file, init) != application::create_app_result::success) print_and_halt("failed to parse /bin/init.elf."); - terminal::put_string_sz("/bin/init.elf loaded:\n instruction pointer 0x"); - terminal::put_int_hex(init->saved_regs.rip, 8); - terminal::put_string_sz("\n stack pointer 0x"); - terminal::put_int_hex(init->saved_regs.rsp, 8); - terminal::put_string_sz("\n "); - terminal::put_int_decimal(init->count_mapped_vram_pages() * 2); - terminal::put_string_sz(" MiB userspace memory used\n"); - - print_mem(); - terminal::put_string_sz("switching to /bin/init.elf.\n"); application::running_app = init; start_user_mode(init->saved_regs.rip, init->saved_regs.rsp, init->p4_paddr); |