i tried to enable VESA mode 4118h (LFB!) and it doesn't work well
I use this code to fill the screen with a certain color:
Code: Select all
mov edi, [VbeModePhysBasePtr]
mov ecx, 1024*768
mov eax, 0xff408080
rep stosd
This is the whole code:
Code: Select all
start:
mov ax, cs
mov ds, ax
mov es, ax
call enable_a20
;VESA vorhanden?
mov ax, 4f00h
mov di, VbeInfoBlock
int 10h
cmp ax, 004Fh
jne short novesa
;VESA initialisieren
mov ax, 4F01h
mov di, VbeModeInfoBlock
mov cx, 0x4118
int 10h
cmp dword [VbeSignature], 'VESA'
jne short novesa
cmp byte [VbeVersion+1], 2
jb short novesa
;Setze Aufl?sung (1024x768x24 LFB)
mov ax, 0x4F02
mov bx, 0x4118
int 10h
jmp short kernel16
novesa:
jmp $
kernel16:
xor ebx, ebx
mov bx, ds ; Bx ist das Segment
shl ebx, 4 ; Bx ist die lineare Addresse des Segments
mov eax, ebx
mov [gdt2 + 2], ax ; Setze Addresse des 32-bit Segments
mov [gdt3 + 2], ax
mov [gdt4 + 2], ax ; Setze Addresse des 32-bit Segments
mov [gdt5 + 2], ax
shr eax, 16
mov [gdt2 + 4], al
mov [gdt3 + 4], al
mov [gdt4 + 4], al
mov [gdt5 + 4], al
mov [gdt2 + 7], ah
mov [gdt3 + 7], ah
mov [gdt4 + 7], ah
mov [gdt5 + 7], ah
lea eax,[gdt + ebx] ; Eax ist die physikalische Adresse der GDT
mov [gdtr + 2],eax
cli
lgdt [gdtr] ; Die GDTR mit der Adresse laden und dem Limit der GDT
mov eax, cr0 ; Setze das PE Bit im Register CR0 ...
or al, 1
mov cr0, eax ; ... und wechsel dadurch in den Protected Mode
jmp SYS_CODE_SEL:kernel32 ; Springe zum 32-bit Kernel
[BITS 32]
kernel32:
xor edi,edi
xor esi,esi
mov ax,SYS_DATA_SEL
mov ds,ax
mov ss,ax
mov ax,LINEAR_SEL
mov es,ax
mov edi, [VbeModePhysBasePtr]
mov ecx, 1024*768
mov eax, 0xff408080
rep stosd
jmp $
MfG, Prometheus