summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-07-17 19:06:45 +0200
committerdzwdz2021-07-17 19:06:45 +0200
commit5a7363a0ad3e9657c34b7a79cd2aa425ef6f1fab (patch)
tree89428db76495e4c92341b20a95fc16bb21da6db3
parentf84c55f194df088c291fc4359ccec1305be456ce (diff)
debug code, verifies if the memory gets set up correctly
i guess that i can include this for completeness. if not for the awful pointer printing thingy this could probably get into the main version. TODO?
-rw-r--r--src/arch/i386/boot.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/i386/boot.c b/src/arch/i386/boot.c
index 242d070..fa35c01 100644
--- a/src/arch/i386/boot.c
+++ b/src/arch/i386/boot.c
@@ -7,6 +7,25 @@
#include <kernel/main.h>
#include <kernel/panic.h>
+void module_test(struct multiboot_info *multiboot) {
+ log_const("module test...");
+ struct multiboot_mod mod = multiboot->mods[0];
+ log_write(mod.start, mod.end - mod.start - 1);
+
+ extern void _bss_end;
+ long ptr = &_bss_end;
+ log_const("_bss_end ");
+ log_var_dont_use(ptr);
+ extern void _data_end;
+ ptr = &_data_end;
+ log_const(" _data_end ");
+ log_var_dont_use(ptr);
+ log_const(" mod.start ");
+ log_var_dont_use(mod.start);
+ log_const(" mod.end ");
+ log_var_dont_use(mod.end);
+}
+
void kmain_early(struct multiboot_info *multiboot) {
struct kmain_info info;
@@ -18,6 +37,7 @@ void kmain_early(struct multiboot_info *multiboot) {
idt_init();
log_const("sysenter...");
sysenter_setup();
+ module_test(multiboot);
{ // find the init module
struct multiboot_mod *module = &multiboot->mods[0];