0

I can't pass the address of the linear framebuffer to vbe

I tried via:

mov eax, [ModeInfoBlock + 0x28]
mov [0x8000], eax

but 0x8000 is always zero, but if I write mov [0x8000], 0x12345, then it really works (this is in the 32-bit part).

Here is the code for getting the address:

mov ax, 4F01h
mov cx, 1000111000000010b  ; 1024x768 16-bit color
mov di, ModeInfoBlock    
xor bx, bx
mov es, bx         
int 10h

;mov ax, 4F02h
;mov bx, 1000111000000010b
;int 10h

(this is in the 16-bit part)

1 Answer 1

1
mov cx, 1000111000000010b  ; 1024x768 16-bit color

You're not using a valid VESA mode number

The VESA-defined mode number for 1024x768 16-bit color is 117h.
That would result in the following instruction:

mov cx, 0100'0001'0001'0111b

It is important to actually ask for the linear frame buffer model by setting bit 14 to ON (one), so not bit 15 like you did before.
Also note that the bits 9 through 13 are for the most reserved bits and you should set these to OFF (zero).

mov eax, [ModeInfoBlock + 0x28]

If your VESA implementation is not at least version 2.0, then the info from addresses 0x28 onwards will not be returned to you. Obtain the version info from executing function 4F00h.


A more robust approach does not try to use the (deprecated) VESA-defined mode numbers, but rather consults the VideoModeList for which function 4F00h returns the far pointer in its VideoModePtr field at offset 14.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.