diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-11-24 16:59:24 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-11-24 16:59:24 +0100 |
| commit | 1a3c20cc9ea191a862eb7e8ac55b3a69ac74ad5e (patch) | |
| tree | e740d842eb64f9dcde4a70ff138092d349e717c1 /arch/x86_64/src/boot | |
| parent | 2b3dca0d0329b61881ffbecca0f120cfda3314fa (diff) | |
| download | teachos-1a3c20cc9ea191a862eb7e8ac55b3a69ac74ad5e.tar.xz teachos-1a3c20cc9ea191a862eb7e8ac55b3a69ac74ad5e.zip | |
x86_64/vga: rely less on magic state
Diffstat (limited to 'arch/x86_64/src/boot')
| -rw-r--r-- | arch/x86_64/src/boot/entry64.s | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86_64/src/boot/entry64.s b/arch/x86_64/src/boot/entry64.s index c5df5db..636e4cd 100644 --- a/arch/x86_64/src/boot/entry64.s +++ b/arch/x86_64/src/boot/entry64.s @@ -1,3 +1,16 @@ +.section .bss, "aw", @nobits + +//! A structure containing information gathered during the bootstrap process. +//! Expected layout (as described by teachos::boot::information): +//! +//! struct +//! { +//! multiboot2::information_view const * mbi; +//! std::size_t vga_buffer_index; +//! } +.global bootstrap_information +bootstrap_information: .skip 16 + .section .boot_text, "ax", @progbits .code64 @@ -10,6 +23,12 @@ _entry64: mov %rax, %fs mov %rax, %gs + mov multiboot_information_pointer, %rax + mov vga_buffer_pointer, %rdx + sub $0xb8000, %rdx + mov %rax, (bootstrap_information) + mov %rdx, (bootstrap_information + 8) + call invoke_global_constructors xor %rax, %rax |
