Video generation books

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.
lukassevc
Posts: 20
Joined: Wed May 29, 2019 2:56 pm
Libera.chat IRC: lukassevc

Video generation books

Post by lukassevc »

Hello!

I would like to add video generation capability to my OS. The problem is that I'm confused wih all the standarts and ways, that's why I would like to ask for some complete book/document/... ( web site and projects as well, even though I don't prefer them ) which explains everything from the basic 320x200 16 color EGA/VGA modes, through the VGA hardware registers up to the VESA GOP and how to create a universal video driver ( if something like that is possible ). I'm not looking for some fancy 3D acceleration stuff, just for thing as simple as drawing a pixel to the screen and some basic sprites. Also, I would be very happy if it could generate 1920x1080 full HD video, is it possible by using the VGA hardware registers?

Thanks a lot!
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: Video generation books

Post by austanss »

What architecture are you building this OS on?
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Video generation books

Post by nullplan »

lukassevc wrote:The problem is that I'm confused wih all the standarts and ways,
There once was a graphics card known as the VGA. It was very good for its time (1987) but has outlived its usefulness. Then there used to be VESA, which came in different versions, but the most recent ones simply tell you to query for the available graphics modes, and then set the mode you want, and then leave it at that. Now there is GOP, which is essentially the same thing with a different interface (function pointers instead of interrupts). But the idea is the same: Query modes, set mode, use framebuffer. Be happy. The only alternative to using these things is to write a graphics driver for your (brand of) graphics card. Good like finding documentation. Intel releases theirs. nVidia doesn't. Don't know for AMD. Don't know any other player in the current market.
lukassevc wrote: Also, I would be very happy if it could generate 1920x1080 full HD video, is it possible by using the VGA hardware registers?
No. The VGA is fundamentally incapable of anything like that. To my knowledge, you could conceivably get 640x480 going, but only at eyestraining refresh rates. For anything else, the pixel clock is too slow. Besides, the quality of VGA emulation has been slipping somewhat in recent graphics adapters, probably because few need it. Your best bet is, now as always, to go with VESA or GOP and forget the VGA ever existed. Set graphics mode via firmware, get framebuffer characteristics from firmware, and work with that.
Carpe diem!
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Video generation books

Post by eekee »

nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Video generation books

Post by nullplan »

eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
A certain Torvalds quote comes to mind. Dear god, we just had a system that basically works for every card and every PC, and now they want to break it. WHY?
Carpe diem!
lukassevc
Posts: 20
Joined: Wed May 29, 2019 2:56 pm
Libera.chat IRC: lukassevc

Re: Video generation books

Post by lukassevc »

nullplan wrote:
lukassevc wrote:The problem is that I'm confused wih all the standarts and ways,
There once was a graphics card known as the VGA. It was very good for its time (1987) but has outlived its usefulness. Then there used to be VESA, which came in different versions, but the most recent ones simply tell you to query for the available graphics modes, and then set the mode you want, and then leave it at that. Now there is GOP, which is essentially the same thing with a different interface (function pointers instead of interrupts). But the idea is the same: Query modes, set mode, use framebuffer. Be happy. The only alternative to using these things is to write a graphics driver for your (brand of) graphics card. Good like finding documentation. Intel releases theirs. nVidia doesn't. Don't know for AMD. Don't know any other player in the current market.
lukassevc wrote: Also, I would be very happy if it could generate 1920x1080 full HD video, is it possible by using the VGA hardware registers?
No. The VGA is fundamentally incapable of anything like that. To my knowledge, you could conceivably get 640x480 going, but only at eyestraining refresh rates. For anything else, the pixel clock is too slow. Besides, the quality of VGA emulation has been slipping somewhat in recent graphics adapters, probably because few need it. Your best bet is, now as always, to go with VESA or GOP and forget the VGA ever existed. Set graphics mode via firmware, get framebuffer characteristics from firmware, and work with that.
The only problem is that I have my normal computer with UEFI and GOP, but my much much older computer from 2008 dosn't have it, so there remains a question, how am I supposed to deal with this kind of a problem? I think I should somehow detect the GOP, and that's the reason why I wanted a book about it. Also, it has some FUJITSU GPU and I don't really know anything about it.
lukassevc
Posts: 20
Joined: Wed May 29, 2019 2:56 pm
Libera.chat IRC: lukassevc

Re: Video generation books

Post by lukassevc »

eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
May I ask where I can find this doc? I tried to search for it multiple times but nothing usable. Thanks!
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

Re: Video generation books

Post by Klakap »

The only problem is that I have my normal computer with UEFI and GOP, but my much much older computer from 2008 dosn't have it, so there remains a question, how am I supposed to deal with this kind of a problem? I think I should somehow detect the GOP, and that's the reason why I wanted a book about it. Also, it has some FUJITSU GPU and I don't really know anything about it.
For older computers without UEFI is VESA standard. It working on BIOS interrupt 0x10. On wiki we have page VESA_Video_Modes. You can scan all graphic modes whose are aviable and choose biggest.

//edit: VESA spec is very useful, you can get it fromhttp://www.petesqbsite.com/sections/tut ... s/vbe3.pdf
xeyes
Member
Member
Posts: 212
Joined: Mon Dec 07, 2020 8:09 am

Re: Video generation books

Post by xeyes »

nullplan wrote:
eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
A certain Torvalds quote comes to mind. Dear god, we just had a system that basically works for every card and every PC, and now they want to break it. WHY?
Because they want us consumers to buy other vendor's video cards :wink:

NVDA is content as long as it can sell AI accelerators, yup, those that don't have video output ports or capabilities at all, to the big corporations. Much better margin, growth, and 'exciting story of growth' over there than a 'dying' market like the PC.
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: Video generation books

Post by austanss »

eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
So this explains why my OS looks like wack on my PC...
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Video generation books

Post by eekee »

nullplan wrote:
eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
A certain Torvalds quote comes to mind. Dear god, we just had a system that basically works for every card and every PC, and now they want to break it. WHY?
I had a guess I thought was a good one, but now I come to write it out, I realise it looks like total paranoia. It goes like this: Idiot buys nVidia card & installs mainstream OS. Idiot doesn't install graphics driver & doesn't realise its using a framebuffer driver. Idiot gets all over the net shouting "nVidia slowed down my PC!" If this was a real problem, why don't ATi remove native resolutions too?
xeyes wrote:Because they want us consumers to buy other vendor's video cards :wink:
Hahaha!
xeyes wrote:NVDA is content as long as it can sell AI accelerators, yup, those that don't have video output ports or capabilities at all, to the big corporations. Much better margin, growth, and 'exciting story of growth' over there than a 'dying' market like the PC.
Interesting... and somewhat annoyingly, very likely true. There is one up-side to this: those things aren't just AI accelerators, they make good accelerators for physics engines too.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
lukassevc
Posts: 20
Joined: Wed May 29, 2019 2:56 pm
Libera.chat IRC: lukassevc

Re: Video generation books

Post by lukassevc »

Klakap wrote:
The only problem is that I have my normal computer with UEFI and GOP, but my much much older computer from 2008 dosn't have it, so there remains a question, how am I supposed to deal with this kind of a problem? I think I should somehow detect the GOP, and that's the reason why I wanted a book about it. Also, it has some FUJITSU GPU and I don't really know anything about it.
For older computers without UEFI is VESA standard. It working on BIOS interrupt 0x10. On wiki we have page VESA_Video_Modes. You can scan all graphic modes whose are aviable and choose biggest.

//edit: VESA spec is very useful, you can get it fromhttp://www.petesqbsite.com/sections/tut ... s/vbe3.pdf
Thank you very much! There's just one problem, I can't use this in protected mode since it uses real mode interrupts, any way around this except for switching back and forth?
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Video generation books

Post by Gigasoft »

The other option, which might be easier, is to use Virtual 8086 mode.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Video generation books

Post by Schol-R-LEA »

eekee wrote:nVidia releases some documentation; just enough to set display modes. This is likely to be essential as nVidia also hate VESA and GOP to a near-fanatic extent, going so far as to remove the screen's native pixel size from the supported modes!
AMD is slightly better in this regard, providing enough documentation to write a basic driver and even directly supporting the FOSS drivers for Linux. They do still hold back some important info, but far less than nVidia do.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Video generation books

Post by Octocontrabass »

lukassevc wrote:There's just one problem, I can't use this in protected mode since it uses real mode interrupts, any way around this except for switching back and forth?
Make your bootloader do all of the work before it switches to protected mode.
Post Reply