Linux-2.6.24.4 kernel porting to S3C2440 -- using a busybox-1.9.2 to make a root file system

Source: Internet
Author: User

2.6.24.4 Kernel porting to S3C2440 ---- Use busybox-1.9.2 Create a root file system   Bytes --------------------------------------------------------------------------------------------------- Porting environment:HOST: centos 5.1 Cross Compiler: arm-linux-gcc-3.4.1 Development Board platform: S3C2440 (YL-2440/YLP-2440 Development Board) Start porting1. download the latest busybox1.9.2 and decompress it. Download busybox source code: http://busybox.net/downloads/busybox-1.9.2.tar.bz2 tool: With the kernel decompressed source code: tar-jxvf busybox-1.9.2.tar.bz2  2. Modify the arch of Line 1 in makefile and the chaincode of the compilation tool. Arch? = Armcros_compile? =/Usr/local/ARM/3.4.1/bin/ARM-Linux-3. Make menuconfig. Modify the compilation configuration options. Busybox setting ----->Build option --> [] Build busybox as a static binary (no shared libs) [*] build shared libbusybox [*] produce a binary for each applet, linked against libbusybox [*] produce additional busybox binary linked against libbusybox [] Build with large file support (for accessing files> 2 GB) installation option --> [*] Don't use/usr applets links (as soft-links) ---> (. /_ install) busybox installation prefix  Busybox library tuning ---> MD5: Trade bytes for speed [*] Faster/proc scanning code (+ 100 bytes) [*] Support for/etc/networks [*] Support for/etc/networks [*] additional editing keys [*] vi-style line editing commands [*] History saving [*] tab completion [*] username completion [*] Fancy shell prompts LINUX module utilities --->[*] Support version 2.6.x linux kernels [*] insmod [*] Enable load map (-m) option [*] symbols in load map [*] rmmod [*] lsmod [*] lsmod pretty output for 2.6.x linux kernels [*] modprobe [] multiple options parsing [] Fancy alias Parsing --- options common to multiple modutils [] Support tainted module checking with new kernels [] support version 2.2.x to 2.4.x linux kernels [*] Support versio N 2.6.x linux kernels other defaults 4. Compile busybox [Kevin @ localhost busybox-1.9.2] # make install will generate the files we need under the busybox/_ install directory. 5. Modify the properties of _ install/bin/busybox. 4755 chmod 4755. /_ install/bin/busybox must modify attributes. Otherwise, many commands in busybox will be restricted, such as: $ Susu: Must be SUID to work properly 6. the directories and files required to create the root FS file system. Mkdir/nfsroot/S3C2440 create a basic directory in the root folder [root @ centos S3C2440] # lsbin Dev home linuxrc proc sbin TMP varboot etc lib MNT root sys USR 6. create a node file/dev/console as root,/dev/null mknod-m 600 DEV/console C 5 1 mknod-M 666 DEV/null C 1 3 7. the configuration file is as follows: [root @ centos etc] # More profile #! /Bin/sh #/etc/profile: system-wide. profile file for the Bourne shells echoecho-n "processing/etc/profile ...... "# Set Search Library pathexport LD_LIBRARY_PATH =/lib:/usr/lib # Set User pathexport Path =/bin:/sbin:/usr/bin: /usr/sbin # Set ps1user = "'id-UN '" LOGNAME = $ userps1 =' [/u @/h/W]/$ 'path = $ PATH echo "done! "[Root @ centos etc] # More init. d/RCS #! /Bin/sh # Set hostname, needed host file in/etc directory #. /etc/hosthostname 'cat/etc/host' # mount all filesystem defined in "fstab" Echo "# mount all ....... "/bin/Mount-A # + yangdk/bin/chmod 0666/dev/null echo" # Starting mdev .... "/bin/ECHO/sbin/mdev>/proc/sys/kernel/hotplugmdev-S/usr/etc/init echo "************ * *************************** "Echo" yangdk linux-2.6.24.4 Boot "Echo" "Echo" "Echo "********************************** * ******* "[root @ centos etc] # More fstab host inittab passwd Shadow Group init. d/mdev. conf profile [root @ centos etc] # More fstab proc/proc defaults 0 0 none/tmp ramfs defaults 0 0 NONE/var ramfs defaults 0 0 0 mdev/dev ramfs defaults 0 0 sysfs /sys sysfs defaults 0 0 [root @ centos etc] # More inittab:: sysinit:/etc/init. d/RCS: respawn:-/bin/sh tty 2: askfirst:-/bin/sh: ctrlaltdel:/bin/umount-a-r: shutdown:/bin umount-a-r: shutdown: /sbin/swapoff-A [root @ centos etc] # more .. /usr/etc/init #! /Bin/shifconfig eth0 192.168.1.111 upifconfig lo 127.0.0.1 8. create a file/etc/mdev. conf, the content is blank [root @ centos etc] # vi mdev. conf 9. copy the passwd, group, and shadow files under the host/etc/to/etc [root @ centos etc] # cp/etc/group. [root @ centos etc] # cp/etc/passwd. [root @ centos etc] # cp/etc/shadow. OK. All required files have been created. OK [root @ centos etc] # lsfstab group host init. d inittab mdev. conf passwd profile shadow 10. copy the compiled busybox to the/root directory [root @ CEN ToS _ install] # sudo CP-rfv */nfsroot/S3C2440 11, because dynamic links are used during compilation. So first check which Lib is used by/busybox/_ install/bin/busybox, and then copy the corresponding lib from glibc to/nfsroot/S3C2440/lib. [Root @ centos bin] #/usr/local/ARM/3.4.1/ARM-Linux-GNU-readelf-D busybox dynamic section at offset 0xb8014 contains 22 entries: tag type name/value 0x00000001 (needed) Shared Library: [libcrypt. so.1] 0x00000001 (needed) Shared Library: [libm. so.6] 0x00000001 (needed) Shared Library: [libc. so.6] 0x0000000c (init) 0xc04c 0x0000000d (fini) 0xa26f0 0x00000004 (hash) 0x80e8 0x00000005 (strtab) 0xa384 0x0 0000006 (symtab) 0x8b24 .................. Copy the Lib file to the lib directory: [root @ centos lib] CP/usr/local/ARM/3.4.1/ARM-Linux/lib/LD *. [root @ centos lib] CP/usr/local/ARM/3.4.1/ARM-Linux/lib/libc-2.3.2.so. [root @ centos lib] CP/usr/local/ARM/3.4.1/ARM-Linux/lib/libc. so.6. [root @ centos lib] CP/usr/local/ARM/3.4.1/ARM-Linux/lib/libm *. [root @ centos lib] CP/usr/local/ARM/3.4.1/ARM-Linux/lib/libcrypt *. 12. use the mkcramfs tool to create the entire S3C2440 folder into a file system [root @ centos nfsroot] # m Kcramfs S3C2440 fs_2.6.24.4_busybox.cramfs-e 2.6.24.4 download and download it to nandflash. Start... Read chip id = ec76nand flash status = c0set boot Params = root =/dev/mtdblock2 init =/linuxrc load_ramdisk = 0 console = ttysac1, 115200 mem = 65536 K devfs = Mount load kernel... linux version 2.6.24.4 (root @ centos) (GCC version 3.4.1) #49 Wed May 7 18:57:08 CST 2008cpu: ARM920T [41129200] Revision 0 (armv4t), Cr = c0007177machine: forbidden is deprecated; please update your bootloader. memory Policy: ECC disabled, data cache writebackcpu s3c2440a (ID 0x32440001) s3c244x: Core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 mhzs3c24xx clocks, (c) 2004 simtec electronicsclock: slow mode (1.500 MHz), fast, mpll on, upll oncpu0: D vivt write-back cachecpu0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 setscpu0: d cache: 16384 bytes, associativity 64, 32 byte lines, 8 setsbuilt 1 Zon Elists in Zone order, mobility grouping on. total pages: 16256 kernel command line: Root =/dev/mtdblock2 init =/linuxrc load_ramdisk = 0 console = ttysac1, 115200 mem = 65536 K devfs = Mount IRQ: clearing pending ext status 0005f600irq: Clearing subpending status 0000009 airq: Clearing subpending status limit 0092pid hash table entries: 256 (Order: 8, 1024 bytes) timer tcon = 00590000, tcnt a2c1, tcfg 00000200,00000 000, USEC 20171eb8console: Color dummy device 80x30console [ttysac1] enableddentry cache hash table entries: 8192 (Order: 3, 32768 bytes) inode-Cache hash table entries: 4096 (Order: 2, 16384 bytes) memory: 64 MB = 64 MB totalmemory: 61628kb available (2824 K code, 299 K data, 120 K init) Mount-Cache hash table entries: 512cpu: testing write buffer coherency: oknet_namespace: 64 bytesnet: Registered prot Ocol family 16s3c2410 power management, (c) 2004 simtec Protocol: initialising ubuntures3c2440: IRQ Protocol: clock support, DVS offs3c24xx DMA driver, (c) 2003-tps2006 simtec electronicsdma channel 0 at c4800000, IRQ 33dma Channel 1 at c4800040, IRQ 34dma Channel 2 at c4800080, IRQ 35dma Channel 3 at c48000c0, IRQ 36 usbcore: registered new interface driver usbfsusbcore: Regi Stered new interface driver hubusbcore: Registered New Device Driver usbnet: Registered protocol family 2ip route cache hash table entries: 1024 (Order: 0, 4096 bytes) TCP established hash table entries: 2048 (Order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash Tables configured (established 2048 bind 2048) TCP Reno registerednetwinder floating point emulator v0.9 7 (Double Precision) jffs2 Version 2.2. (NAND) 2001-2006 Red Hat, Inc. io scheduler Noop registeredio scheduler anticipatory registered (default) Io scheduler deadline registeredio scheduler CFQ registereds3c2410-lcd: no platform data for LCD, cannot s3c2410-lcd: Probe of attachs3c2410-lcd failed with error-22lp: driver loaded but no devices foundppdev: User-space parallel port drivers Erial: 8250/16550 driver $ revision: 1.90 $4 ports, IRQ sharing enableds3c2440-uart.0: s3c2410_serial0 at mmio 0x50000000 (IRQ = 70) is a S3C2440s3c2440-uart.1: s3c2410_serial1 at mmio 0x50004000 (IRQ = 73) is a S3C2440s3c2440-uart.2: s3c2410_serial at mmio 0x50008000 (IRQ = 76) is a s3c2440ramdisk driver initialized: 16 RAM disks of 4096 K size 1024 blocksizeloop: module loadedcirrus logic CS8900 A driver for Linux (modified for smdk2410) + yangdk --> Debug: pp_intnum: 21844 + yangdk --> debug2: pp_intnum: 21840eth0: cs8900a rev E at 0xe0000300 IRQ = 53, ADDR: 00: 0: 3E: 26: 0a: 0 uniform multi-platform E-IDE driver revision: 7.00alpha2ide: Assuming 50 MHz system bus speed for Pio modes; override with idebus = xxs3c24xx NAND driver, (c) 2004 simtec Electronicss3c2440-nand s3c2440-nand: tacls = 1, 10ns twrph0 = 4 40ns, twrph1 = 1 10 nsnand device: Manufacturer ID: 0xec, chip ID: 0x76 (Samsung NAND 64mib 3,3 V 8-bit) nand_ecc_none selected by board driver. this is not recommended !! Scanning Device for bad blockscreating 4 MTD partitions on "NAND 64mib 3,3 V 8-bit": 0x00000000-0x00030000: "bootloader" failed: "Linux kernel" 0x00200000-0x02000000: "Linux rootfs" failed: "user" usbmon: debugfs is not availables3c2410-ohci s3c2410-ohci: s3c24xx OHCIs3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1s3c2410-ohci s3c2410-ohci: IRQ 42, Io mem 0x49000000usb usb1: configuration #1 chosen from 1 choicehub 1-0:1. 0: USB hub foundhub 1-0: 1. 0: 2 ports detectedmice: PS/2 mouse device common for all mices3c2440-i2c s3c2440-i2c s3c2440-i2c: slave address 0x10s3c2440-i2c KHzs3c2440-i2c: Bus frequency set to 390 s3c2440-i2c i2c-0: s3c I2C adapters3c2410 watchdog timer, (c) 2004 simtec Electronicss3c2410-wdt s3c2410-wdt: watchdog inactive, Reset disabled, IRQ enabledtcp cubic registerednet: Registered protocol family 1rpc: Registered UDP Transport module. RPC: Registered TCP transport module. VFS: mounted root (cramfs filesystem) readonly. freeing init memory: 120 K init started: busybox v1.9.2 (00:31:28 Cst) starting PID 766, tty '': '/etc/init. d/RCS '# mount all ....... chmod:/dev/null: no such file or directory # Starting MD Ev .... + yangdk ---> Debug: request_irq successful ************************************** * yangdk linux-2.6.24.4 boot ******************************** ********* starting PID 776, tty '': '/bin/Sh' processing/etc/profile ...... -/bin/sh: User: Not founddone! [Root @ yangdk/] #

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.