OSDev.org
https://forum.osdev.org/

VESA Video Mode : can't draw on whole screen
https://forum.osdev.org/viewtopic.php?f=1&t=33716
Page 1 of 1

Author:  Dave08 [ Mon May 27, 2019 12:19 pm ]
Post subject:  VESA Video Mode : can't draw on whole screen

Hello,
I'm developing a small OS in unreal mode using mode 0x112 (640x480 16.8M colors) for a GUI system.

Here's my problem : I'm limited to a block of exactly 64 KB of "VRAM" starting at 0xA0000. Actually, I'm not really limited, I'm setting the pixel values correctly on "presumably" the WHOLE screen, but this is what's actually happening :
Attachment:
Capture.PNG
Capture.PNG [ 6.3 KiB | Viewed 919 times ]

I have no idea what's causing this problem. The video mode is correctly set, I'm using extended registers to access memory...

Any help would be appreciated,
Thanks.

Author:  MichaelPetch [ Mon May 27, 2019 12:54 pm ]
Post subject:  Re: VESA Video Mode : can't draw on whole screen

The video hole at 0xa0000 is 64KiB in size. You can only write to a portion of the entire video space for a screen resolution of 640x480x24-bit color. 640x480x24-bit = 921600 bytes. If you write a color to the 64KiB at 0xa0000 you aren't filling the whole display, just the bytes associated with the first 64KiB of 921600 (which is why you only see a fraction of the screen painted). Mode 112h uses 15 banks that you have to switch between 15*64KiB=983040 (most of the last bank is unused) in order to reference all the pixels.

VBE 1.2+ should support mode 640x480x24-bit color. If you have VBE 2+ Have you considered querying VBE for this resolution and getting back a pointer to the video frame buffer (aka linear frame buffer aka LFB). This can be done with Int 10h, AX=4f01h. Since you are in unreal mode you should be able to reference the entire video frame buffer directly (the frame buffer address will be above the 1MiB somewhere). You will also have to ensure you have enabled the A20 line.

Author:  Dave08 [ Wed May 29, 2019 5:26 am ]
Post subject:  Re: VESA Video Mode : can't draw on whole screen

Ok so my problem is no more!

Basically, what I did was creating a 256 bytes buffer and running the 4f01 command with the video mode 0x112 and started setting pixel colors to the mode's linear buffer (specified as a dword in the 256 bytes info buffer at offset 0x28).

now, these two lines :
Code:
mov ebx, [_vge_info+0x28]
mov byte [ebx+2], 0xFF

made the first pixel red. And making a loop to fill the whole screen works, thanks to MichaelPetch!

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/