NVIDIA graphic card implementation

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.
Post Reply
ignus
Member
Member
Posts: 26
Joined: Thu Jan 30, 2014 9:49 am

NVIDIA graphic card implementation

Post by ignus »

Hello everyone :)
I'm completely new to OS development. I'm just looking for information about the part of an operative system.
Probably I wrote lots of really-wrong-phrases so please take pity of me [-o<

I saw that the most complex is probably the managing of a graphic card, for a lot of reason:
  • A modern graphic card is a computer itself, with bios, memory, cores, bus..
  • Low documentation available
  • Open source driver are quite slow
Now, with a graphic card you can do lots of things faster
  • Fancy graphics
  • GPGPU calculation --> OpenCL, CUDA
Now, I understood that you can't make your graphic card work on your small os (except if you port nouveau, but may you use GPGPU to make your OS super-mega-hardware-accelerated? I mean, I found a sort of driver (GDEV) which seems to be indipendent from NVIDIA driver.
Gdev is a rich set of open-source GPGPU runtime and driver software.
Currently it supports NVIDIA GPUs but is also portable to other GPUs.
I don't know how it really works, but it could a very cool thing.
Inside a document, i also found this:
3. Linux Kernel and Nouveau Device Driver
Gdev disgregates from the device driver. You need to install a native
GPU device driver to use Gdev.
Ahm.. Maybe its not driver indipendent...

SO

GPGPU is very cool. Gdev seems to be a driver that can make your gpu work like a slave. Or maybe not.
I think someone probably know lots of things more than me, so if you have some times to spend, you can write here :D

PS: All post on porting nouveau on custom operative system seems to be old (1, 2, 3, WORKING ONE, 5). Does the situation improved or is still impossible (january 2014) to make a modern gpu work on an operative system different from Windows or Linux?

PPS: sorry for my bad english and my ignorance #-o
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 graphic card implementation

Post by Combuster »

Impossible? That has never been the case.

It is a rather lot of work. I did hear a story of someone getting hardware acceleration out of a then-recent Intel onboard, so there you go. Things do get worse over time, but the generations are not much different these days compared to what they used to be.
"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 ]
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: NVIDIA graphic card implementation

Post by no92 »

1. If you want to get into OS development, don't care about graphics (except for VGA), especially at the beginning.
2. Even if you want to do the graphic stuff (and don't care about the kernel stuff), start with something documented, like the Intel or AMD cards. nVidia is (as you should know) a company not working together with the free software community and is full of assholes and dumbasses. In short, they don't release any official specs.
3. I have never heard that free drivers are slower that proprietary. I think the opposite is more usual.
4. Graphic cards have a BIOS? Never heard of that.
doxrobot
Member
Member
Posts: 30
Joined: Wed May 15, 2013 10:14 am

Re: NVIDIA graphic card implementation

Post by doxrobot »

he is probably referring to video bios option roms.
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 graphic card implementation

Post by Combuster »

no92 wrote: is full of [censored] and [censored].
Apart from the obvious forum rule breaking and being extremely biased propaganda, wouldn't this statement actually apply to people talking based on heresay? [-X

Please show proper manners in the future.

4. Graphic cards have a BIOS? Never heard of that.
They do. Every video card comes with a (simple) built-in driver which is often referred to as the Video BIOS. Each card comes with a ROM on it that initializes the card and communicates with the monitor, and provides the user and the rest of the firmware with handles to control it.
"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 ]
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: NVIDIA graphic card implementation

Post by Bender »

I would say that nVIDIA will be dead as Intel and ATI improve their quality of integrated GPU's; writing a nVIDIA driver is tougher as there is less/no official documentation; ATI Cards are the most documented of the 3.
BTW, You MAY need to reverse engineer the card yourself, which MAY be a little erroneous as
there is no such documentation to guide you. You can use this as a reference. http://nouveau.freedesktop.org/wiki/
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: NVIDIA graphic card implementation

Post by VolTeK »

Bender wrote: I would say that nVIDIA will be dead as Intel and ATI improve their quality of integrated GPU's;
What professional resource of information motivates you to type this?
ignus
Member
Member
Posts: 26
Joined: Thu Jan 30, 2014 9:49 am

Re: NVIDIA graphic card implementation

Post by ignus »

Thank you all for the answers

After a few days, I think that GPU are the most complex and interest part of a system. They are completely new and obscure for me, so i HAVE to take a look in :D

Unbelivable, I found quite a lot of tools, not so much documentation (well, lots of people that started to write a document and stop at half of it), but for now it's ok.

Some days ago a very interesting tool was released (libbeauty).
It's a bit buggy but (IMHO) it can help in disassembly of .o files and then it should disassembly it and then decompile (?!?) it in LLVM IR code and then in C (magic!).
I am quite sure the tool won't be able to decompile code in C, but maybe it can help to understand part of the driver.

I can share the documentation and tools I found, if someone interest: DATA
Nvidia closed driver can be downloaded from the website.
Linux x32 are in a .run package, you can extract it with "bablabla.run --extract-only"
1. If you want to get into OS development, don't care about graphics (except for VGA), especially at the beginning.
For now, I care only about graphic. My project is trying to run a Nvidia driver on a Linux kernel or in someone's kernel here on OSDev.
myself wrote:And why you asked this question here and not in the Nouveau forum?
This seems the most advanced forum on kernel/driver/low-level stuff so I asked here :)
2. Even if you want to do the graphic stuff (and don't care about the kernel stuff), start with something documented, like the Intel or AMD cards.
And where's the fun? :D

PS: sorry again for the horrible language
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: NVIDIA graphic card implementation

Post by neon »

Hello,

It should be noted that NVidia cards are very well documented; just not publicly available but can be obtained for a price. You are going to be completely on your own if you attempt to reverse engineer an NVidia card due to this; thus asking questions specific to the card will be futile.

Also take note that reverse engineering may or may not break the Terms of Use and thus may not be legal and thus should not be advocated by anyone here.

I second the Intel cards option. For one, its legal. For two, the documentation is open to the public.
I would say that nVIDIA will be dead as Intel and ATI improve their quality of integrated GPU's; writing a nVIDIA driver is tougher as there is less/no official documentation; ATI Cards are the most documented of the 3.
There is lots of documentation; just not released to the general public for good reason. The last thing the public needs is all of these hobbyist drivers engulfed in a pool of bugs; incorrect implementations and improper or inefficient design frameworks.

Writing a driver is easy. Writing a "correct" driver is much more difficult.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
ignus
Member
Member
Posts: 26
Joined: Thu Jan 30, 2014 9:49 am

Re: NVIDIA graphic card implementation

Post by ignus »

neon wrote:It should be noted that NVidia cards are very well documented; just not publicly available but can be obtained for a price.
What do you mean? Like books on Amazon or criminal gang? :shock:
neon wrote:There is lots of documentation; just not released to the general public for good reason. The last thing the public needs is all of these hobbyist drivers engulfed in a pool of bugs; incorrect implementations and improper or inefficient design frameworks.
Be sure that no-one will use my hobbistic driver (if I will start it).
There is an official and up-to-date version from Nvidia and 99,9% of people will use that.
Mine is just an 'educational' approach to the GPU understanding.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: NVIDIA graphic card implementation

Post by JAAman »

ignus wrote:
neon wrote:It should be noted that NVidia cards are very well documented; just not publicly available but can be obtained for a price.
What do you mean? Like books on Amazon or criminal gang? :shock:
no, he means, if you convince nVIDIA you legitimately need them, pay the appropriate license fees, and sign the necessary NDAs nVIDIA will give you the documentation
ignus
Member
Member
Posts: 26
Joined: Thu Jan 30, 2014 9:49 am

Re: NVIDIA graphic card implementation

Post by ignus »

JAAman wrote:no, he means, if you convince nVIDIA you legitimately need them, pay the appropriate license fees, and sign the necessary NDAs nVIDIA will give you the documentation
Oh :( well, they won't give me the documents. I can't say: "I wanna study your GPU give me all docs plz" because they'll die for laughing :(

But maybe there are other resources on the net..

EDIT: you mean like THIS old old documentation for the old old old GoForce 5500? (G-O-Force, you read well.. I think it's a sort of chip that helps decoding video and images)
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: NVIDIA graphic card implementation

Post by FallenAvatar »

Bender wrote:I would say that nVIDIA will be dead as Intel and ATI improve their quality of integrated GPU's;
I just wanted to point out that the only reason AMD (The current owner of ATI) is still in business is because they got their hardware on the latest generation consoles (PS4 and XBox One) So I would not say that nVidia will be dead before them. (As much as it irks me to not be able to say that)

Just for anyone who finds this down the road, wanted to clear up that that statement is more an opinion, and likely not to turn out true.

- 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 graphic card implementation

Post by Combuster »

"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 ]
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: NVIDIA graphic card implementation

Post by Bender »

Just for anyone who finds this down the road, wanted to clear up that that statement is more an opinion, and likely not to turn out true.
Yes, those are my personal opinions, they may or may not be true. Everyone should have their own opinions.
Meanwhile in production land...
I remember Linus's interview, where he really expressed his opinions about nVIDIA 8)
Things are changing now I guess.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
Post Reply