Page 1 of 1

Windows driver design

Posted: Wed Dec 21, 2005 6:18 am
by ferno
Hello,

I have read some docs about drivers design. Currently I'm browsing Windows mouse driver source code from DDK but I still don't understand, for example, how does mouse driver send the input(mouse movement) data to kernel. Does Windows kernel has similar function to KeSetCursorPos or anything else?

Thanks in advance

Re:Windows driver design

Posted: Wed Dec 21, 2005 3:58 pm
by viral
hi...
I dont know about Window. But I can tell you that Mouse is using port 0x60 (keyboard's) for communication(ps2 i guess).

Some links:
http://www.nondot.org/~sabre/os/article ... ceDevices/
http://panda.cs.ndsu.nodak.edu/%7Eachapwes/PICmicro/

Re:Windows driver design

Posted: Wed Dec 21, 2005 4:34 pm
by Candy
ferno wrote: Hello,

I have read some docs about drivers design. Currently I'm browsing Windows mouse driver source code from DDK but I still don't understand, for example, how does mouse driver send the input(mouse movement) data to kernel. Does Windows kernel has similar function to KeSetCursorPos or anything else?

Thanks in advance
Judging by the name of that call it's a kernel32.dll call or a direct system call. I don't know how windows handles it internally.

Re:Windows driver design

Posted: Wed Dec 21, 2005 5:27 pm
by Phugoid
It would seem from the question that it is not anything in kernel32.dll.

The driver would probably ask the kernel to lock certain resources (I/O ports, for example) for its own private use, and then either ask the kernel to read from/write to those ports on its behalf using some generic function, or perhaps even do it directly (using in and out). If you are talking about kernel-mode drivers, that is.

Re:Windows driver design

Posted: Wed Dec 21, 2005 6:31 pm
by kataklinger
MSDN Library has a lot of KeSomethingWhatever, and I think there is Windows DDK Documentation which you can download.

Re:Windows driver design

Posted: Wed Dec 21, 2005 6:52 pm
by Phugoid
I have misread your original question as well. The cursor position would be handled by GDI, so you would want to look at that and not the kernel. The kernel is not particularly aware of GDI or the device drivers.

Keep in mind that I am not a source of reliable Windows information, however.