0

How do I install "hello world" driver manually? I have written a registry script where "start"=dword:3 means service requires manual start.

But how do I start and stop it? I have tried sc start <path to .sys file> but it says specified service does not exist as an installed service.

Also if possible, please tell me how the mapping between registry keys and driver's .sys file is made. My understanding is that with registry value, we mention name [HKEY_LO.../drivername] this drivername is searched in Windows/system32/drivers/ directory. If it is found there then that driver is treated according to other parameters. Please correct me if I am wrong.

  • please do not point at external tools like [OSR driver loader](http://www.osronline.com/article.cfm?article=157). This is not my preferred way. As it is a software, it must be doing something which I wish to learn. Though this is repetitive, its fun for me. –  Sep 19 '13 at 09:13
  • Can you elaborate on what your "hello world" driver does? Depending on what type of device you are trying to install the directions might be different. Typically Windows drivers are installed via an INF file. Also, when writing Windows drivers you should start from some sample in the Windows Driver Kit that most represents the device you are developing for. Almost no one that I know of will write a driver from scratch these days. Doing this gives you a baseline to start your development from, including the installation INF. – Preston Sep 20 '13 at 01:50
  • Well, it just prints "Hello, World!" using DbgPrint(..). I am very much new to WDD and windows for that matter. Thanks for advice about starting point, but I am doing it through WDM(see the tag!). Also I agree that very few people write drivers from the scratch but to understand things TtB one has to. Tell me if I need to add code to question. –  Sep 20 '13 at 04:47
  • Whether you are using WDF or WDM the process, in my opinion, will be the same. If you are just looking for information on WDM drivers the best start would be to read Windows NT Device Driver Development by Peter Viscarola (http://www.amazon.com/Windows-NT-Device-Driver-Development/dp/1578700582). If you are trying to accomplish a specific task with your driver then I would suggest updating your question for that. Otherwise I've posted what I may be the answer you are looking for. – Preston Sep 20 '13 at 20:02

2 Answers2

2

You might try using net start instead of sc start. If you continue to receive this message then it is possible that you haven't compiled your driver correctly and this is the reason it's failing to load.

There is a full example of a simple DriverEntry based "Hello World" driver here: http://www.catch22.net/tuts/introduction-device-drivers

I'd also recommend reading Windows NT Device Driver Development by Peter Viscarola.

Preston
  • 2,543
  • 1
  • 17
  • 26
  • `net start` made it work. Thanks. But one thing said if you still have the problem, you might not have compiled it correctly. But I said i am having .sys file. The reason I am asking this is to know can this also happen? I have always believed if there is some compiler error, it will NEVER generate .obj file.. but not sure about Windows.. windows guys are..... different#..! –  Sep 23 '13 at 05:47
  • Also I thought `net` will be used for network related services, what does `net` does differently than `sc`? –  Sep 23 '13 at 08:41
  • As far as I know they will do the same thing, but `net` is more restricted and `sc` gives you more options for starting a service. I have always used `net start` (as do the samples). I've never used this in a commercial driver though, I have always started from a sample that has an INF and used this for installation through Device Manager. Good luck in your development! – Preston Sep 23 '13 at 15:33
0

What Preston has told works, it also works with sc. I was doing giving path to .sys file with it, but we need to just tell the name of the service.

eg. sc start minimal