Tuesday, December 14, 2010

Migration from Windows to Linux device control applications

By recognizing MicrosoftWindows? and the operating system Linux? work equipment control, this article will simplify Linux from MicrosoftWindows? to? migrate device control applications.

The author analyses the differences between them, and C/c++ example. If the reader development different platform device control applications, so sure about Windows and Linux device control differences from one platform to another platform migration applications is quite complex. This paper analyzes the two operating systems equipment control principle, research from the schema to the various aspects of the system calls, the key comparison of the two differences. This article also gives a migration example (with c/c++), a detailed demonstration of the migration process. Work conditions: according to the purpose of writing this article, "Windows" refers to the Windows2000 or later version, and installed MicrosoftVisualC ++? 6.0 or its successor versions. Linux kernel version should be based on 2.6 and GNUGCC has been installed. Compare equipment control framework Windows and Linux device control is a different way. Windows device control framework Windows i/o subsystem user applications and device drivers, and define the infrastructure support for device drivers. Device driver for the specific device I/O interface (see Figure 1). Figure 1: Windows device control architecture in the equipment control, i/o package for IRP (I/O request packets). The i/o Manager creates the IRP, and send it to the top of the stack. Then, the device driver gets IRP stack address. IRP contains an I/O request parameters. Under the IRP contains requests (such as create, read, write, device i/o control, purge, or closed), the driver work through hardware interface. Linux device control architecture Linux device control architecture is different. The main difference is that Linux's normal files, directories, equipment and socket are files — Linux everything is a file. In order to access the device, the Linux kernel device operation calls through the file system is mapped to the device driver. Linux does not have the i/o Manager. All i/o requests from the beginning into the file system (see Figure 2). Figure 2.Linux device control architecture

No comments:

Post a Comment