Having searched a lot of forums / sites could not find anything useful about writing a driver in C ++. I want to write a simple driver that will make itself felt when the computer is turned on and off. What to do?
Closed due to the fact that the question is too general among the participants αλεχολυτ , Vladimir Gamalyan , Harry , jfs , AK ♦ Mar 13 '17 at 8:12 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- 3How can I put it ... For each OSes, the rules of the game are their own, and C ++ alone is hardly possible to manage. - Harry
- Something is not clear to me what you specifically want. - Vyacheslav Savchenko
- @Harry he wants logs to do on-off shutdowns? I do not catch up - Vyacheslav Savchenko
- @ VyacheslavSavchenko Yes, to begin with, as I understand it, one that will simply somehow inform about itself. Squeak, for example :) - Harry
- oneC ++ requires support libraries. And drivers in most OSs cannot use standard libraries. And for this reason they are written in pure C - Mike
1 answer
First you need to thoroughly study Russinovich. Then Walter They. Then make a sandbox in which you will run your driver (WinDBG + VirtualKD + VM Ware + OS), it is very unpleasant to rearrange windows every half hour. Then you extort DDK and symbols. Then you set up all this for a long time, linking the studio, VM Ware, DDK compiler, there are symbols — there are manuals on the network, but it will not save you from dancing with a tambourine. If at this moment the very idea of ​​drivers is not opposed to you, then you will find that the DDK does not work with classical C and C ++, there is something very specific that takes into account interruption levels and “other intestines of the system”, resembling the most ancient K & R. If, and this does not scare you, you can start experimenting.
- 2Are you sure that the vehicle needs a driver for Windows? - αλεχολυτ
- one@alexolut is not sure :), but 1.manuyals 2. sandbox 3.DDK 4. "dances with a tambourine" will most likely be everywhere, only the names will be different. Interrupt levels, for example, do not depend on the OS, but on the processor, so any operating system on the Intel platform will have a separate kernel mode and user. - Mirdin
- @Mirdin And please do not call privilege levels, interrupt levels. these are different concepts - Mike
- @Mike, sorry, I have already forgotten a lot about this topic :). - Mirdin