To create an embedded Linux hardware and software development environment

xiaoxiao2021-03-06  40

To create an embedded Linux hardware and software development environment

To create an embedded Linux hardware-hardware development environment Linux and Uclinux in August 1991, a student in Finland posted the following paragraphs in the Comp.os.minix newsgroup: Hello people using Minix - I am 386 ( 486) AT is a free operating system (just to hobbily, it will not be very professional as GNU. This student is Linus Torvalds, and what he said will become Linux we know today. Due to Linux The source code is published on the Internet, which can be obtained for free, and therefore, from the beginning, it attracts a lot of drivers and application software to Linux from all over the world. In just a few years, Linux has become a quite perfect. The hardware platform supported by Linux is the most in all operating systems. Currently Linux support hardware platform: Intel's IA64, Compaq Alpha, Sun SPARC / SPARC64, SGI MIPS, IBM S396, ARM, PowerPC, etc. The greater impact is that it is gradually applied to embedded devices. Uclinux is produced in this atmosphere. Muclinux is Micro-Control-Linux, which is also an open source project, UClinux source code and development Tools can be downloaded from http://www.uclinux.org. Muclinux is the following characteristics compared to the mainstream Linux for embedded processors without MMU (memory management unit), and mainstream Linux: 1. Simplify the kernel load method, UCLinux can run directly on Flash: It is to write the executive image of UCLinux's kernel to flash, and the system starts to execute from flash in the system; Loading into memory: Store the compressed file of the kernel in Flash, read the compressed file when the system is started, then decompressed in memory, and then start executing .2. Using the ROMFS file system as a root file system: This file system is relatively The general EXT2 file system requires fewer space, first-core support ROMFS file system than supports EXT2 file system requires less code, secondly ROMFS file system relatively simple, establishing a file system Superblock requires less storage space. ROMFS file system Support dynamic erasing, for the system that requires dynamically saved data using the RAM disk method, the RAM disk uses an EXT2 file system. 3. Using the FLAT executable format: ELF format has a large file header, Flat file Simplified with some segment information. 4. Rewind the application library: UCLIBC Libc is a streamlined, UCLinux uses a static connection to the user program. Uclinux development environment www.uclinux.org provides the GNU cross-compiler for Uclinux, including the following components: GCC cross-compiler, which develops two-creditable binary on the host, Binutils aid, including Objdump, AS, LD, etc .; GDB debugger. Develop UCLinux on ARM7 as an example: 1. Get the source code package of uclinux-dist of www.uclinux.org, regularly introduce the corresponding source package for the new Linux kernel, the latest version is kernel-2.4.21, can be from http://www.uclinux.org/pub / UCLINUX / DIST / download is available for free. This source package contains UCLinux-2.4.21, Uclibc, and user applications that have been ported to UCLinux.

After download, you will get a UCLinux-Dist-20030522.tar.gz file, save it to the / home directory, then execute: tar zxvf uclinux-dist-20030522.tar.gz, after the TAR program is running, In the / home directory, there will be a new directory of / home / uclinux-delin, which is the source root of Uclinux, with all source code developed by UCLinux. 2. Get ARM development tools, www.uclinux.org provides the UCLinux source, while also providing the corresponding cross-compilation tool. To compile Uclinux for the ARM7 target system on the development host, you need to download the ARM cross compiler from http://www.uclinux.org/pub/uclinux/arm-elf-tools/: ARM-ELF-TOOLS-20030314. SH. After getting this file, perform the following command: sh am-elf-tools-20030314.sh, this command will automatically establish a cross-compilation environment of UCLinux-ARM on the development host. Type ARM-ELF- GCC, if you can see the following output information: Reading Specs from /usr/local/lib/gcc-lib/arm-elf/2.95.3/specsgcc version 2.95.3 20010315 (ColdFire Patches) - 20010318 from http://fiddes.net/coldfire/)(uClinux Xip and shared lib patchesfrom http://www.snapgear.com/) indicates that the cross-compilation environment of UClinux-ARM has been established. Now there is already a UCLinux source code and the tool for compiling these source code. You can also compile UCLinux and user programs with Make MenuConfig, make, compile a kernel image file for the ARM target board, next to do It is necessary to need a ARM7 development board to run this image file (for how to compile UCLinux and user programs, please refer to www.uclinux.org). Building an ARM7-UClinux development board UCLinux only requires very little hardware resources to run, as an example of ARM7TDMI, only the following hardware: 1. CPU? SAMSUNG S3C4510B 2. SDRAM 8M or more 3. A simple serial port 4.2m Flash 5. An Ethernet interface (optional) Currently, the manufacturers of each embedded microprocessor are launching each processor while providing a DEMO board for users to test the performance of the microprocessor. Samsung provides an SNDS100 DEMO board for S3C4510B processors. The schematic of the DEMO board can be downloaded from Samsung's website, and some modifications to this principle are reserved, only the five parts listed above, remove other extra parts. The schematic after modification is an ARM7 target board schematic that can run UCLinux, and then processes several PCB boards according to this schematic. The corresponding components are welded, and a piece of ARM7 development board that runs UClinux is made (this The corresponding schematic of the development board, the PCB map can be downloaded from http://www.dailzh.net). Slow, although this development board has been soldered, but it is only a simple combination of electronic parts. It is necessary to run UCLinux above, and the corresponding software needs to manage these hardware.

The previous mentioned UCLinux can run directly from Flash, that is, the UCLinux image file can be burn directly into Flash, then power up, uclinux starts from flash? Yes, it is true. What is going to do now is how to burn Uclinux's kernel image to Flash. Write the UCLinux kernel image into the flash using the writer, then weld the Flash to the PCB board or insert it onto the flash of the development board. Of course, if you have a writer. However, few people can have such a writer in their hands. We need a cheap Flash write solution. With JTAG, S3C4510B integrates a JTAG, which can control all pin on S3C4510B via JTAG, which can generate the data, address and control bus of S3C4510B by entering the corresponding instructions and data to the JTAG interface. The read and write operation timing of the Flash device, burn the UCLinux core image file into the Flash (About the S3C4510B of JTAG interface cable making and downloading the programs in the UCLinux image file to the program in Flash executable file and source code, see http: //www.dailzh.net on related content). Finally, the UCLinux image file is burn it into the flash. Connect the ARM7 development board and the COM1 port of the ARM7 development board with a serial cable. Download a TIP program on the Internet, execute this command: tip? L / dev / ttys0? S 19200 is displayed on the screen to display Connected. After the power of the ARM7 development board is turned on. If you are lucky enough, you should see the following information: >> Linux Version 2.4.20-UC0 (Root @ Dailzh) (GCC Version 2.95.3 >> 20010315 (ColDfire Patches - 20010318 from http: // fiddes .NET / COLDFIRE /) >> (UClinux XIP and Shared Lib Patches from http://www.snapgear.com/)) March 19 23:44:11 CST 2003 >> Processor: Samsung S3C4510B Revision 6 >> Architecture : SNDS100 >> ON Node 0 Totalpages: 4096 >> zone (0): 0 pages. >> zone (1): 4096 pages. >> Kernel Command line: root = / devand line: root = / devand Line: root = / devand / ROM0 >> Calibrating delay loop ... 49.76 bogomips ... >> Command: CAT / etc / motd >> Welcome to uclinux.org >> for further information check: http://www.uclinux.org/ >> /> Uclinux has been running on the ARM7 target board, typing familiar LS commands to see what output. Bitting the UClinux image file through the JTAG interface to flash in Flash is too slow, debugging the UCLinux kernel is very inconvenient, is there any other method? Yes, UCLinux can be loaded into the memory in addition to direct operations from Flash.

转载请注明原文地址:https://www.9cbs.com/read-118567.html

New Post(0)