The target platform AT91SAM9G20 used in this article is a SoC embedded microprocessor developed by Atmel using the ARM926EJ-S processor core, clocked at 400MHz, with Atmel's advanced peripheral DMA and distributed memory architecture, along with a 6-layer bus matrix. Simultaneous transfer of multiple data between memory, peripherals, and external interfaces is achieved without CPU clock cycles. Compared to the pin-compatible 200 MHz AT91SAM9260, the AT91SAM9G20 provides up to 4x cache and on-chip SRAM memory with enhanced external NAND flash error correction and a larger Ethernet FIFO to reduce transmission latency. Its external bus interface (EBI) has a clock frequency of 133 MHz for high-speed data transfer from off-chip memory. These features allow developers to port operating systems such as Windows CE and Linux to target systems based on this microprocessor.
The operating system is also an important part of the embedded system. Today's embedded operating systems are various, including VxWorks, QNX, Palm OS, Windows CE, Linux, uClinux, ucos ii, etc. Each operating system has its own unique features. For Linux. Wide open source Linux applications have been ported to the embedded runtime environment, and can be easily tailored and modified to be ported to their own hardware platforms. Therefore, using Linux to develop embedded operating systems can speed up the development of embedded systems. Speed, shorten the time the product enters the market.
The work of this paper mainly includes three parts: Boot loader implementation, Linux kernel porting and file system implementation.
Building a cross development environment
Before porting the operating system, first set up a development environment on a PC with Linux. For example, our host is Ubuntu10.04. To obtain all operation rights, log in to the host Linux system as root. Create the arm path in the usr/local/ directory, download the cross-compiler tool arm-linux-gcc-4.3.2.tgz, copy it to the folder /usr/local/arm/, and decompress it; Environment variable, set the default cross-compiler tool to arm-linux-gcc-4.3.2. Open the /root/.bashrc file with an editing tool under Linux (such as vim) and add the following code at the end of the file:
If
[ -d /usr/local/arm ] ;
Then PATH=/usr/local/arm/4.3.2/bin:"${PATH}"
Fi
At this point, the cross-compilation tool is built. To verify whether the cross-compilation tool is successfully built, you can enter the command arm-linux-gcc -v in the terminal. After the build is successful, the arm-linux-gcc version will be displayed under the terminal. Note that the user must be logged out and the settings will not take effect until you log back in to the system.
Boot program
After the system is powered up, a program is needed to initialize: turn off the watchdog, change the system clock, initialize the memory controller, and copy more code into memory. This program is called the boot loader. In short, the Boot loader starts execution after the system is powered on, initializes the hardware device, prepares the software environment, and finally calls the operating system kernel. The implementation of the boot loader relies heavily on the specific hardware. In the embedded system, the hardware configuration varies widely. Even the same CPU has different peripheral resources, so it needs to be transplanted according to specific hardware.
The Boot Loader contains two different modes of operation: boot load mode and download mode. After power-on, the Boot loader loads the operating system into RAM from a solid-state storage device on the board. The entire process is not used by the user and is generally used for the final product. In the download mode, it is used during the development process. Developers can use various commands to download files (such as kernel images and file system images) from the host through serial or network communication, and put them directly into memory or burn them. Flash class solid state storage device.
In order to implement the embedded operating system on the AT91SAM9G20, the AT91SAM9G20 adopts a three-level boot mode. The Boot Loader program consists of three parts, namely RomBoot, Bootstrap and U-Boot. The process of the three-level bootloader is shown in Figure 1. .
Figure 1: Flow chart of the three-level bootloader
The first level boot program Romboot is solidified inside the AT9lSAM9G20. After booting or resetting, the boot code is run first. The function is to load the external FLASH bootloader Bootstrap into the SRAM inside the CPU. The Bootstrap is stored in the first 4KB of the external FLASH. Its functions include initializing the clock, SDRAM controller, and DEBUG serial port hardware resources, and loading the third-level bootloader U-Boot from FLASH to SDRAM. U-Boot boots and loads the embedded Linux operating system from FLASH into SDRAM and gives control of the CPU to Linux.
The U-boot version used for this migration is 1.3.4. Due to space limitations, this article does not provide a detailed introduction.
Kernel clipping compilation
Preparation work
Download the Linux kernel source linux-2.6.30.tar.bz2 from the Linux official website, and download the patch file for at91sam9g20 from Atmel's official website (2.6.30-at91.patch.gz and 2.6.30-at91-exp.3.tar.gz ). In the host Linux development environment, create your own working directory, for example, the working directory is home/work/, copy the above three files to the working directory, extract Linux2.6.30, and 2.6.30-at91.patch.gz Copy 2.6.30-at91-exp.3.tar.gz to the Linux2.6.30 root directory and unzip 2.6.30-at91-exp.3.tar.gz. This part of the work is completed as shown in Figure 2.
Figure 2: Preparation is complete
2.00MM VDSL Cable Connector.SCSI Connector Series.
2.00MM VDSL Cable Connector
ShenZhen Antenk Electronics Co,Ltd , https://www.antenkcon.com