nvidia stuff

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

nvidia stuff

Post by mariuszp »

Does anyone have any information about nvidia cards? Anything basic, such as switching video modes, maybe 2D acceleration.
There should be more information about those things on the wiki.
If nobody here has this information... is it legal for me to post such information if i reverse engineer the cards myself?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: nvidia stuff

Post by Combuster »

Save yourself the effort of redoing all the existing research:
https://nouveau.freedesktop.org/wiki/

Edit: and perhaps clicking through links would've been prudent as well.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: nvidia stuff

Post by mariuszp »

Combuster wrote:Save yourself the effort of redoing all the existing research:
https://nouveau.freedesktop.org/wiki/

Edit: and perhaps clicking through links would've been prudent as well.
This article does not specify how to do anything, just points to some docs. The documentatino for the nvidia cards (from envytools) is very complex, and is not really intended for beginners. It would be nice to have an article explaining the basics, such as switching video modes.
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: nvidia stuff

Post by FallenAvatar »

mariuszp wrote:
Combuster wrote:...
This article does not specify how to do anything, just points to some docs. The documentatino for the nvidia cards (from envytools) is very complex, and is not really intended for beginners. It would be nice to have an article explaining the basics, such as switching video modes.
Writing an OS isn't for beginners. (Nor is writing video drivers) Maybe your question would be better received at StackOverflow (or similar sites)...

- Monk
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: nvidia stuff

Post by Combuster »

There's at least some amount of documentation on the wiki, mostly centered around the VGA, that actually deals with how graphics hardware interfaces a plug on the outside and a CPU in the inside. If you are able to set 720x400 16-color graphics mode on a VGA with your own driver, then you probably know enough of the basics to follow through with more complicated hardware.

And yes, that resolution is important, because it's 1) a valid mode on VGA CRTs and 2) there are no register files for that, so you have to calculate them by hand. There should be enough information on the wiki alone to solve this particular problem.

Once you're done with that, you probably have the basic terminology level you need to make at least some sense of graphics documentation. Diving straight into nvidia is essentially a form of sadomasochism and the best education for that is probably to let you fail first. And even then, writing a mode-setter using only documentation without other sources of reference is an exceptionally difficult task to pull off.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: nvidia stuff

Post by MollenOS »

mariuszp wrote:
Combuster wrote:Save yourself the effort of redoing all the existing research:
https://nouveau.freedesktop.org/wiki/

Edit: and perhaps clicking through links would've been prudent as well.
This article does not specify how to do anything, just points to some docs. The documentatino for the nvidia cards (from envytools) is very complex, and is not really intended for beginners. It would be nice to have an article explaining the basics, such as switching video modes.
So you'd rather try to reverse engineer the cards by yourself as you mentioned than you'd try to follow the actual documentation (even if sparse)? Getting any native video driver working, even just in basic 2D is a really complex task. I'd advise you to start with other drivers and stick to VESA/VGA as long as possible. ;-)
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: nvidia stuff

Post by mariuszp »

MollenOS wrote:
mariuszp wrote:
Combuster wrote:Save yourself the effort of redoing all the existing research:
https://nouveau.freedesktop.org/wiki/

Edit: and perhaps clicking through links would've been prudent as well.
This article does not specify how to do anything, just points to some docs. The documentatino for the nvidia cards (from envytools) is very complex, and is not really intended for beginners. It would be nice to have an article explaining the basics, such as switching video modes.
So you'd rather try to reverse engineer the cards by yourself as you mentioned than you'd try to follow the actual documentation (even if sparse)? Getting any native video driver working, even just in basic 2D is a really complex task. I'd advise you to start with other drivers and stick to VESA/VGA as long as possible. ;-)
Well, my idea was to essentially translate the VESA BIOS code from a nVidia card into C.

I may have incorrectly assumed that mode setting is just a specific command supported by the card (since each card has specific modes it supports).

The envytools docs seem to be talking mostly talking about how to control the GPU (the processor, not the graphics card itself), which is what lead me to think that said documentation is perhaps only interested on the operation of the GPU.

And as for setting VGA modes manually: is there actually a standard way to do this without the BIOS? There are tons of documentation on the VGA on the internet, and they all use the BIOS for mode switching, and it is non-trivial to set the mode by just playing around with VGA registers. I did see code for switching to mode 13h etc without the BIOS, but it relied on register dumps, which suggests that the author themself did not know what they were doing.

What starting point should I then take? Is it the CRT registers that I need to understand first?
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: nvidia stuff

Post by iansjack »

Just do it and prove everybody wrong.
Post Reply