You may have noticed that among those working in embedded systems, there are far more people researching Linux than those focusing on WinCE. Much of the documentation provided by manufacturers also centers around Linux. I have always found it difficult to understand this trend, as the interface of WinCE is much more visually appealing and user-friendly than that of Linux. More importantly, development on WinCE is quite similar to development under Windows, making it much easier to learn. However, there are significantly more people learning Linux or using Linux for embedded systems than those using WinCE. From conversations with many professionals, I have learned that their companies have never considered using WinCE due to its high costs, preferring to develop with Linux instead. In my graduate lab, we do not use WinCE; most research focuses on Linux, with a few projects utilizing VxWorks, but I have never heard of anyone using WinCE, primarily due to its open-source nature! Of course, WinCE 6.0 is rumored to be open-source now, but in terms of cost and resources, Linux has an unbeatable advantage. Correspondingly, more and more electronic manufacturers are beginning to develop products using Linux. For example, the Android operating system developed by Google is actually an improvement based on the Linux 2.6.23 kernel.First, Learn Basic Bare-Metal ProgrammingFor those studying hardware, it is essential to have a practical understanding of basic hardware usage methods, and a deep comprehension of how to control that hardware. If you start by learning the Linux system or how to port it, you will quickly find yourself in a deep vortex. When I first began learning ARM, I chose ARM7 (mainly because ARM9 was still quite expensive at the time). While learning ARM7, I maintained the mindset of studying the 51 microcontroller and used ADS for programming. My first experiment was controlling an LED. Anyone who has studied ARM for a while would laugh at how naive this seems, but I actually believe this process is quite beneficial. Regardless of how complex a system becomes, it ultimately boils down to controlling the underlying hardware. Therefore, having a practical understanding of hardware control is crucial. While learning bare-metal programming, it is important to thoroughly understand the architecture and control principles of the hardware, which I refer to as understanding hardware.Understanding hardware means comprehending how this hardware organizes its resources and how those resources are controlled by the CPU and programming. For instance, in the S3C2410, there are ADC converters, GPIO (General Purpose Input/Output), and NAND flash controllers, all of which have registers for control. Each of these registers has an address; what do these addresses mean? How do we control these peripheral devices through the registers? Additionally, each unit within NOR flash has a corresponding address in the chip’s memory. How do these addresses relate to the previously mentioned register addresses? Are they the same? Furthermore, the storage units within NAND flash are not linearly arranged. How does the S3C2410 map the NAND flash addresses in memory space for use? In simpler terms, how should we utilize NAND flash? Moreover, when programming ARM9 using ADS, an initialization assembly file is required. What is the purpose of this file? What does the code within it mean? Can we do without it?These are all aspects of understanding hardware. Gaining insight into these elements will lead to a deeper understanding of hardware, which will greatly assist in further studies. If you skip this step, I believe you will find yourself increasingly confused as you progress, feeling as though these concepts are unfathomable because your foundation is not solid.However, I must clarify that I have not programmed ARM9 using ADS; I transitioned directly to learning the Linux system after completing ARM7, making it difficult for me to answer questions regarding programming ARM9 with ADS. ^_^ I will soon provide a tutorial for this section. The examples in this tutorial are not written for the boards we represent but are taken from our college laboratory, written by Yingpeite for their own experimental kit. However, they are quite valuable as a reference.Second, Conduct Basic Experiments Using the Linux SystemWhen purchasing a development board, it generally comes with some Linux experiment examples. Spend some time working through these; this process is very meaningful and helps to build practical knowledge. Can you imagine someone who has never used a Linux system learning to program in Linux? Follow the examples in the manual and conduct the experiments. While it may feel a bit like a toddler learning to walk, many experts have gone through this process.Currently, our company, Deep Blue Technology, has no plans to provide corresponding examples as the development board suppliers offer a wealth of examples. We do not want to duplicate efforts but instead provide the most valuable content that they do not cover.Third, Study the Complete Operation Process of the Linux SystemWhat does a complete Linux system consist of?Three parts: bootloader, Linux kernel, and root filesystem.How do these three components collaborate to form the system? What is the role of each? What connections exist among them? What is the execution flow of the system? Understanding these questions will clarify the operation of the entire system and lay another important foundation for creating this Linux system. You can find tons of resources online regarding this topic; do some research.Fourth, Start System PortingAs mentioned, a complete Linux system has three parts, and you now understand their relationships and functions. Your next task is to learn how to create these components yourself.Of course, I cannot ask you to write all this code; that is not feasible. In fact, you can download the corresponding source code for all three components online, but this source code cannot simply be downloaded and compiled to run on your system. It requires many modifications until it can operate on your board. This modification process is known as porting. During the porting process, you will learn a lot and need to understand various related knowledge. Once you complete this process, you will find yourself emerging as a novice expert.If you have a strong research spirit, you will inevitably want to look at the source code. Many books explain how to read the Linux source code, but I do not advocate aimlessly browsing through it. As Xu Sanduo would say, this is meaningless. Only when you feel the need to look at the source code during the porting process should you find good books to reference. I recommend a great book, “Analysis and Programming of the Linux Kernel” by Ni Jili, which focuses on the Linux 2.6.11 kernel and delves deeply into the topic. It is advisable to improve your C programming skills before tackling this book.As for porting each component, you can find plenty of materials online to study. However, be aware that many of the personal experience accounts contain some reservations. Following their instructions may lead to issues they do not explain how to resolve. At that point, you must rely on yourself. If you cannot figure it out, feel free to seek my help, though I cannot guarantee I will have encountered your specific problem. However, I believe I can offer some advice that may help you find a solution.The ultimate goal of this step is to download the standard source code package from the official homepage (which is always foreign, unfortunately), modify it, and ultimately run it on your board.To quote Archimedes: “Give me a network cable, and I can conquer Linux.”Fifth, Study Writing Linux Device DriversPorting the system is not the final goal; the ultimate aim is to develop products and projects, which all require driver development.Linux device drivers can be quite varied, and there are significant differences between writing for Linux 2.4 and Linux 2.6. Even among different versions of Linux 2.6, there are distinctions in driver development, making it a challenging endeavor. For the latest version of driver development, there is often insufficient reference material available. My suggestion is to use and port an older kernel version, as this will provide ample resources for learning driver programming.Sixth, Study Writing Application ProgramsIn addition to developing drivers, you also need to write application programs for your projects. The current trend is in developing graphical applications, with the Qt/E library being the most commonly used. I have consistently used this library to develop my applications, but I hope you will utilize the domestic MiniGUI library. To borrow a phrase from Jay Chou’s advertisement, “Support domestic, support MiniGUI.” MiniGUI programming is quite similar to VC programming under Windows, making it relatively easy to get started, and the results are quite impressive. I have previously used it to develop programs for ARM7. However, MiniGUI’s biggest drawback is that it lacks a graphical operating platform like Qtopia, which greatly limits its promotion. I once fantasized about collaborating with Beijing Feiman Company (the copyright holder of MiniGUI) to develop a graphical operating platform like Qtopia using the MiniGUI library, but due to my limited skills, that remains a fantasy, haha.By completing this step, you will have essentially learned all there is to know about embedded Linux.Additionally, I would like to share a small piece of advice. During my journey in learning embedded Linux, I rarely asked others for help. The objective reason was that there were no experts around me, and the subjective reason was that I prefer to solve problems independently. This approach has the advantage of enhancing my problem-solving skills because many issues are challenging to understand, and not everyone has experience to provide answers. At such times, it is crucial to solve problems independently, making personal problem-solving capabilities extremely important. Therefore, my suggestion is to search online for common issues. If you truly cannot find answers, consult an expert; if that fails, conduct your own research. Do not wait passively for others to solve your problems.Remember, problems are the best opportunities for learning.
Recommended to follow 👇 the public account below to learn more about electronic technology knowledge!