From 4e991f05b8beb7538cee6939777f36610f8b7bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 29 Sep 2024 07:56:50 +0000 Subject: Pass multiboot to main from edi register --- arch/x86_64/src/boot/boot.s | 2 ++ arch/x86_64/src/kernel/main.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s index 7b4e193..d41981a 100644 --- a/arch/x86_64/src/boot/boot.s +++ b/arch/x86_64/src/boot/boot.s @@ -366,5 +366,7 @@ _transition_to_long_mode: call _init + mov multiboot_information_pointer, %ebx + mov %ebx, %edi call kernel_main hlt diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 01c14a5..cb5092c 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -2,8 +2,6 @@ #include "arch/video/vga/text.hpp" -#include "stdio.h" - namespace teachos::arch::kernel { auto main(size_t multiboot_information_address) -> void @@ -13,8 +11,9 @@ namespace teachos::arch::kernel text::clear(); text::cursor(false); text::write("TeachOS is starting up...", text::common_attributes::green_on_black); - char address[32U] = {}; - snprintf(address, sizeof(address), "Multiboot address: (%lu)", multiboot_information_address); - text::write(address, text::common_attributes::green_on_black); + if (multiboot_information_address > 5) + { + return; + } } } // namespace teachos::arch::kernel -- cgit v1.2.3