This is the BGA initialization code:
Code:
InitBGA:
mov ax, 0x4
mov dx, 0x01CE
out dx, ax ;0x1CE
xor ax, ax ; Screen disable
inc dx
out dx, ax ;0x1CF
mov ax, 0x1
dec dx
out dx, ax ;0x1CE
mov ax, 720 ; X
inc dx
out dx, ax ;0x1CF
mov ax, 0x2
dec dx
out dx, ax ;0x1CE
mov ax, 400 ; Y
inc dx
out dx, ax ;0x1CF
mov ax, 0x3
dec dx
out dx, ax ;0x1CE
mov ax, 32 ; BPP
inc dx
out dx, ax ;0x1CF
mov ax, 0x4
dec dx
out dx, ax ;0x1CE
mov ax, 0x41 ; Linear famebuffer and screen enable
inc dx
out dx, ax ;0x1CF
iret
After initialising the BGA, I use a GDT segment which starts at the BAR0 address of the BGA PCI device and write 720*400 dwords of 0x00FFFFFF:
Code:
mov ecx, 720*400
mov ax, 0x38
mov gs, ax
xor edi, edi
.loop:
mov dword [gs:edi], 0x00FFFFFF
add edi, 4
loop .loop
Yet the screen remains black.
I'm using Bochs to test my OS.
Github:
https://github.com/Th3Matt/FlameOS-Rewrite3/