Six steps to understand Linux driver engineers
Since many people always ask this question, here is a summary for your reference. It must be explained here that the following steps are for Linux systems and not for WinCE. Perhaps you will notice that among the people who are doing embedded, there are more people doing Linux research than those doing WinCE. Many of the information provided by the producers is mainly based on Linux. I have always had a hard time understanding. In fact, the interface of WinCE is much better than the interface of Linux. It is also very convenient to use. More importantly, the development of WinCE is basically the same as the development under Windows. It is much simpler to learn, but learn Linux. Or people who use linux to do embedded are far more than WinCE. When I talked to a lot of people, I learned that their company never considered using WinCE, because the cost is high, they are all developed using linux. I have not used WinCE in my graduate school. Most of them use linux. There are also a few projects that use vxwork, but I have never heard of using WinCE. The reason is open source! Of course, WinCE6.0 is also open source, but in On the cost and resources, Linux has an advantage that no one can stop. Correspondingly, more and more electronics manufacturers have begun to use Linux to develop products. Learn basic bare metal programming For those who are learning hardware, they must first have a perceptual understanding of the basic use of hardware. They must also have a deep understanding of the control method of the hardware. If you learn Linux at the beginning and learn to transplant, you will only get into a deep one immediately. swirl. When I first started learning ARM, I chose ARM7 (the idea was that ARM9 was still very expensive at the time). When I was learning ARM7, I still kept the idea of ​​learning 51 MCUs. I used ADS to program. The first experiment was to control led. People who have studied ARM for a while will laugh so stupid, in fact, it is not, I think this process will be much better, because no matter how complicated the system will eventually implement these bottom-level hardware controls, so these hardware The control has a lot of perceptual knowledge. It is much better to understand the hardware architecture and control principles while learning the bare metal programming. I call him the hardware. The so-called understanding of hardware means to understand how this hardware organizes so many resources, and how these resources are controlled by cpu and by programming. For example, there are AD converters in s3c2410, GPIO (general IO port), and nandflash controller. These things have some registers to control. These registers have an address. What do these addresses mean? How do you pass? Registers to control the operation of these peripherals? Also, each unit inside norflash has a corresponding address unit in the memory of the chip, so what is the relationship between these addresses and the register address just mentioned? They are the same The nandflash internal storage unit corresponding to norflash is not linearly discharged, so how does s3c2410 map the nandflash address to the memory space? Or how to use nandflash simply? Furthermore, when using ADS to program ARM9 lines, you need to use an initialized assembly file. What is the use of this file? What does the code inside him mean? Don't you want this? Anything is an understanding of the hardware, understanding These things have a deep understanding of the hardware, which will be of great help for further study in the future. If you skip this step, I believe that the more you learn, the more you will feel confused, the more you feel that this is deep. Untestable. Because your foundation is not well. But first declare, I did not use ADS to program ARM9, I just used ARM9 to learn Linux system after learning ARM7, so it is difficult to answer the problem of programming with ARM using ADS ^_^, go to yourself Research and study. For this part, a tutorial will be provided shortly. The routines in this tutorial are not written by the board I have represented for you. I took it in our college lab, and Ying Peit wrote for their own experiment box. However, it is very useful and can be used as a valuable reference. Do some basic experiments using the linux system When you buy a set of boards, you will usually provide some linux test routines. Do this for a while. This process is also very meaningful. It is also a sensible understanding for further learning. You can imagine a Linux that has never been used. Can the system people learn Linux programming well? Follow the routines in the manual to do the experiment inside. Although a little doll learns to walk, it is a little mentally handicapped, but I think many masters will go through this process. Study the running process of a complete Linux system What are the parts of the so-called complete Linux system? Part 3: bootloader, linux kernel (linux kernel), rootfile (root file system). So how do these three parts work together to form this system? What is the use of each? What are the connections between the three? How to contact? What is the implementation process of the system? Find out the problem for your entire system. The operation is very clear, and it lays another important foundation for the next step of making this Linux system. Introduce this information on the Internet can be tapped to a few tons, and study it yourself. Start doing system migration As mentioned above, there are 3 parts of the complete Linux, and you also know the relationship and role between them, then now you have to do it yourself to learn to make these things. Of course I can't ask you to write this code, which is not implemented. In fact, all three of them can download the corresponding source code on the network, but this source code cannot be downloaded and compiled and can run on your system. It needs a lot of modifications until he can run on your board. The process of modification is called transplant. In the process of transplanting, you have to learn a lot of things, and you need to know a lot of relevant knowledge. When you complete this process, you will find that you are already a fledgling master. In the process, if you are very research-oriented, you will definitely think of looking at the source code. Many books show you how to read the Linux source code. I don't advocate to look at the Linux source code without a destination. In the words of Xu Sanduo, this makes no sense. When you are doing the transplant, you think you have to look at the source code and look for a few good books. Here I recommend a good book Ni Jili's "Analysis and Programming of Linux Kernel", which is a book for Linux. -2.6.11 kernel book, said very deep, it is recommended to first improve their C language programming level to see. As for the transplant network on each part, you can find a lot of information and research it yourself. However, it should be reminded that many things that introduce your own experience are more or less reserved. You always do what he says. Some questions, but he won't tell you how to solve it. At this time, you have to rely on yourself. If you can't rely on it, just look for me to study and research. I can't guarantee that you can solve your problem, because I may not have encountered your problem. , but I believe I can give you some advice, maybe it will help you solve the problem. The ultimate goal of this step is to download the standard source code package from the official home page of the source code (both foreign, sad), then modify it and finally run it on the board. The words of stealing Archimedes: "Give me a network cable, I can get Linux." Study the writing of Linux drivers The migration system is not the ultimate goal. The ultimate goal is to develop products and projects, and these must be developed. Linux drivers can be said to be varied, linux2.4 and linux2.6 are written quite differently, that is, the same as linux2.6 but the drivers between different versions are also different, so the driver for writing linux is not so Easy things, there is not even enough reference material for the latest version of the driver. Then my suggestion is to use and port a version of the kernel that is not very new, so that there is enough information for learning-driven programming. Research application writing In addition to writing drivers, the final project is to write an application. The current trend is the development of graphics applications, and the most used in graphics applications is the qt/e library. I have been using this library to develop my own applications, but I hope you can use the domestic MiniGUI library. The advertising slogan of Jay Chou is "support domestic, support MiniGUI". MiniGUI programming is similar to VC programming under Windows, it is easier to get started, the effect should be said to be quite good, I have used to develop ARM7 programs. However, the biggest disadvantage of MiniGUI is that there is no graphical operation platform like qtopia, which greatly limits his promotion. I once imagined to cooperate with Beijing Feiman Company (the copyright owner of MiniGUI) to develop such a function like qtopia using MiniGUI function library. The graphics operation platform, but because of the limited level, this can only be a fantasy, hehe. After completing this step, you have basically finished the entire contents of embedded linux. There is also a little experience to share with you. I rarely ask people in the process of learning embedded Linux. The objective reason is that the teachers and classmates around me do not have masters in this area. The subjective reason is that I don't like to ask people and like to study and solve problems. This has the advantage of improving your ability to solve problems, because there are always many problems in doing these things that you can't understand. Others don't have experience in this area, and not all questions are answered by you. You must be yourself. Solving problems, in this way, the ability of individuals to solve problems is very critical. Therefore, my suggestion is to search the Internet for general questions. If you really can't find the answer, ask the master, or you can't do it yourself. Don't wait for someone else to help you solve the problem. Remember, the problem is the best chance to learn. The worlds smartest and most innovative new pod system, seamlessly combines style with functionality to create a smart and usable device! Combine your VOOM with a portable charging case to never run out of power on the go! VOOM Vape,600puffs vape,mini vape Shenzhen Kester Technology Co., Ltd , https://www.kesterpuff.com