Embedded system learning (arm + linux) Experience-general Linux technology-Linux programming and kernel information. The following is a detailed description. I have been reading tutorials on Embedded Systems recently, including arm and linux. Although I have read a lot of tutorials, I have not practiced any other aspects except linux, however, the general process can still come down. I am tired of reading books recently, so I wrote my recent study notes and experiences. The next step is to buy an arm9-development board for learning.
I think the definition of embedded systems should be application-centered, computer technology-based, software and hardware can be tailored to the application system's strict requirements on functions, reliability, cost, volume, and power consumption. computer system. For example, an ATM is a typical RTOS. embedded OS consists of two parts: a processor, such as ARM, POWERPC, MIPC, and an OS, such as linux, wince, and vxworks, us/OS, etc. I am studying arm + linux mainly because arm technology is mature. linux is an open-source and free-of-charge tool, in addition, if you have learned how to develop an embedded system for linux in the future, it can also be used exclusively for linux servers.
To learn about Embedded linux, we mainly focus on four points: Writing bootloader and porting it to nand flash. Second, compile the kernel and download it to nand flash through bootloader. Third, create a file system based on nand flash. Fourth, download the written application to the target. The basic process is like this, but it may be different when it comes to the Development Board. Below we will take the fs2410 of Shenzhen youlong Company as the target board for the specific development process described above, and issues that should be paid attention to during development.
Step 1: create 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 and application development and debugging of the operating system used by the target Board need to be completed through the host PC (therefore called cross-compilation ). Generally, the two parties establish a connection through a serial port, a parallel port, or an Ethernet interface. Install linux OS, such as redhao linux 9.0, which can be installed by default (but must contain the ftp service) to connect the linux server to the LAN. Other PCs can use windows. The required software tools include
(1) ftp Client Program (2) telnet tool (3) linux operating system kernel source code transplanted to a specific arm platform (4) gnu compilation tool, which can be downloaded by related websites
Install the ftp client program and telnet tool on a pc of a workstation. the compiling of linux OS kernel is usually fixed and varies slightly according to the Makefiel file, refer to the relevant documentation. After the kernel is compiled in fixed steps, executable binary files will be generated in the corresponding directory and uploaded to the PC through ftp, download to the Development Board through the serial port or network.
B: (1) create a compiling environment. In this process, some environment variables will be set, the installation directory will be created, and the kernel source code and header files will be installed.
(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, rather than c ++ programs.
(4) create a cross-compiled version of glibc, which is the most likely to cause problems.
(5) create a cross-compiled version of gdb. After this process ends, a arm-linux_gdb is created
(6) recreate gcc. The c ++ compiler was not compiled during the previous gcc creation process. Now glibc is ready, so this step will improve the cross-Compilation of gcc.
(7) recreate glibc.
If an error occurs during the cross-compilation process, check the following:
Check whether the version is correct and whether the patch is installed;
Whether the library file path is set correctly;
Whether the system environment variables are set correctly.
Step 2: Write bootloader and port it to the Development Board
A: bootloader is the first code to run after the system is powered on. The bootloader in the embedded system is equivalent to the bios in the PC. Most bootloaders have two different operation modes. One is the bootloading mode. In this mode, bootloader loads the operating system to RAM from a solid state storage device on the target machine, and the whole process is not involved by the user. This mode is the normal working mode of bootloader and the downloading mode. In this mode, the bootloader on the target machine downloads the kernel image and the root file system image from the Development host (host) through serial port or network communication means and waits in RAM. Then, bootloader can be written to the solid-state storage media on the target machine.
B: Most bootloader starts in two stages.
(1): basic hardware initialization (blocking all interruptions, disabling internal processor commands/data cache, etc ).
Prepare a RAM space for Stage 2
If it is from a solid-state storage medium, copy the second-stage code of bootlodaer to RAM.
Set the stack.
Jump to the C program entry point in the second stage.
(2): Initialize the hardware devices to be used in this phase.
Check the system memory ing.
Read the kernel image and root file system image from flash to RAM.
Set startup parameters for the kernel
Call the kernel.
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