diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-09-29 07:56:50 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-09-29 07:56:50 +0000 |
| commit | 4e991f05b8beb7538cee6939777f36610f8b7bc9 (patch) | |
| tree | ee8a3ddca0a8fcd35a8654c3d21b62bc64e19242 /arch/x86_64/src | |
| parent | 6288868ebd728720236d6a857df2658bff2d6547 (diff) | |
| download | teachos-4e991f05b8beb7538cee6939777f36610f8b7bc9.tar.xz teachos-4e991f05b8beb7538cee6939777f36610f8b7bc9.zip | |
Pass multiboot to main from edi register
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/boot/boot.s | 2 | ||||
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
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 |
