"Go" how to get started with Windows Driver development

Source: Internet
Author: User

1, http://blog.csdn.net/charlessimonyi/article/details/50904854 (March 16, 2016 14:55:36)

2.

Doing Windows-driven development is a painful thing, especially for beginners in Windows-driven development. Some people think that Windows Driver development is to download the development package WDK, and then as long as the C + + language, and then just the class library to tune, like the MFC, QT and other libraries, look at the book and MSDN documents on the line. After the real contact only to find it is not so, the pain stems from the following points:


Pain one: Too few Chinese information about Windows Driver development, whether it is Chinese books or online Chinese materials, are very few, hands-on from zero to proficient is needless to say. Only a small amount of Chinese materials, some are older, speaking of DDK, NT-type drive, novice holding WDK8.1, WDK10 face Win8, Win10 system difficult to follow the study, and now the WDK, in WDM appeared again WDF, And WDF is divided into kmdf (kernel-mode driver) and umdf (user-mode driver), for umdf (user-mode driver) Chinese data is even less. And the driver development is not like application development, need to have a certain understanding of the operating system principle, otherwise encountered "I/O Manager", "Input and output request Package", "Software Interruption", "Symbolic link", "dispatch function" and other nouns and concepts are unintelligible, is unable to move.   Solution: ① In fact, MSDN has provided a large number of documents and sample programs, Kmdf, Umdf and so on in a detailed explanation, and even provide a hands-on tutorial you come to the video tutorials, but they are all in English, for me and other poor English programmers really car do not buy tickets-in vain. Recently more and more think English is not good is to hinder the progress of a programmer the biggest stumbling block, we do not talk about what algorithm, do not talk about what math skills, the first to become a qualified code farmers, need to skillfully use a variety of programming languages and corresponding tools library, and most of the libraries are only English documents, can not read these documents fluently, Unable In becoming a qualified code farmers, can skillfully use a variety of ready-made tool library building blocks-like development of the application, to talk about various algorithms, a variety of mathematical knowledge of the generation, to talk about how to upgrade from a yard to a software engineer. Obviously, the most pressing question before me is how to become a qualified code farmer, feed himself first, and then consider how to contribute to socialism, and how to promote the progress of human science and technology. Learning English really should be put on the agenda quickly and immediately, adhere to the implementation. A good English person really is to bring the WDK as easy as MFC, looking at the document and the sample program, those API tune, a complete driver is out. This is not bragging, I worked in a company before, the company has a project of a module needs to be implemented on the RING0, the need to write Windows kernel driver, but no one in the company, so the boss gave the module to one of his friends to do. His friend is a Chinese, in the United States, Microsoft Headquarters, the English level how to needless to say, in short, people have never had to drive development, read the document and sample code, the use of 3 days of spare time to complete the module, get the 15K RMB remuneration, really let people admire, let people envy. Really, learn English, do not say "heard and write", as long as fluent reading all kinds of English technical information, is completely another world, learn what, do what is handy. MSDN on theDriver Development Data entry: Https://msdn.microsoft.com/zh-cn/windows/hardwareMSDN on the hand to teach you the video tutorial: https://msdn.microsoft.com/zh-cn/ Windows/hardware/gg454522 ② grasped only a few Chinese books and studied them carefully. Some of the Chinese books about Windows Driver development are: "Windows Driver Development Technology Details" (strongly recommended to read this first) "WINDOWSWDM Device Driver Development Guide" (older, published in 2000, with Win98, Win2000 as the target system) Windows Device driver WDF Development (a small number of WDF) "Windows 7 device Driver Development" (a few of which are WDF and relatively new, the English version of the book was published in 2010 and the Chinese version was published in 2012) Bamboo Trail: Windows Driver Development in layman's terms: Windows kernel Security programming, "The Bible Night reading: From assembly language to Windows kernel Programming" "Windows kernel Security and Driver development" ("Heavenly Book Night Reading" and "Cold River alone Fishing") and upgraded version of the four book is not really suitable as an introductory book, and suitable as an advanced book, some basic concepts and principles of the explanation of the "Windows Driver Development technology in detail" so many   Pain two: The development of the tool chain is not good for me, and so I just learned programming with VisualStudio and a variety of intelligent tips IntelliSense plug-ins, and even the helper programmer of the code generator, accustomed to VisualStudio fool all, the code can be automatically generated, Form applications can drag controls, and even Web pages can drag controls. It's hard to accept a development environment that only has a text editor and command-line tools, and many times the code editor can't tolerate smart hints, let alone call Cl.exe link.exe, and write code like 10,000 ants crawling around. For a long time ago, VC6.0 and VisualStudio did not have the option of creating a driver project, or the HelloWorld generated directly by the IDE, if you do not want to manually cl.exe Link.exe, if you want to write code in the IDE, you need to build an empty project, and then manually configure the compiler directives, linker directives, include directories, library directories and so on, and then copy the book HelloWorld, and then you may encounter a variety of problems. After the driver files are generated, manually copy them to the virtual machine, install them manually with a tool or INF file, then change the system configuration, enter the kernel debug mode, and then set the debug interface, such asUse COM serial debugging words to set up on the virtual machine, the COM serial port map to the host's named pipe, and then can not be debugged in the VC, can only use WinDbg to debug. In short, every revision of the code, you need to do a lot of manual steps to start debugging, very cumbersome. And even if you follow the steps on the Internet or the book to configure, in different circumstances will encounter a variety of strange problems, make up a rather headache.   WORKAROUND: ① has a third-party software called VISUALDDK that makes this thing a lot easier. VISUALDDK will install a plug-in for VisualStudio, so that in VisualStudio can be used to create a new drive project through the plug-in, and bring HelloWorld, and then the VISUALDDK Monitor installed in the virtual machine, On both sides of the configuration, the next as long as the VisualStudio this side to generate driver files, VISUALDDK will be automatically passed to the virtual machine system to install, and can be directly in the VisualStudio to debug the breakpoint. However, this software in the installation and configuration process, also need a lot of steps, sometimes there will be some wrong configuration problems, occasionally a little headache, and stability and compatibility is not very good. This method applies to VisualStudio2010 and the following versions, WDK7.1 and below. For higher versions, it is not recommended to use VISUALDDK, as you can continue to look down, there are more exciting ways. VISUALDDK Official Website: http://visualddk.sysprogs.org/VS2010+VMWare8+VisualDDK1.5.6 Configuration Tutorial: http://techird.blog.163.com/blog/ Static/1215640362011112385241568/ ② exciting is, starting from VisualStudio2012, Since WDK8.0, Microsoft has integrated a set of tools that resemble VISUALDDK but are much more useful than VISUALDDK. Since then, the development of Windows drivers is just as convenient as developing Windows applications, just install an EXE in the virtual machine, then enter its IP, username, and password in VisualStudio, then you just need to create a new WDK project, click Generate, VisualStudio will automatically pass the drive file to the system in the virtual machine and install it automatically, and then click Debug to debug it in VisualStudio. Is it cool, and the configuration and settings are not complex, MSDN also has a hands-on to teach you to configure the HD video tutorial! In particular, I have written another article: "Win8.1+vs2013+wdk8.1+viRtualbox or VMware Drive development environment Configuration:http://blog.csdn.net/charlessimonyi/article/details/50904956  Pain Three: No library available if one day the boss asks you to develop a software that allows you to use any language you are good at, C/c++/c#/java/python, etc. But a condition is attached: You cannot use any third-party libraries, and you cannot use the standard library! How do you feel about it. what! Standard libraries are not available? That's a hair. Yes, yes, there are almost no libraries to develop Windows drivers, including standard libraries. Because of our usual third-party library or standard library, its implementation is actually called the system API, on Windows is called the Window API, that is, Uer32.dll, Kernel32.dll, Gdi32.dll, and so on provide the API functions. However, these API functions are part of the application-level API and cannot be used in drivers because the drivers run at the kernel level. So as long as the implementation of a library is raised by the system API, it cannot be used in the driver. A few libraries can still be used, such as various numerical functions in MATH.H. But there are only a few available libraries, and many times you need to reinvent the wheel. Even in the C language of malloc, free,c++ in the new, delete, you need to implement.   Solution: ① invented the wheel on his own to invent the wheel, although there is no ready-made library available, but there is a kernel layer of the system API is available, many and Application layer API is very similar, you want to the basic functions can be implemented through these APIs.  ② bite teeth, the bitter in the belly swallow. There are few people who drive the development, Qian to   

3.

4.

5.

"Go" how to get started with Windows Driver development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.