Bare metal VGA: filter out non-framebuffer graphics modes

from VESA video mode list
This commit is contained in:
tkchia 2022-09-23 10:52:45 +00:00
parent 8ed7d4df55
commit d5eb6c32f2

View file

@ -159,17 +159,17 @@ _rlinit_vesa:
mov %al,%cl mov %al,%cl
and $0b00001011,%al # also skip if mode is unusable, or and $0b00001011,%al # also skip if mode is unusable, or
cmp $0b00001011,%al # extra information unavailable, or cmp $0b00001011,%al # extra information unavailable, or
jnz .fail3 # is monochrome jnz .fail3 # is monochrome, or is graphics w/o
mov %cl,%al # linear frame buffer
and $0b10010000,%al
cmp $0b00010000,%al
jz .fail3
call .putsp # echo mode information call .putsp # echo mode information
call .putsp call .putsp
test $0b00010000,%cl # first, echo mode attributes test $0b00010000,%cl # first, echo mode attributes
setnz %al setnz %al
imul $'g'-'t',%ax,%ax # - 'g': graphics; 't': text mode imul $'G'-'T',%ax,%ax # - 'G': graphics; 'T': text mode
add $'t',%al add $'T',%al
shl %cl # - turn 'g' into 'G' if linear
sbb %cl,%cl # frame buffer supported
and $'G'-'g',%cl
add %cl,%al
call .putc call .putc
call .putsp call .putsp
xchg %ax,%si # then output xchg %ax,%si # then output