How to write a Driver for a Video card
Submitted by Fabien D on Mon, 03/22/2004 - 20:04.
I want to write a driver for ATI (Radeon) video card (I have an ATI Radeon 9600) but I don't know what information I need and how other video card drivers (nvidia, vga) are implemented.
Are you using video card bios or are you directly sending data to the memory of the video card ?
Do you know a good source of information to write this kind of driver ? I saw the ATI web but can't find anything else than binary drivers for other OS.
- Login to post comments
How to write driver for Intel?
Hi,
How to write a driver for video card?From the implementation of Nvidia and Radeon drivers,i found most part of code same except the constants.Am i correct?
I want to write a driver for Intel 82810 chipset graphics controller.In the manual i found the various registers.I dont know how the constants for Nvidia and Radeon are specified.How to find the constants?
Please recommend any sites where i could get information.
I found the manual at
http://www.intel.com/design/chipsets/datashts/29065602.pdf
I want to do something for GUI but i dont have the exact video card:-(
If some more information for writing drivers are provided,i think many can get into GUI.
Exact card
Use "device pcibus" to get a list of all pci devices. Look for a class 3 (video) device, which will give you exact info on the card you have.
In terms of how to write the driver, the nvidia & ati driver can be used as a structural reference, but keep in mind that the exact way to initiaize the card is VERY different for each card, especially for every manufacturer.
Ewout
Info
Good initiative!
You can use the nvidia driver as a reference on how a video driver should look like in jnode. For the nvidia driver, i've used xfree86 and the openbeos drivers as "technical reference manuals".
About the method. These drivers are driving the hardware directly. E.g. the nvidia card uses memory mapped io to control the device and writes directly into the video memory that is mapped into the pci memory space.
The trick is to use the hardware (acceleration) as much as possible, because that will mean a fast gui.
Good luck and feel free to contact me if you need help.
Ewout
how to proceed, generic technical infos
I am a little lost because it seems more difficult that I thought.
I need a lot of technical infos that I can't find (a lot of files in xfree source codes, just for ati!). In fact, It don't really know what technical infos I need. I just saw I need things like vsync, hsync, ....
I need your help, could you explain me what each NVidia* classe is doing, and what technical informations they need.
In what order (which classes) should I proceed ?
Do you have know internet sites and/or tools (I prefer windows tools, but can also use Linux tools) that could give me generic informations ?
A generic tool that could give me (and someone with another video card) supported video modes, vsync, hsync ... could be very usefull. Do you know a such tool ?
In order to get more help, I contacted the ATI developper support and post some messages into forums ... I wait their feedback.
Before I got more information for this driver, I could help on other things (perhaps on cache for FS, see my other post) or somewhere else where help is needed.
First questions
Say me if it's wrong :
With the help of the NVidia driver :
- I added an xml file adapted for ATI drivers under JNode-GUI/descriptors
- I added a new package named ati
- I added a constant in PCI_IDs with the help of the file pci.ids and used it in my mapper (but I saw that only for ATI there is a lot of ids)
Is it enough for JNode to use ATIDeviceToDriverMapper that will say if it can detect an ATI video card ?
It seems that NVidia cards are found on PCI (because the class PCIDevice is used). Does it handle the case where the card is on AGP ?
First answers
The steps you describe should be enough, provided that you correctly mention the ATI..Mapper in the xml descriptor. (I assumed you copied it from nvidia).
About AGP, as far as i know, agp devices are found on the pci bus (at least they do that for my hardware)
Ewout