【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】
本来这个系列的blog是在春节前准备的,因为过年耽误了一段时间。没有关系,今天我们继续补上。前面,我们说到了uboot、linux。因此要想系统正常可以运行起来,就差一个文件系统了。文件系统简单来说就是提前准备的一些文件打包压缩起来,内容通常有busybox生成的执行文件、dev node文件、etc脚本文件,准备好后用工具压缩一下就可以了。
关于文件系统,这里不打算说太多,因为我觉得这不是重点,我们应该把经历放在需要的地方去。长话短说,如果大家想有一份文件系统,有两种方法,
1) 直接使用别人制作好的文件系统,比如说我们可以使用skyeye-testsuite-1.2.5.tar.bz2提供的initrd.img,具体的位置在linux/s3c2410/s3c2410x-2.6.14目录下。
2) 自己制作一份文件系统,具体的制作方法可以参照这里,http://www.cnblogs.com/guocai/archive/2012/02/21/2362377.html.
在我看来,制作文件系统不是主要的,了解怎么使用这才比较重要。有了上面的文件系统,我们就可以加载了。skyeye文件如下,
# skyeye config file for S3C2410X cpu: arm920t mach: s3c2410x # physical memory mem_bank: map=M, type=RW, addr=0x00000000, size=0x10000000, file=../u-boot-1.3.2/u-boot mem_bank: map=M, type=RW, addr=0x30000000, size=0x04000000, mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000, file=../linux-2.6.14/vmlinux mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, file=./initrd.img mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000 # all peripherals I/O mapping area mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000 mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020 net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1 lcd: type=s3c2410x, mod=gtk #dbct:state=on如果我们想快速加载文件系统,可以直接越过u-boot,输入skyeye -e ../linux-2.6.14/vmlinux即可,效果如下,
root@hp-6531s:~/Desktop/env/arm_linux_2.6.14$ skyeye -e ../linux-2.6.14/vmlinux Your elf file is little endian. arch: arm cpu info: armv4, arm920t, 41009200, ff00fff0, 2 mach info: name s3c2410x, mach_init addr 0x806dc30 ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1 failed to setup_module (name:net, type:cs8900a) tapif_init: icotl TUNSETIFF erroruart_mod:0, desc_in:, desc_out:, converter: SKYEYE: use arm920t mmu ops Loaded RAM ../u-boot-1.3.2/u-boot Loaded RAM ../linux-2.6.14/vmlinux Loaded RAM ./initrd.img start addr is set to 0xc0008000 by exec file. Linux version 2.6.14 (realsil@hp-6531s) (gcc version 3.4.1) #5 Thu Feb 20 15:00:09 CST 2014 CPU: ARM920Tid(wb) [41009200] revision 0 (ARMvundefined/unknown) Machine: SMDK2410 Warning: bad configuration page, trying to continue Memory policy: ECC disabled, Data cache writeback CPU S3C2410 (id 0x32410000) S3C2410: core 62.400 MHz, memory 62.400 MHz, peripheral 62.400 MHz S3C2410 Clocks, (c) 2004 Simtec Electronics CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on CPU0: D VIVT write-back cache CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets Built 1 zonelists Kernel command line: mem=32M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x00800000 ramdisk_size=8192 rw PID hash table entries: 256 (order: 8, 4096 bytes) timer tcon=00000000, tcnt cb1f, tcfg 00000200,00000000, usec 0000189e Console: colour dummy device 80x30 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 32MB = 32MB total Memory: 22320KB available (1469K code, 271K data, 92K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd softlockup thread 0 started up. Freeing initrd memory: 8192K NET: Registered protocol family 16 S3C2410: Initialising architecture Console: switching to colour frame buffer device 80x25 fb0: Virtual frame buffer device, using 1024K of video memory s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410 s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410 s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410 io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize mice: PS/2 mouse device common for all mice NET: Registered protocol family 2 IP route cache hash table entries: 512 (order: -1, 2048 bytes) TCP established hash table entries: 2048 (order: 1, 8192 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) TCP reno registered TCP bic registered NET: Registered protocol family 1 RAMDISK: ext2 filesystem found at block 0 RAMDISK: Loading 2048KiB [1 disk] into ram disk... done. VFS: Mounted root (ext2 filesystem). Freeing init memory: 92K init started: BusyBox v1.4.1 (2007-02-10 01:19:06 CST) multi-call binary Starting pid 16, console /dev/console: '/etc/init.d/rcS' ifconfig: SIOCSIFADDR: No such device Welcome to _ _____ __ __ _ _ / \ / __ \ / \_/ \ | | |_| / _ \ | | | | / /\ /\ \ | | _ ____ _ _ _ _ / /_\ \ | |__| | / / \_/ \ \| | | | _ \| | | |\ \/ / / /___\ \ | |__\ \ | | | || |___ | | |_| | |_| |/ \ /_/ \_\| | \_\|_| |_||_____||_|_| |_|\____|\_/\_/ ARMLinux for Skyeye For further information please check: http://www.skyeye.org/ BusyBox v1.4.1 (2007-02-10 01:19:06 CST) Built-in shell (ash) Enter 'help' for a list of built-in commands. /bin/ash: can't access tty; job control turned off / $ / $ ls bin home linuxrc root usr dev initrd lost+found sbin var etc lib proc tmp / $上面加载的很顺利,如果我们想从uboot加载呢,可以这么做,首先skyeye -e ../u-boot-1.3.2/u-boot,如下所示,
root@hp-6531s:~/Desktop/env/arm_linux_2.6.14$ skyeye -e ../u-boot-1.3.2/u-boot Your elf file is little endian. arch: arm cpu info: armv4, arm920t, 41009200, ff00fff0, 2 mach info: name s3c2410x, mach_init addr 0x806dc30 ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1 failed to setup_module (name:net, type:cs8900a) tapif_init: icotl TUNSETIFF erroruart_mod:0, desc_in:, desc_out:, converter: SKYEYE: use arm920t mmu ops Loaded RAM ../u-boot-1.3.2/u-boot Loaded RAM ../linux-2.6.14/vmlinux Loaded RAM ./initrd.img start addr is set to 0x33f80000 by exec file. ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032 U-Boot 1.3.2 (Jan 27 2014 - 15:32:01) DRAM: 64 MB Flash: 512 kB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial ERROR: s3c2410x_io_write_word(0x1900030a) = 0x00000000 SMDK2410 # bootelf 0xc0000000待uboot启动后,直接输入bootelf 0xc0000000,就可以得到和上面一样的打印信息了。当然如果对booelf不放心,可以直接输入go 0xc0008000,效果是一样的。
root@hp-6531s:~/Desktop/env/arm_linux_2.6.14$ skyeye -e ../u-boot-1.3.2/u-boot Your elf file is little endian. arch: arm cpu info: armv4, arm920t, 41009200, ff00fff0, 2 mach info: name s3c2410x, mach_init addr 0x806dc30 ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1 failed to setup_module (name:net, type:cs8900a) tapif_init: icotl TUNSETIFF erroruart_mod:0, desc_in:, desc_out:, converter: SKYEYE: use arm920t mmu ops Loaded RAM ../u-boot-1.3.2/u-boot Loaded RAM ../linux-2.6.14/vmlinux Loaded RAM ./initrd.img start addr is set to 0x33f80000 by exec file. ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032 U-Boot 1.3.2 (Jan 27 2014 - 15:32:01) DRAM: 64 MB Flash: 512 kB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial ERROR: s3c2410x_io_write_word(0x1900030a) = 0x00000000 SMDK2410 # go 0xc0008000如果对上面效果还算满意的朋友,可以去好好试一试。