10004. To create an embedded Linux hardware and software development environment

xiaoxiao2021-03-06  82

Hand to create an embedded Linux hardware and software development environment from (http://www.dailzh.net) Linux and UClinux In August 1991, a student in Finland was put on the following paragraphs in the Comp.os.minix newsgroup: Helllet all people using minix - I am doing a free operating system for 386 (486) at (just to hobbia, not like GNU. This student is Linus Torvalds, and what he said is' hobby 'The Linux we know today. Since Linux's source code is published on the Internet, you can get free of charge, which has attracted a large number of drivers and application software from the world's UNIX hipster to Linux. In a short period of time, Linux has developed into a fairly perfect operating system, and Linux supported hardware platforms are the most in all operating systems. Currently Linux support hardware platform: Intel's IA64, Compaq's alpha, Sun SPARC / SPARC64 , SGI's MIPS, IBM S396, ARM, PowerPC, etc. The LINUX greater impact is that it is gradually applied to embedded devices, UCLinux is produced in this atmosphere. Muclinux is micro-control-linux, it It is also an open source project, UCLinux source code and development tools can be downloaded from http://www.uclinux.org. UClinux is developed for embedded processors without MMU (memory management unit), Compared to mainstream Linux, Uclinux has the following features: 1. Simplify the kernel load mode, UCLinux can run directly on Flash: It is to write the executive image of UCLinux's kernel to Flash, when the system starts Perform in writing from an address of the flash; you can also load it into memory: Store the compressed file of the kernel in Flash, read the compressed file when the system is started to decompress in memory, and then start execution. 2. Use ROMFS File system as root file system: This file system requires less space relative to the general EXT2 file system, first-core support ROMFS file system is less code than supporting EXT2 file system, second ROMFS file system is relatively simple, establish file System Superblock requires less storage. The ROMFS file system does not support dynamic erasing. For data that requires dynamic saving data, the RAM disk is processed by the RAM disk. 3. Using the FLAT executable Format: ELF Format has a large file header, Flat file pair The file header and some segment information are simplified. 4. Overrind the application library: UCLIBC is streamlined for libc, and 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 package of uclinux-distth, 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/lock/lib/gcc-lib/arm-elf/2.95.3/specsgcc version 2.95.3 20010315 (ColdFire Patches) - 20010318 from http://fiddes.net/coldfire/) (jClinux Xip and shared lib patches from http://www.snapgear.com/) indicates that the cross-ARM's cross-compilation environment 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 and download a TIP program from 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-106086.html

New Post(0)