Page 1 of 1

I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 5:45 am
by tn
Hello guys.

Before I switch to protected mode, I set 100h VESA VBE mode. My c code can write to its memory, but I need to switch banks.

With this code, to set VBE mode my kernel write something to display to 0xA0000 memory:

Code: Select all

mov ax, 0x4F02
mov bx, 0x100
int 0x10
But if I use this code to switch bank, it doesnt work and write nothing to display:

Code: Select all

mov ax, 0x4f05
mov bx, 0x0
mov dx, 0x1
int 0x10
Thank you for your help.

Re: I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 10:50 am
by Octocontrabass
Are you trying to use that code to switch banks in protected mode?

Re: I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 11:01 am
by tn
No, I'm doing it before I switch to protected mode.

Re: I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 11:10 am
by Octocontrabass
What are the first 12 bytes of the ModeInfoBlock?

What address are you trying to write to?

What value is returned in AX after calling INT 0x10 AX=0x4F05?

Re: I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 11:51 am
by tn
I am writing to 0xA0000.
When i test for errors after setting bank with this:

Code: Select all

cmp ax, 0x004F
jne err
It will not run err function.

Re: I'm unable to switch VESA VBE bank

Posted: Mon May 02, 2022 12:26 pm
by Octocontrabass
What are the first 12 bytes of the ModeInfoBlock?

It sounds a lot like the bug isn't really related to the bank switch, and it's just a coincidence that adding a bank switch call causes your kernel to stop working...