aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 75867a8..cba4f6e 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -6,6 +6,8 @@
#include <kernel/paging/paging.h>
#include <kernel/input/input.h>
#include <kernel/acpi/acpi.h>
+#include <kernel/mutliboot.h>
+#include <kernel/fs/initrd.h>
void init() {
vga_log("Installing basic features of Melvix...", 0);
@@ -25,9 +27,19 @@ void init() {
asm volatile ("sti");
}
-void kernel_main(void) {
+void kernel_main(struct multiboot *mboot_ptr) {
init();
+ info("Kernel size in KiB: ");
+ vesa_draw_number((int) end >> 10);
+
+ assert(mboot_ptr->mods_count > 0);
+ uint32_t initrd_location = *((uint32_t *) mboot_ptr->mods_addr);
+ uint32_t initrd_end = *(uint32_t *) (mboot_ptr->mods_addr + 4);
+ // Don't trample our module with placement accesses, please!
+ // placement_address = initrd_end;
+ fs_root = initialise_initrd(initrd_location);
+
// asm volatile ("div %0" :: "r"(0)); // Exception testing x/0
loop:
asm volatile ("hlt");