Method of Linux system transplantation based on ARM

Publisher:温馨时光Latest update time:2018-02-09 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Linux has the advantages of open source code, high efficiency, and scalability, and is widely used in the development of embedded systems. This article introduces the embedded Linux operating system, the transplantation target platform SBC2410, and the directory structure of the Linux kernel source code. It analyzes the implementation process of Linux transplantation to the SBC2410 platform, explains the Linux kernel, the cutting and compilation of u-boot, and the production process of the root file system, and finally successfully transplants the embedded Linux system on the SBC2410 platform.


    An embedded system is a special-purpose computer system. The system is based on computer technology, and the software and hardware can be tailored, but it has strict requirements on functions, reliability, and cost. Today, some special-purpose systems need to process a large amount of information. Since it is difficult for traditional computer systems to achieve hardware tailoring, they can no longer meet the needs of special-purpose systems. With the rapid development of my country's automobile, home appliance and other industries, the application and development of embedded systems has become a new hot spot in the current IT industry. The first problem to be solved in the development of ARM-based embedded systems is the porting of embedded operating systems. As a multi-tasking operating system with open source code and support for multiple processor structures, the Linux operating system has the advantages of small kernel, easy tailoring, and good portability. It is currently the mainstream operating system for the application and development of embedded systems. This paper mainly studies the implementation method of building an embedded Linux system on the ARM9 platform.

    1 Embedded Linux operating system and its characteristics

    Currently, in the development of embedded systems, 52% of projects choose Linux as the embedded operating system, which is inseparable from the excellent characteristics of Linux itself.

    The Linux operating system kernel source code is open and has rich software resources. Different application fields can modify the kernel as needed, and every general program can be found in Linux. You don't need to start from scratch when developing programs on Linux. You can choose a similar software for secondary development, so you can develop an embedded system that meets your needs at a low cost.

    In addition, the Linux system can support a variety of hardware devices, and has rich drivers, which can support a variety of mainstream hardware devices and the latest hardware technologies. With the widespread application of Linux, many chip manufacturers have also begun to provide drivers for Linux, which has laid the foundation for the application of Linux on various hardware platforms.

    Linux can support multiple architectures and has good portability. At present, Linux has been ported to most hardware platforms and can support multiple systems such as ARM, MIPS, LPHA, SPARC, etc. Linux supports almost all popular CPUs. Linux has a complete set of tool chains, which makes it easy to establish the development environment and cross-operation environment of embedded systems, and can overcome the obstacles of simulation tools in embedded system development. Because it complies with the IEEE POSIX.1 standard, the application has good portability.

    Linux has a complete network communication and file management mechanism. In fact, Linux has been inseparable from the network from the beginning, and the network is the most prominent feature of Linux. Linux has the characteristics of embedded Linux system transplantation on ARM9, which ensures that it supports all standard Internet protocols and can use Linux's network protocol stack to develop embedded TCP/IP network protocol stack. At the same time, Linux supports file systems such as ext2, fat16, fat32, romfs, etc., which lays a good foundation for embedded system application development.

    2 Linux porting on ARM platform

    2.1 Introduction to SBC2410 Hardware Platform

    The SBC2410 hardware platform is an embedded hardware platform based on the ARM9 processor SBC2410A, which can support ARM-Linux, Windows CE and other operating systems. The main hardware resources include a 64 MB SDRAM, a 64 MB NandFlash, a 1 MB Nor Flash, a serial port COM0, a USB Host A type interface, a USB Slave B type interface, and a standard JTAG interface.

    2.2 Preparation for Linux porting on ARM platform

    The first thing is to establish a cross-compilation environment. The cross-compilation environment is a comprehensive development environment composed of a compiler, a connector, and an interpreter. The cross-compilation tools mainly include the compiler gCC , the binary tool binutils, the standard C library glibc of the target system, and the Linux kernel header files of the target system. The host machine should select a Linux operating system for embedded development, and configure the network, NFS services, etc. Because the target machine does not have enough resources to run development tools and debugging tools, a cross-compilation environment must be established on the host machine, and then the cross-compilation tool will generate executable binary code (which cannot be run on the host machine), and then download it to the target board for debugging and running. The steps to generate a cross-compilation standard C environment include the following four steps:

    (1) Obtain the source code of binutils, gcc, and glibc;

    (2) Configure and compile binutils to obtain the assembler and connector;

    (3) Configure and compile the gcc source code to generate the gcc compiler;

    (4) Configure glibc to compile and generate glibc's C library functions.

    2.3 Bootloader transplantation

    The bootloader is closely related to the architecture. It is a small program that runs before the operating system kernel and application programs run, and is used to complete the startup and loading of the system. It is similar to the BIOS program in a PC. The bootloader is heavily dependent on hardware implementation, and it is generally impossible to build a universal bootloader in an embedded system. Users must write this small program by themselves to complete the initialization of hardware devices, establish a mapping of memory space, and bring the system's hardware and software to a suitable state to prepare for the operation of the operating system kernel.

    Usually bootloader transplantation is divided into two steps:

    The first step is to use assembly language to implement the code that depends on the CPU architecture. This mainly includes hardware device initialization; preparing RAM space for loading the bootloader; copying the bootloader to the RAM space; and setting up the stack.

    The second step is usually implemented in C language. That is: initialize the hardware devices to be used in this stage; check the system memory map; read the kernel image and the root file system image from the flash to the RAM space; set the startup parameters for the kernel; call the kernel. Figure 1 shows the workflow of the bootloader.

a.JPG

    2.4 Kernel transplantation

    Kernel transplantation should first start the operating system, complete memory management, task scheduling, process management, driver loading, network and other functions, and then execute the application or wait for user commands. Although there are complex scheduling relationships between the various functions, due to the characteristics of the Linux layered structure, the hardware-related codes have been separated out. Therefore, during the transplantation process, only the hardware-related codes in process management, memory management and device management need to be changed.

    Generally speaking, the kernel downloaded from the official website cannot be run directly on the hardware platform. Instead, the kernel must be re-cut and compiled according to the specific hardware platform, and the corresponding hardware-related code must be written according to the characteristics of the hardware platform to port Linux to the hardware platform. The modification of the kernel code includes the following parts:

    (1) Modify the Makefile at the root of the kernel directory tree, find ARCH and CROSS_COMPILE, change ARCH=arm, CROSS_COMPILE=armlinux, and then set the PATH environment variable. Add export PATH=/usr/ LOCal /arm/3.4.4/bin:$PATH to the bashrc file so that it can find the cross-compilation tool chain, and then log in again.

    (2) Set up the flash partition, modify arch/arm/machSBC2410/devs.c to specify the partition information, and the content of this file will establish the nand flash partition table; modify the arch/arm/machSBC2410/mach SMD k2410.c file to specify the initialization at startup, and perform initial configuration based on the partition settings when the kernel starts. In the Linux source file directory, execute the makemenuconfig command to configure the kernel to generate the config file, select the processor type as SBC2410, select the serial port driver device, and save the config file after completion.

    After completing the kernel trimming, execute the command make clean to clean the environment before compiling the kernel. You can also use makerealclean or makemrproper to completely remove related dependencies to ensure that there are no incorrect files. Finally, download zimage to the development board.

    3 Conclusion

    After transplantation, Uboot and Linux can run on the SBC2410 platform. On this basis, various drivers and application software can be further developed. Connect the SBC2410 and the PC with a serial cable, and you can see the success of the transplantation through the hyperterminal. After the system is successfully started, you can enter the root file system. This article analyzes the characteristics and transplantation methods of Linux, summarizes a method of Linux system transplantation based on ARM, and realizes the transplantation of the Linux system kernel on the SBC2410 processor platform.


Keywords:ARM Reference address:Method of Linux system transplantation based on ARM

Previous article:How to transplant μClinux to ARM7 system microprocessor S3C4510B
Next article:Design of CAN communication module based on μCOS-II

Recommended ReadingLatest update time:2024-11-16 14:46

Get ready for the IPO! Arm board brings in former Qualcomm and Intel executives
Arm, a chip design company owned by SoftBank Group, has added former Qualcomm CEO Paul Jacobs and former Intel executive Rose Schooler to its board of directors to prepare for its upcoming initial public offering. IPO) preparation. The two executives will help Arm prepare for the IPO by providing experience in develo
[Semiconductor design/manufacturing]
Composition of ARM image files
Composition of ARM image file The so-called ARM image file refers to the bin file burned into the ROM, also known as the image file. It is called the image file below. The image file contains RO and RW data. The reason why the image file does not contain ZI data is that ZI data is all 0, so it is unnecessary to includ
[Microcontroller]
Arm said artificial intelligence plays a vital role in promoting the advancement of automotive technology
As Arm prepares to refresh its automotive offerings, EENews sat down with Dennis Laudick, Arm’s Vice President of Automotive Marketing. In the interview, Laudick discussed in depth ARM’s strategic focus in the automotive field and the important role of artificial intelligence in promoting the advancement of automotive
[Automotive Electronics]
British chip giant ARM sets price, Masayoshi Son wins biggest listing deal of the year
On September 14, Beijing time, ARM, a British chip design company under SoftBank Group, has set the issue price of its initial public offering (IPO) at the upper limit of the issue price range, raising US$4.87 billion (approximately 35.4 billion yuan), becoming the largest company so far this year. It is the largest l
[Semiconductor design/manufacturing]
ARM9(S3C2440) UART
Data communication method The data communication methods are basically divided into: (1) Parallel communication: Multiple data lines transmit each bit of data in the same manner. Features: fast transmission speed, suitable for short-distance communication. (2) Serial communication: A data line transmits data o
[Microcontroller]
ARM register analysis
I have nothing to do during the winter vacation, so I plan to summarize my experience with ARM. Today I will start with the ARM registers. Everyone is welcome to give me some comments. Before introducing the arm registers, we need to understand the working mode of the arm processor: The ARM processor has seven oper
[Microcontroller]
ARM register analysis
ARM Programming Advanced 1-ARM Assembly Pseudo Instructions
So far, we have the ability to write relatively complex ARM assembly programs, but to write more complex and practical programs, we have to master the pseudo-instructions of ARM assembly. Do not confuse assembly pseudo-operations (directives) with assembly pseudo-instructions (pseudo-instructions). Directives will not
[Microcontroller]
Chinese LCD technology based on ARM7 microprocessor
1 Introduction Liquid crystal display LCD, as a display device with low power consumption, small size and no radiation, has been widely used in various embedded electronic products in recent years. LCD can be divided into segment type, character type and There are three types of dot matrix LCD. Among them, segment LCD
[Power Management]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号