I'm unable to switch VESA VBE bank

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tn
Posts: 7
Joined: Fri Apr 22, 2022 10:01 am
Libera.chat IRC: tn

I'm unable to switch VESA VBE bank

Post 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.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: I'm unable to switch VESA VBE bank

Post by Octocontrabass »

Are you trying to use that code to switch banks in protected mode?
tn
Posts: 7
Joined: Fri Apr 22, 2022 10:01 am
Libera.chat IRC: tn

Re: I'm unable to switch VESA VBE bank

Post by tn »

No, I'm doing it before I switch to protected mode.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: I'm unable to switch VESA VBE bank

Post 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?
tn
Posts: 7
Joined: Fri Apr 22, 2022 10:01 am
Libera.chat IRC: tn

Re: I'm unable to switch VESA VBE bank

Post 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.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: I'm unable to switch VESA VBE bank

Post 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...
Post Reply