1287 views|0 replies

1140

Posts

0

Resources
The OP
 

The problem of combining Arm and Linux [Copy link]

The definition of embedded system should be a special computer system that is application-centric, based on computer technology, with tailorable software and hardware, and adapts to the strict requirements of application systems on functions, reliability, cost, volume, and power consumption. For example, the current ATM cash machine is a typical RTOS. Embedded OS mainly includes two parts, one is the processor, such as Arm, POWERPC, MIPC, and the other is OS, such as Linux, wince, vxworks, us/os, etc. My main learning route now is arm+linux. I chose arm mainly because arm technology is relatively mature, and I chose linux because linux is open source and free. In addition, if you learn linux well, even if you don’t develop embedded systems in the future, you can also specialize in linux servers. To learn embedded Linux, there are four main things to do. The first is to write the bootloader and transplant it to the NAND flash. The second is to compile the kernel and download it to the NAND flash through the bootloader. The third is to establish a file system based on the NAND flash. The fourth is to download the written application to the target. The basic process is like this. It may be different when it comes to the development board. The following is the specific development process of Shenzhen Youlong Company's fs2410 as the target board, as well as the issues that should be paid attention to during development. The first step: Establishing a cross-compilation environment A: The application development environment based on the Linux operating system is generally composed of the target system hardware (development board) and the host PC. The target hardware development board is used to run the operating system and system application software. The kernel compilation of the operating system used by the target board, the development and debugging of the application program need to be completed through the host PC (so it is called cross compilation). The connection between the two parties is generally established through the serial port, parallel port or Ethernet interface. To install Linux OS, such as Redhao Linux 9.0, you can use the default installation (but it must include FTP service), connect the Linux server to the local area network, and other PCs can use Windows. The required software tools include. (1) FTP client program (2) Telnet tool (3) Linux operating system kernel source code ported to a specific ARM platform (4) GNU compilation tool, which can be downloaded from the relevant website (5) Install the FTP client program and Telnet tool on a workstation PC. Linux OS Kernel compilation generally has a relatively fixed step, which may vary slightly depending on the Makefile file. You can refer to the relevant documents. After the kernel is compiled according to the fixed steps, an executable binary file will be generated in the corresponding directory, which will be transferred to the PC via FTP and then downloaded to the development board via the serial port or network. B: (1) Create a compilation environment. In this process, some environment variables will be set, installation directories will be created, kernel source code and header files will be installed, etc. (2) Create binutils. After this process is completed, tools such as arm-linux-ld will be created. (3) Create a cross-compiled version of gcc. Note: In this process, only C programs can be compiled, but not C++ programs. (4) Create a cross-compiled version of glibc. This is where problems are most likely to occur. (5) Create a cross-compiled version of gdb. After this process is completed, arm-linux_gdb (6) Re-create gcc. The previous process of creating gcc did not compile the C++ compiler. Now glibc is ready, so this step will complete the cross-compilation of gcc. (7) Re-create glibc. If an error occurs during the cross-compilation process, please check: whether the version selection is correct and whether the corresponding patch is installed; whether the library file path is set correctly; whether the system environment variables are set correctly. Step 2: Write the bootloader and port it to the development board A: The bootloader is the first piece of code that runs after the system is powered on. The bootloader in an embedded system is equivalent to the BIOS in a PC. Most bootloaders contain two different operating modes. One is the bootloading mode. In this mode, the bootloader loads the operating system from a solid-state storage device on the target machine into RAM and runs it. The whole process does not involve the user. This mode is the normal working mode of the bootloader. The other is the downloading mode. In this mode, the bootloader on the target machine will download the kernel image and the root file system image from the development host to RAM through communication means such as serial port or network. Then it can be written to the solid-state storage medium on the target machine by the bootloader. B: Bootloader startup is usually divided into two stages. (1): Basic hardware initialization (shield all interrupts, close the processor's internal instruction/data cache, etc.). Prepare RAM space for the second stage. If it is from a solid-state storage medium, copy the second stage code of the bootlodaer to RAM. Set up the stack. Jump to the second stage C program entry point. (2): Initialize the hardware devices to be used in this stage. Check the system memory map. Read the kernel image and root file system image from flash to RAM. Set the boot parameters for the kernel and call the kernel

This post is from Microcontroller MCU
 

Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list