Ensure bpp of video mode is 32 bit

This commit is contained in:
mintsuki 2020-03-27 05:43:34 +01:00
parent f993a23025
commit e39d7f5dd1
2 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ int init_vbe(uint64_t *framebuffer, uint16_t *pitch, uint16_t *target_width, uin
get_vbe_mode_info(&vbe_mode_info, vid_modes[i]);
if (vbe_mode_info.res_x == *target_width
&& vbe_mode_info.res_y == *target_height
/*&& vbe_mode_info.bpp == *target_bpp*/) {
&& vbe_mode_info.bpp == 32) {
print("vbe: Found matching mode %x, attempting to set\n", vid_modes[i]);
*framebuffer = (uint64_t)vbe_mode_info.framebuffer;
*pitch = (int)vbe_mode_info.pitch;

View File

@ -6,8 +6,8 @@ section .stivalehdr
stivale_header:
dq stack.top ; rsp
db 1 ; video mode
dw 640 ; fb_width
dw 480 ; fb_height
dw 0 ; fb_width
dw 0 ; fb_height
section .bss
@ -24,7 +24,7 @@ _start:
mov rax, 'h e l l '
mov rbx, 'o w o '
mov rcx, 'r l d '
mov rdx, [rdi+20]
mov rdx, [rdi+24]
mov [rdx], rax
mov [rdx+8], rbx
mov [rdx+16], rcx