samsung_tiny4412 (note)-->linux 3.5,U-BOOT,BUSYBOX,SD card Start environment construction

Source: Internet
Author: User
Tags message queue

/*********************************************************************************** * * Samsun g_tiny4412 (note)-->linux 3.5,U-BOOT,BUSYBOX,SD card Start Environment Construction * * Statement: * 1. All of the following shell commands are run under root authority; * 2. Minicom (U-boot) refers to the use of minicom to connect the development Board as a u-boot terminal; * 3.              The following 2 ways are used when writing to a file: * 1. If the file does not exist, create the file, and if it exists, add the content to the file as overridden: * cat > File name << EOF (Terminator) *          ... * file contents ... * EOF (input encountered eof,cat instruction end, content will be saved in previously specified file) * 2. If the file does not exist, create the file, and if present, append the content to the end of the file: * cat >> filename << EOF (Terminator) * ... * file contents. . * ... * EOF * * 2015-3-7 Yin Shenzhen Shang Guan Sbin Zengjianfeng ************ **********************************************************************/                        \\\\\\\\\\\\\\--* Directory *--/////////////|I. Warm-up articles; |two. Introduction of kernel source tree; |Three. Configure the cross compiler; |Four. Kernel compiling process and principle; |Five. Install the minicom program; | Six. U-boot compilation; | Seven. U-Boot sd card starts; |eight. Android fast_boot sd card boot; |Nine. Using BusyBox to make the file system; |10. NFS Configuration; \\\\\\\\\\\\\\\\\\\//////////////////I. Warm-up articles:1How the computer starts: http://www.ruanyifeng.com/blog/2013/02/booting.html    2. Linux start-up process: http://www.ruanyifeng.com/blog/2013/08/linux_boot_process.html    3. The origin of the UNIX directory structure: http://lists.busybox.net/pipermail/busybox/2010-december/074114.htmlhttp//www.ruanyifeng.com/blog/2012/02/a_history_of_unix_directory_structure.htmltwo. Kernel Source tree Introduction:1. Arch (architecture): Platform architecture-related files2. BLOCK: Block device IO scheduling policy implementation3. COPYING: Copyright Notice4. Crypto: Common encryption, validation method implementation5. Documentation: Kernel Official document ZH_CN: Chinese translation document6. Drivers: Device drivers7. FS (File System): FileSystem implementation8. Include: Kernel header file9. Init: Kernel boot codeTen. IPC (Inter process Communication): Interprocess communication Implementation1. Signal Signal2. Pipe nameless Pipes3. Named pipe (FIFO) Named Pipes4. Message Queue Message Queuing5. Shared Memory Share6. Semaphore Signal Volume7. Socket Sockets One. Kernel: Kernel core code A. Lib (library): Universal Database Implementation -. MM (Memory Manage): implementation -. NET: Network protocol stack Implementation the. Samples: Kernel Sample code -. Scripts: Kernel Compilation tool -. Sound: With audio-related code1. OSS (Open sound system)2. ALSA (Advance Linux Sound three. Configuring the cross-compiler:1. Tar XF arm-linux-gcc-4.5.1-v6-vfp-20120301. tgz2. CP opt/* /opt-r 3.    Cat >> ~/.BASHRC << EOF (Configure environment variables to facilitate use of cross-compiler) Path= $PATH: Opt/friendlyarm/toolschain/4.5.1/bin EOF 4.source ~/.BASHRC (enables the path of the previous configuration to take effect) check whether the configuration is good: After the terminal input: arm, press two tabs to appear as follows to indicate normal arm-linux-addr2line a                      Rm-none-linux-gnueabi-addr2line Arm-linux-ar Arm-none-linux-gnueabi-ar Arm-linux-as Arm-none-linux-gnueabi-as arm-linux-c++ arm-none-linux-gnueabi-c++ Arm -LINUX-CC ARM-NONE-LINUX-GNUEABI-CC arm-linux-c++filt arm-none-linux-gnueabi-c ++filt arm-linux-cpp arm-none-linux-gnueabi-cpp arm-linux-g++ arm-no               ne-linux-gnueabi-g++ ARM-LINUX-GCC ARM-NONE-LINUX-GNUEABI-GCC arm-linux-gcc-4.5.1 arm-none-linux-gnueabi-gcc-4.5.1 four. Kernel compilation process and principle: 1. The Make Menuconfig program runs: scripts/kconfig/mconf Kconfig, in The root directory of the kernel tree is borninto:. config file; Kconfig syntax: Documentation/kbuild/kconfig-language.txt 2. Make-j2 Zimage 1.        Parameter-j2 is to open 2 threads to compile the kernel, zimage compile the target;                2. The program will run: scripts/kconfig/conf. config, generate the following files: 1. include/config/auto.conf: For the Makefile in the module compilation selection; Config_menu3=y config_m2=y 2.                Include/generated/autoconf.h: #ifdef/#ifndef for kernel source code; #define CONFIG_MENU3 1 #define CONFIG_M2 1 3.        Compile the. c file in the kernel into an. o file according to the above auto.conf and autoconf.h; 4. In each directory, the. O is packaged in BUILT-IN.O in the top-level directory with the AR command, so each directory has a BUILT-IN.O 5. And so on, the top-level directory of the source directory will get a BUILT-IN.O file and convert it to VMLINUX.O 6. VMLINUX.O through the linker link (LD) to get Vmlinux 7.        Because the kernel is running on the bare board, so we need to remove the elf file header, get the binary image file;        8. Image after gzip compression to obtain the final zimage file; 9. The NM vmlinux kernel symbol can be used to see if the required driver is not compiled into the kernel, or by looking at the address symbol table in System.map under the root of the kernel, which is the same as U-boot. Five. Installing the Minicom Program: 1. Yum Install minicom 2. Configure Minicom 1. At the terminal: Minicom-s 2.         After entering the interface: Select serial Port Setup    3. When using USB to serial port, Serial deveice:/dev/ttyusb0 +-------------------------------------------+ |            A-serial Device:/dev/ttys0 | |            B-lockfile Location:/var/lock | |            C-callin Program: | |            D-callout Program: | |            e-bps/par/bits:115200 8N1 | |            F-hardware Flow Control:no | |            G-software Flow Control:no |                                           |            |    |                  Change which setting?        | 4. After setting it up, select Save Setup as DFL as default configuration six. U-boot compile: 1. Make Tiny4412_config//(the corresponding content can be queried in boards.cfg) 2. make//Compile finished u-boot.bin is the desired file, U-boot.bin is the U-boot file//elf file information after the removal of seven. U-boot SD card boot (assuming the SD card is mounted on/dev/sdb and into the U-boot root directory): 1. Uboot_tiny4412/sd_fuse/tiny4412/sd_fusing.sh/dev/sdb ( To the SD card burning write U-boot, will automatically divided into the following 2 areas) 1. /DEV/SDB1 2. /DEV/SDB4 2. Mkfs.vfat /DEV/SDB1 (formatted/DEV/SDB1 partition in VFAT format for zimage) 3. MKFS.EXT4/DEV/SDB4 (formatted/DEV/SDB4 partition with EXT4 format for file system) 4.    Reseat the SD card, put the generated zimage into the/DEV/SDB1 partition, the file system is placed in the/DEV/SDB4 partition;    5. Insert SD card into Development Board, select SD card to boot, open minicom; 5. Install Dnw:tar XF dnw-linux.tar.gz && cd dnw-linux && make && make install 6. DNW test Zimage is feasible: 1. minicom (u-boot) Inside: DNW 0x40008000 2. PC-side command: DNW arch/arm/boot/zimage (Run command at kernel root) 3. Minicom (u-boot) Inside: Bootm 0x40008000 7. Minicom (u-boot) command to see if zimage exists in the SD card: Fatls MMC 0:1 8. Minicom (u-boot) loads zimage into memory 0x40008000:fatload MMC 0:1 0x40008000 9. Minicom (u-boot) boot kernel: Bootm 0x40008000 10. Minicom (u-boot) modified bootcmd:set bootcmd "fatload mmc 0:1 0x40008000 zimage;bootm 0x40008000" 11. Minicom (U-boot) Save: Save 12. Minicom (u-boot) Restart: Reset eight. Android fast_boot SD card boot (requires operation based on front u-boot SD card boot): 1. minicom Enter the U-boot command to partition the SD card: FDISK-C 0 320 806 518 2. After repartitioning, you can reformat the FAT partition, minicom input u-boot command: Fatformat MMC 0:1 3. Connect using a USB cableTiny4412 Micro_usb port to PC, then minicom input u-boot command: FastBoot 4.    Copy the FastBoot script to the $path directory on the PC side; 5. On the PC side, enter the following command to burn: fastboot flash kernel zimage (burn write kernel) 6.    Zimage transmission is finished minicom will appear suspended animation state, press CTRL + C exit fastboot command state; 7. Minicom (u-boot) loads zimage to memory 0x40008000:movi read kernel 0 40008000 8.  Minicom (u-boot) boot kernel: Bootm 0x40008000 9. Minicom (u-boot) modified Bootcmd:set bootcmd "movi read kernel 0 40008000;bootm 0x40008000" 10. Minicom (U-boot) Save: Save 11. Minicom (u-boot) Restart: Reset Nine. Using Busybox to create a file system: 1. Make menucofig, select the content in the popup dialog box: 1. Busybox Settings--Build options--[*] Build Bu Sybox as a static binary (no shared libs) 2. Busybox Settings---Build Options--(arm-linux-) Cross Compiler prefix 2. Mkdir/disk/a9/filesystem (assuming the directory provided by/disk/a9/filesystem for NFS) 3. Make && make install Config_prefix=/disk/a9/filesystem 4. Cd/disk/a9/filesystem && Mdkir Dev etc sys proc MNT tmp 5. Cat > Etc/init.d/rcs << EOF (Rcs:run command StART) mount-t Ramfs none/dev mount-t sysfs none/sys mount-t proc None/proc mount-t Tmpf S none/tmp/sbin/mdev-s EOF 6. Mknod dev/console C 5 1 7. Cat > Etc/inittab << EOF:: Sysinit:/etc/init.d/rcs ttysac0::askfirst:-/bin/sh #/bin/sh front-Indicates that SH will load by default /etc/profile EOF 8. Cat > Etc/profile << EOF Export ps1= "[[[Email protected] \w]#" #设置命令提示前面的那段文字 EOF 9. mkdir Lib && cp/opt/friendlyarm/toolschain/4.5.1/arm-none-linux-gnueabi/lib/* Lib 10. chmod 777/disk/a9/filesystem-r-to NFS Access all permissions 11.    File system is completed, if you want to save the file system to the SD card, please save in the fourth partition; In Minicom (u-boot), look for the file system folder: Ext2ls MMC 0:4/13. SD Card File system Bootargs settings: Set Bootargs "Root=/dev/mmcblk0p4 console=ttysac0,115200 LCD=S70" 10. NFS Configuration: 1. Turn off the firewall (iptables), turn off the SEL Inux 2. PC side settings: 1. Set the PC's Ip:ifconfig eth0 192.168.100.22 2. Cat >>/etc/exports << Eof/disk/a9/filesystem * (rw)           EOF 3. Service NFS Restart 4. SHOWMOUNT-E 192.168.100.22--see if the directory has been published 3. U-boot set (via Minicom setting) 1. Development Board ip:192.168.100.111 2. Server for NFS ip:192.168.100.22 3. Gateway: 192.168.100.1 4. Subnet Mask: 225.225.225.0 5. NFS File System boot, U-boot Bootargs set: Set Bootargs "Root=/dev/nfs Nfsroot=192.168.100.22:/disk/a9/filesystem ip= 192.168.100.111 console=ttysac0,115200 LCD=S70 "

samsung_tiny4412 (note)-->linux 3.5,U-BOOT,BUSYBOX,SD card Start environment construction

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.