From 336cfa313d0ebd435690610e8006b90dc8bd0e56 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Thu, 26 Dec 2019 13:06:21 -0500 Subject: got multiboot info parsed! --- src/kernel/stub.asm | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'src/kernel/stub.asm') diff --git a/src/kernel/stub.asm b/src/kernel/stub.asm index 84e4523..bad26aa 100644 --- a/src/kernel/stub.asm +++ b/src/kernel/stub.asm @@ -15,7 +15,9 @@ ;ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE ;OF THIS SOFTWARE. -extern main +global _start +extern wrapped_main +extern tag_pointer section .mb_header dd 0xe852_50d6;magic @@ -34,37 +36,12 @@ mb_end: section .text bits 32 -global _start _start: - mov dword [info_pointer], ebx + add ebx, 8 + mov dword [tag_pointer], ebx mov esp, stack - call main - mov edx, eax - - mov eax, 0x4720_4720 - mov ebx, 0x000b_8000 - mov ecx, 0x000b_8fa0 -clear_screen_loop: - mov dword [ebx], eax - add ebx, 4 - test ebx, ecx - jne clear_screen_loop - - mov dword [0x000b_8000], 0x4772_4745 - mov dword [0x000b_8004], 0x476f_4772 - mov dword [0x000b_8008], 0x4720_4772 - mov ebx, 0x000b_8020 - mov ecx, 0x000b_800a -error_number_loop: - mov al, dl - and al, 0x07 - or al, 0x30 - mov byte [ebx], al - sub ebx, 2 - shr edx, 3 - test ebx, ecx - jne error_number_loop + call wrapped_main cli halt: @@ -72,7 +49,6 @@ halt: jmp halt section .bss -global info_pointer info_pointer resd 1 resb 0x1000 - $ + $$ stack: \ No newline at end of file -- cgit v1.2.3