[Original] driver of the summary series on the wince OS development interview

Source: Internet
Author: User

Today, I would like to give a brief summary of the problems encountered during the interview. It is also a basic knowledge that is often used, so I still need to pay attention to them. The other is some of the other topics involved in the driver. For example, the most important one is power management. Power Management is also being studied recently, but it has never been developed before, in a recent post on hjb, I also briefly introduced the knowledge of power management. Here I also come up with a picture. Of course I can't do the written test during the interview, but I will ask about it during the interview, at least I have met. Of course, there are also complex drivers such as display drivers, which may be asked in detail during interviews with specialized development posts. Due to the limited space, we will only summarize and propose some basic communication driver issues, and also talk about power management here.

Bytes -------------------------------------------------------------------------------------------

Q1: DriverProgramWhy is it used?
A1: the driver is a functional software that abstracts physical devices or virtual devices. The driver manages the operations of these devices;

Q2: what types of drivers are there?
A2: It is generally divided into built-in drivers and installable drivers, hierarchical and non-hierarchical drivers, and local and streaming drivers; (here the layering and non-layering drivers are MDD and PDD's previousArticleThis concept has been described in, so I will not talk about it here. Please refer to the content in the previous article)

Q3: What are the characteristics of local drivers and drain drivers?
A3: local drivers use special interfaces in wince, so these interfaces are customized. Microsoft also has special rules for each local device, so it is similar to creating a driver locally, so it is called a local driver. For example, a common example shows that the driver is a local driver. Among the reference instances provided by Pb, the local driver instances include: display driver, keyboard driver, touchpad driver, and Indicator LED driver. From these drivers, it is not difficult to see that the system will always be in the running state, from the system to the power loss or reset will be in the continuous working state.
streaming drivers are also relative to local drivers. Streaming drivers usually have fixed stream interfaces, which are usually used in combination with file system APIs, these drivers have fixed interfaces and application-layer program links, that is, some fixed file API functions such as readfile, writefiel, createfile, and deviceiocontrol.

Q4: a brief description of the driver development process. How is the self-compiled driver loaded into the wince system?
A4: First, we analyze the hardware features of the development object. After the analysis, we need to create a directory for our driver under the driver directory under the BSP package, and include it in the Dir in the driver file directory, then, we can develop and compile the Program Code under the newly created driver directory, including the driver program and the source file, the MAKEFILE file and driver are determined by the development object. The source file determines the name of The dll library generated by the driver, and the name of the library to be referenced in the driver, the name of the included source program file, as well as some compilation conditions, such as the file generation type and DLL function entry. After completing the above work, you can try to build the directory, if there is no program error, a DLL file will be generated, then we can go to platform. reg and platform. this driver is loaded in the bib file. The reg file mainly describes the characteristics of the driver. If it is a stream driver, it is generally created in the buil. In the din registry path, it also refers to the name of the dll library called, as well as its abbreviated name and index information. To manage the power of the driver, you also need to add the iclass key value, in the bib file, you need to add the DLL file path in the file segment so that the DLL can be added when the image is compiled and generated. Here, the basic development of a driver is basically completed. When the system starts, the system automatically loads the devices contained in the image. For a stream driver, after the system starts, it first executes the xxx_init file to load the devices to the system, you can open the device through createfile. The device will execute xxx_open to open the device. when the device is closed, the driver will execute xxx_close to close the device, when you need to consider power management, xxx_powerup and xxx_powerdown are two important interfaces. When the system returns to normal state from suspension state, the system will execute xxx_powerup, and the system enters the suspension state, xxx_pwerdown is executed. In these two functions, you can enable or disable the power supply of the device to control the power supply and manage the power supply.

Q5: What is DMA?
A5: DMA is short for Direct Memory Access. without the help of the CPU, there is one way to move data from the device to the memory or from the memory to the device. DMA can be implemented in two ways, the first is to use the ceddk function, and the other is to use the kernel function. We recommend that you use the ceddk function.

Q6: How is the power management of the next driver developed and implemented?
A6: 1. First, add power management components to the custom system. Generally, you only need to add them to the catalog. 2. Add power management functions to the existing driver. For streaming drivers, the relevant message processing section of power management is added to the deviceiocontrol section. That is to say, the flow driver is mainly used in xxx_iocontrol to implement ioctl_power_capabilities, ioctl_power_query, ioctl_power_set, and ioctl_power. The built-in driver, for example, the display driver, needs to directly call the advertiseinterface function. In addition, for the stream drive, the above problem also mentioned the need to add an iclass to declare that the device needs power management. 3. the application layer function is used to manage and control the power supply of devices. It is used to call the power management API in applications to help the system manage the working status of each device and the entire system.

For more information, see hjb-We blog http://www.cnblogs.com/we-hjb/archive/2010/01/27/1657973.html.

Q7: Brief description of I2C Protocol
Q7: the I2C protocol is a two-line protocol developed by Philips. There are three types of signals in the I2C bus during data transmission: start signal, end signal, and response signal.
Start signal: in high-power mode, SDA switches from high level to low level to start transmitting data.
End signal: When the SCL is low, the SDA is switched from low to high and the data is transmitted.
Response signal: After receiving 8-bit data, the IC that receives the data sends a specific low-level pulse to the IC that sends the data, indicating that the data has been received. After the CPU sends a signal to the controlled unit, it waits for the controlled unit to send a response signal. After the CPU receives the response signal, it determines whether to continue to transmit the signal based on the actual situation. If no response signal is received, it is determined that the controlled unit has a fault.
I2C is divided into two types of read/write operations. There are three basic read operations: Current address read, random read, and sequential read. It should be noted that the 9th clock cycles of the last read operation are not "irrelevant ". To end the read operation, the host must issue a stop condition between 9th cycles or maintain SDA as high within 9th clock cycles, and then issue a stop condition. Write operations are divided into two types: byte write and page write. page write operations vary depending on the bytes loaded at a time on the chip.

 

The above are some general questions, all of which are still relatively standard answers. The following questions may need your own consideration. Some of them have many answers for different platforms, some of them are too complicated. It's basically the same as things of the dark. You can think about the language in your organization, so I won't give them a here, because some of me are not very clear about how to answer questions to satisfy the examiner. In short, I once interviewed the examiner for more than an hour, from the driver to the AP, all the questions I can ask have been asked. It's really silly to find myself at the bottom, and I still need to study hard;

Q8: What is dircetdraw?
PS. What did the examiner directly ask at that time? Have you used dircetdraw? Let's talk about it. You can find the answer for a long time.

Q9: describes the process of system sleep. How does the system perform this operation?
PS. this problem is generally combined with the platform you have operated on, but it is generally similar. There is a gpio that generates a signal such as interruption, and the system will execute a series of sleep actions in the future, for example, shut down some power supply, operate the powerdown device in the stream drive, execute some assembly commands to shut down the clock, retain the 32.768khz clock, how to control the memory, how to control flash, you can simply repeat these steps based on your actual platform.

Q10: describes the features of an IC driver you have developed.
PS. Just tell the truth.

Q11: What do you do if you want to transmit data between two drivers?
PS. I am dealing with two drivers through an AP program, and controlling data transmission between two devices through a process mutex mechanism, that is, applying for a memory space through the AP, the two devices share mutually exclusive data. The AP controls the conditions for the two devices to obtain data, and controls the reading and writing of the device, in fact, I actually operated on Two IC drivers and communicated with each other to transmit data. In the middle, I also used an interrupt to control data reading and writing, if one interrupt is used, the data will not be crashed or exclusive. One Party sends the data to the memory to interrupt the data, and the other party reads the memory after the interruption, so that the data is mutually exclusive. You can also consider other methods. I need to interrupt the hardware and have requirements for the hardware;

Q12: What is MLC?
PS. At first I really didn't know what MLC was. Then I went home and checked it to find out that it was a type of flash. I didn't even know it. Do not pretend to understand it. You can do it after you have checked it. However, I do not know much about this. I have seen some discussions on csdn, but the specific situation is unknown;

 

The conclusion is as follows. You are welcome to continue the discussion and add some new interview examples for sharing. Haha. Wish you a happy New Year. In the coming year, my career will grow steadily!

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.