Windows driver design

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
ferno

Windows driver design

Post 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
viral

Re:Windows driver design

Post 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/
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Windows driver design

Post 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.
Phugoid

Re:Windows driver design

Post 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.
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:Windows driver design

Post by kataklinger »

MSDN Library has a lot of KeSomethingWhatever, and I think there is Windows DDK Documentation which you can download.
Phugoid

Re:Windows driver design

Post 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.
Post Reply