graphics driver

hi all,im quite a noob in the matter, but i NEED to write a graphics driver for my own use.the problem is - i just dont know how to “talk” to my card - im trying to debug the manufacturer delivered driver but i cant figure out whats going on. i have looked at all installation files - deassembled all libraries and so on, but i cant make out which of these files is the first to be loaded by windows(hence its hard for me to make out the sense of everything) and i know im missing something huge still, as i have hardware opengl support in the manufacturers driver,but i couldnt find any code making gl functions available. im also missing parts of code actually “talking” to the hardware(port communication) and i dont seem to be able to find memory communication either.hence my questions: how do i find the first file to be loaded by the system? do i have to find exported gl functions to be sure i have all code(i thought it might be possible that the driver itself does not need to export these,but then i dont know how a call from a user program finds its way to the driver)? can anyone give me tipps on this(im using ida)? thanks in advance
lord_vader

dawidl@o2.pl wrote:

hi all,im quite a noob in the matter, but i NEED to write a graphics driver for my own use.

Your task is, in practical terms, impossible. You can’t just guess at
what the register settings mean, or how to send commands, or how the
various settings interact. Without a spec for the graphics chip, it
just can’t be done.

the problem is - i just dont know how to “talk” to my card - im trying to debug the manufacturer delivered driver but i cant figure out whats going on. i have looked at all installation files - deassembled all libraries and so on, but i cant make out which of these files is the first to be loaded by windows

The core of a display driver is made up of two parts. There is a .sys
file which lives in Windows\System32\drivers – this is called the
miniport, and mostly handles the configuration and mode setting. There
is a .dll file which lives in Windows\System32, but is actually a kernel
driver. This is called the “display driver”. It handles the calls from
GDI, translating them to drawing commands that your graphics chip
understands.

and i know im missing something huge still, as i have hardware opengl support in the manufacturers driver,but i couldnt find any code making gl functions available.

The OpenGL stuff is handled by the display driver, or by a DLL that is
called by the display driver.

im also missing parts of code actually “talking” to the hardware(port communication) and i dont seem to be able to find memory communication either.

Virtually all graphics cards today use memory-mapped register spaces.
Port I/O is way too slow.

hence my questions: how do i find the first file to be loaded by the system? do i have to find exported gl functions to be sure i have all code(i thought it might be possible that the driver itself does not need to export these,but then i dont know how a call from a user program finds its way to the driver)?

If you don’t even know this, then how do you expect to be able to write
your own?

GDI is in the middle. User-mode apps call GDI, and GDI calls entry
points in the driver. GDI gets an array of function pointers from the
driver at init time, so the functions are not exported from the display
driver.

can anyone give me tipps on this(im using ida)?

Yes. Give up.

What problem are you actually trying to solve?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Unless you have a logic analyzer, an in-circuit emulator, and lots and
lots of time, you should give up now. We tried doing the same thing
(with those tools) back in 2000, and it was a real pain already back
then. It’s gotten worse by a factor of 100 since then.

To know what modules Windows loads, you can install WinDbg and enable
kernel debugging during boot; you can make it write out a list of each
module as it loads.

Typically, these cards don’t do programmed I/O anymore; instead, the
driver will create some program to execute by the GPU, or some DMA
command list, and poke it into memory-mapped space shared with the card.

The OpenGL support is being made available through the ICD (installable
client driver) method.

Cheers,

/ h+

dawidl@o2.pl wrote:

hi all,im quite a noob in the matter, but i NEED to write a graphics driver for my own use.the problem is - i just dont know how to “talk” to my card - im trying to debug the manufacturer delivered driver but i cant figure out whats going on. i have looked at all installation files - deassembled all libraries and so on, but i cant make out which of these files is the first to be loaded by windows(hence its hard for me to make out the sense of everything) and i know im missing something huge still, as i have hardware opengl support in the manufacturers driver,but i couldnt find any code making gl functions available. im also missing parts of code actually “talking” to the hardware(port communication) and i dont seem to be able to find memory communication either.hence my questions: how do i find the first file to be loaded by the system? do i have to find exported gl functions to be sure i have all code(i thought it might be possible that the driver itself does not need to export these,but then i dont know how a call from a user program finds its way to the driver)? can anyone give me tipps on this(im using ida)? thanks in advance
lord_vader


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer