OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:46 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: Polling for VSYNC doesn't work (0x3DA port)
PostPosted: Sun Nov 01, 2020 12:34 pm 
Offline
Member
Member
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 264
Location: London, UK
Octocontrabass wrote:
bloodline wrote:
It appears that there is absolutely no VBlank interrupt,

Correct. Most hardware has the capability, but VBE doesn't expose it.


Seems like a massive oversight... But then again, we weren’t privy to the design meetings.

Quote:
bloodline wrote:
and no VBL hardware flag accessible once grub has set a VBE mode...

It depends on the hardware. GRUB can report VBE information, which will tell you if the current mode has register-level compatibility with VGA (including vblank), but it won't help you when the current mode lacks VGA register compatibility, and it won't help you when the "compatibility" isn't actually attached to vblank.


Ok, that’s good advice! I can at least check and take advantage is available.

Quote:
bloodline wrote:
It seems the only solution is to run updates every 16ms (~60Hz), which won’t allow display syncing, but will at least offer the regularity required for GFX display tasks.

VBE offers double-buffering functions that are supposed to wait for vblank before switching buffers. Whether or not they work is a mystery, and it doesn't help you on modern PCs without VBE.


They might work, but that would mean building the display from scratch each frame... and given the lack of hardware blitter functions, I’m just updating the parts of the display which have changed... Otherwise performance is dreadful, especially when there are lots of windows open and each could have 10s of cliprects!

Quote:
If you're not limited to VBE, though, a native driver solves this problem easily. (For certain definitions of "easily".)


:lol: I’m not writing a native graphics driver any time soon, any offers? No? :P

_________________
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su


Top
 Profile  
 
 Post subject: Re: Polling for VSYNC doesn't work (0x3DA port)
PostPosted: Sun Sep 26, 2021 11:40 am 
Offline

Joined: Fri Sep 24, 2021 12:43 pm
Posts: 1
Geri wrote:
first of all, the timing of your game should not rely on vsync.


Hi! I'm also an 8086 assembly beginner and I'm wondering, what should I use instead? I'm really interested in learning specifically about timers and counters since it looks like a very secretive topic (I mean, since the infamous Appendix H).

Thank you.


Top
 Profile  
 
 Post subject: Re: Polling for VSYNC doesn't work (0x3DA port)
PostPosted: Wed Sep 29, 2021 10:09 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
ivanzinhoa wrote:
I'm also an 8086 assembly beginner and I'm wondering, what should I use instead?

That depends on where you want your program to run.

If you want it to run inside an OS, you should use the timer functions provided by the OS, and let the OS worry about which hardware timer to use.

If you want it to run on bare metal, there's a list of timers available in x86 PCs on the wiki. Of course, not every PC will support all of these timers, so you'll have to choose an appropriate timer according to which PCs you want to run your code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], MichaelPetch and 54 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