OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 4:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: VESA Video Mode : can't draw on whole screen
PostPosted: Mon May 27, 2019 12:19 pm 
Offline
User avatar

Joined: Mon May 27, 2019 11:32 am
Posts: 8
Location: France
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 933 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.


Top
 Profile  
 
 Post subject: Re: VESA Video Mode : can't draw on whole screen
PostPosted: Mon May 27, 2019 12:54 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 692
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.


Top
 Profile  
 
 Post subject: Re: VESA Video Mode : can't draw on whole screen
PostPosted: Wed May 29, 2019 5:26 am 
Offline
User avatar

Joined: Mon May 27, 2019 11:32 am
Posts: 8
Location: France
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 153 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group