From a0ba839215c2af7805e8419ba7680fc25fe7846c Mon Sep 17 00:00:00 2001 From: Jarkko Toivanen Date: Sat, 13 Jan 2024 02:36:35 +0200 Subject: [PATCH 1/2] Get sweet R/G/B positions as numbers for debugging --- src/start32.asm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/start32.asm b/src/start32.asm index 5042d9c..5feda10 100644 --- a/src/start32.asm +++ b/src/start32.asm @@ -97,6 +97,52 @@ start: call serialwrite add esp, 4 + +push stuff.rpostxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_rpos] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + +push stuff.gpostxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_gpos] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + +push stuff.bpostxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_bpos] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + add esp, 36 ;Clean reserved uitoa return string from stack ; Draw a test pixel to bottom right corner @@ -132,6 +178,7 @@ rOSkalogodraw: cmp byte bl, [roskalogo.h] jne .loop .done: +jmp hang xor eax, eax @@ -189,6 +236,11 @@ stuff: .fbdimensionsmsgpfx db 10, "Framebuffer dimensions: ", 0 .x db "x", 0 + + .rpostxt db 10, "rPos: ", 0 + .gpostxt db 10, "gPos: ", 0 + .bpostxt db 10, "bPos: ", 0 + align 4096 bss_start: ;align 4096 From 3dd934bd83ce770a56cf26505d730e6ae47efcc5 Mon Sep 17 00:00:00 2001 From: Jarkko Toivanen Date: Sat, 13 Jan 2024 03:28:43 +0200 Subject: [PATCH 2/2] Fixed R/G/B field information fetching from Multiboot --- src/mbootinfo.asm | 2 ++ src/start32.asm | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/mbootinfo.asm b/src/mbootinfo.asm index 2ff07e8..d7425f0 100644 --- a/src/mbootinfo.asm +++ b/src/mbootinfo.asm @@ -54,6 +54,8 @@ mbootgetinfo: mov [mbootinfo.fb_type], al inc esi + ;garbage? + add esi, 2 ;; r/g/b positions and masks mov ecx, 6 mov edi, mbootinfo.fb_rpos diff --git a/src/start32.asm b/src/start32.asm index 5feda10..495dde2 100644 --- a/src/start32.asm +++ b/src/start32.asm @@ -143,6 +143,54 @@ push esp call serialwrite add esp, 4 + + +push stuff.rmasksizetxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_rmasksize] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + +push stuff.gmasksizetxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_gmasksize] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + +push stuff.bmasksizetxt +call serialwrite +add esp, 4 + +push dword esp +push dword 10 +xor eax, eax +mov al, [mbootinfo.fb_bmasksize] +push dword eax +call __uitoa +add esp, 3*4 +push esp +call serialwrite +add esp, 4 + + add esp, 36 ;Clean reserved uitoa return string from stack ; Draw a test pixel to bottom right corner @@ -240,6 +288,9 @@ stuff: .rpostxt db 10, "rPos: ", 0 .gpostxt db 10, "gPos: ", 0 .bpostxt db 10, "bPos: ", 0 + .rmasksizetxt db 10, "rMaskSize: ", 0 + .gmasksizetxt db 10, "gMaskSize: ", 0 + .bmasksizetxt db 10, "bMaskSize: ", 0 align 4096 bss_start: