OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Implementing graphics drivers..
PostPosted: Sun May 30, 2021 4:35 pm 
Offline

Joined: Sat May 01, 2021 8:47 pm
Posts: 15
I'm wondering about any nvidia documentation, I'm a great reverse engineer but it's obviously a waste of time. So I'm wondering if you need to develop your OS to a certain point, and then ask them to make a driver/give you documentation under certain conditions as i heard claims about that and people claiming to have the documentation

If not, do I just have to develop my OS enough and ask them?


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Sun May 30, 2021 4:38 pm 
Offline
Member
Member
User avatar

Joined: Thu Mar 04, 2021 7:25 am
Posts: 31
newosdeveloper2021 wrote:
I'm wondering about any nvidia documentation, I'm a great reverse engineer but it's obviously a waste of time. So I'm wondering if you need to develop your OS to a certain point, and then ask them to make a driver/give you documentation under certain conditions as i heard claims about that and people claiming to have the documentation

If not, do I just have to develop my OS enough and ask them?


I would think you'd need a considerable market share and wealth for it to even be considered.

Must it be NVidia? Intel may have horrible GPU documentation (although the i815 docs seem alright), but at least they're freely accessible.

_________________
mid.net.ua


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Sun May 30, 2021 4:47 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
NVIDIA is the last company who would give you documentation to their hardware. They're incredibly anal about it for some reason. The fact that Linux needed to make an open-source driver *before* NVIDIA gave us drivers for Linux, if memory serves, should tell you something. Even if you have a considerable market share they're unlikely to give you docs. The intel docs are horribly organized (especially given the fact that they organize registers alphabetically instead of by address like every other company out there) but those (and the AMD GPU docs) are where you should probably start. If you can't get the latest AMD GPU docs I think that they'll give you them if you email their open-source GPU driver development email.


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Sun May 30, 2021 9:50 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
You might consider looking at the source code and documentation for the Nouveau drivers, which are from an existing reverse-engineering project for Linux. They are far from what the closed-source Nvidia drivers are, but they would be the best - indeed, in some ways the only - source for documentation on the Nvidia hardware interface.

However, as others have already said, if there's any option of targeting either Intel or AMD instead of (or at least before) NVidia, that would be the better choice. Even if you would still want - or need - to implement Nvidia drivers at some point, getting the other two done first would at least give you the experience with GPU drivers so that you could focus more on the Nvidia-specific aspects once you have the more general aspects mastered.

Note that even for Linux, the Nvidia official drivers are closed source - they didn't provide anyone in the Linux community documentation, they just started handing out their own binary blob drivers when it became clear that they couldn't afford to ignore Linux outright (and many suspect that they only did that because they wanted to sell GPGPU hardware to supercomputer sites - providing drivers to ordinary Linux users was just a side result). The drivers are free, but the source code and hardware details are still kept under lock and key.

_________________
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.


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Sun May 30, 2021 10:10 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
Schol-R-LEA wrote:
Note that even for Linux, the Nvidia official drivers are closed source - they didn't provide anyone in the Linux community documentation, they just started handing out their own binary blob drivers when it became clear that they couldn't afford to ignore Linux outright (and many suspect that they only did that because they wanted to sell GPGPU hardware to supercomputer sites - providing drivers to ordinary Linux users was just a side result). The drivers are free, but the source code and hardware details are still kept under lock and key.
Yep. The way the binary nVidia driver works is this: There is a source code part and a binary part. The source code part adapts to the kernel version. The driver creates a new device which is mapped into memory, and the binary blob then interacts with the card through the memory mapping. This makes it hard to trace what is going on, although in theory you could use IOMMU to find out.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Mon May 31, 2021 1:01 pm 
Offline
Member
Member
User avatar

Joined: Mon Jan 15, 2018 2:27 pm
Posts: 201
As for NVIDIA, I was able to find this https://envytools.readthedocs.io/en/latest/hw/index.html piece of documentation some time ago. It's far from complete, but still, it should be better than nothing.


Top
 Profile  
 
 Post subject: Re: Implementing graphics drivers..
PostPosted: Mon Jul 05, 2021 1:54 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
Uh... FreeBSD has Nvidia drivers and Nvidia techs are quite eager to support it. If Linux has 1% of the desktop market, FreeBSD must have less than 1% of 1%. I'd say go for it; approach Nvidia about a driver, but be very polite and try not to take up too much of their support time because you're not exactly making them any money to pay for that support time. You probably will have to sign a non-disclosure agreement.

Ethin wrote:
The fact that Linux needed to make an open-source driver *before* NVIDIA gave us drivers for Linux, if memory serves, should tell you something.

No, it shouldn't tell us something; things were different in that era. Basically all corporate attitudes to open source were different. It was even illegal to mod games. When Nvidia first released drivers for Linux, things were beginning to change. IBM had famously embraced Linux, much to everyones surprise. Nvidia weren't the first hardware vendors to accept Linux, but they were quite early. Relatively few other hardware vendors had. ATi may have released more documentation, but it was poor documentation. ATi drivers for Linux were much poorer-quality than Nvidia's for many years. Intel, of course, were not remotely competitive in graphics performance for over a decade.

Linus Torvalds complained about the closed-source nature of Nvidia drivers more than once, but this was because he and other Linux kernel devs didn't have the right to use debuggers on it. They couldn't see if the Nvidia driver was causing problems. I'm sure it's different for kernel devs who have signed the NDA to allow them to look into the driver. As a user using Nvidia drivers with stable Linux kernel versions, I only once had a problem which may or may not have been Nvidia's fault. I had more problems with Intel drivers at a time when Intel were enthusiastic contributors to Linux!

_________________
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


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Octocontrabass and 98 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