平台
硬件:TQ2440 64MB内存 256MB NandFlash
bootloader:U-Boot 2015.04
kernel:linux-4.9
Python: Python-3.6.0
工具链:arm-none-linux-gnueabi-gcc 4.8.3
概述
现在树莓派很火,在树莓派上面用户可以通过Python来控制板子上面的GPIO资源, 然后我想TQ2440也应该做到这一点。 将来根文件系统会通过NFS的方式挂载到开发板上面。
正文
一、工具链
登录这个网址:http://www.veryarm.com/arm-none-linux-gnueabi-gcc
我们这里使用的是最新的Linux解压版:arm-2014.05-29,由于TQ2440用的arm9属于armv4t架构,所以在编译运行于TQ2440上的程序的时候需要给工具链传递参数-march=armv4t,为了简单起见,我们可以用下面的办法:
1 ( pengdl@ubuntu | ~/Study/cross_compile/arm-2014.05/bin | Remote:True ) 2 $ls -l 3 total 22581248 4 lrwxrwxrwx 1 pengdl pengdl 32 Apr 19 19:53 arm-linux-addr2line -> arm-none-linux-gnueabi-addr2line* 5 lrwxrwxrwx 1 pengdl pengdl 25 Apr 19 19:54 arm-linux-ar -> arm-none-linux-gnueabi-ar* 6 lrwxrwxrwx 1 pengdl pengdl 25 Apr 19 19:54 arm-linux-as -> arm-none-linux-gnueabi-as* 7 lrwxrwxrwx 1 pengdl pengdl 26 Apr 19 19:54 arm-linux-c++ -> arm-none-linux-gnueabi-c++* 8 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:54 arm-linux-c++filt -> arm-none-linux-gnueabi-c++filt* 9 lrwxrwxrwx 1 pengdl pengdl 26 Apr 19 19:54 arm-linux-cpp -> arm-none-linux-gnueabi-cpp* 10 lrwxrwxrwx 1 pengdl pengdl 25 Apr 19 19:55 arm-linux-cs -> arm-none-linux-gnueabi-cs* 11 lrwxrwxrwx 1 pengdl pengdl 32 Apr 19 19:55 arm-linux-cs-daemon -> arm-none-linux-gnueabi-cs-daemon* 12 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:55 arm-linux-elfedit -> arm-none-linux-gnueabi-elfedit* 13 -rwxrwxr-x 1 pengdl pengdl 57 Apr 19 20:00 arm-linux-g++* 14 -rwxrwxr-x 1 pengdl pengdl 57 Apr 19 20:06 arm-linux-gcc* 15 -rwxrwxr-x 1 pengdl pengdl 63 Apr 19 20:02 arm-linux-gcc-4.8.3* 16 lrwxrwxrwx 1 pengdl pengdl 29 Apr 19 19:56 arm-linux-gcc-ar -> arm-none-linux-gnueabi-gcc-ar* 17 lrwxrwxrwx 1 pengdl pengdl 29 Apr 19 19:56 arm-linux-gcc-nm -> arm-none-linux-gnueabi-gcc-nm* 18 lrwxrwxrwx 1 pengdl pengdl 33 Apr 19 19:57 arm-linux-gcc-ranlib -> arm-none-linux-gnueabi-gcc-ranlib* 19 lrwxrwxrwx 1 pengdl pengdl 27 Apr 19 19:57 arm-linux-gcov -> arm-none-linux-gnueabi-gcov* 20 lrwxrwxrwx 1 pengdl pengdl 26 Apr 19 19:57 arm-linux-gdb -> arm-none-linux-gnueabi-gdb* 21 lrwxrwxrwx 1 pengdl pengdl 28 Apr 19 19:57 arm-linux-gprof -> arm-none-linux-gnueabi-gprof* 22 lrwxrwxrwx 1 pengdl pengdl 25 Apr 19 19:57 arm-linux-ld -> arm-none-linux-gnueabi-ld* 23 lrwxrwxrwx 1 pengdl pengdl 25 Apr 19 19:58 arm-linux-nm -> arm-none-linux-gnueabi-nm* 24 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:58 arm-linux-objcopy -> arm-none-linux-gnueabi-objcopy* 25 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:58 arm-linux-objdump -> arm-none-linux-gnueabi-objdump* 26 lrwxrwxrwx 1 pengdl pengdl 29 Apr 19 19:58 arm-linux-ranlib -> arm-none-linux-gnueabi-ranlib* 27 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:58 arm-linux-readelf -> arm-none-linux-gnueabi-readelf* 28 lrwxrwxrwx 1 pengdl pengdl 27 Apr 19 19:58 arm-linux-size -> arm-none-linux-gnueabi-size* 29 lrwxrwxrwx 1 pengdl pengdl 30 Apr 19 19:58 arm-linux-strings -> arm-none-linux-gnueabi-strings* 30 lrwxrwxrwx 1 pengdl pengdl 28 Apr 19 19:58 arm-linux-strip -> arm-none-linux-gnueabi-strip* 31 -rwxr-xr-x 1 pengdl pengdl 736300 May 30 2014 arm-none-linux-gnueabi-addr2line* 32 -rwxr-xr-x 2 pengdl pengdl 763504 May 30 2014 arm-none-linux-gnueabi-ar* 33 -rwxr-xr-x 2 pengdl pengdl 1253360 May 30 2014 arm-none-linux-gnueabi-as* 34 -rwxr-xr-x 2 pengdl pengdl 687056 May 30 2014 arm-none-linux-gnueabi-c++* 35 -rwxr-xr-x 1 pengdl pengdl 734604 May 30 2014 arm-none-linux-gnueabi-c++filt* 36 -rwxr-xr-x 1 pengdl pengdl 686128 May 30 2014 arm-none-linux-gnueabi-cpp* 37 -rwxr-xr-x 1 pengdl pengdl 186548 May 30 2014 arm-none-linux-gnueabi-cs* 38 -rwxr-xr-x 1 pengdl pengdl 2186780 May 30 2014 arm-none-linux-gnueabi-cs-daemon* 39 -rwxr-xr-x 1 pengdl pengdl 24692 May 30 2014 arm-none-linux-gnueabi-elfedit* 40 -rwxr-xr-x 2 pengdl pengdl 687056 May 30 2014 arm-none-linux-gnueabi-g++* 41 -rwxr-xr-x 2 pengdl pengdl 686128 May 30 2014 arm-none-linux-gnueabi-gcc* 42 -rwxr-xr-x 2 pengdl pengdl 686128 May 30 2014 arm-none-linux-gnueabi-gcc-4.8.3* 43 -rwxr-xr-x 1 pengdl pengdl 23608 May 30 2014 arm-none-linux-gnueabi-gcc-ar* 44 -rwxr-xr-x 1 pengdl pengdl 23576 May 30 2014 arm-none-linux-gnueabi-gcc-nm* 45 -rwxr-xr-x 1 pengdl pengdl 23576 May 30 2014 arm-none-linux-gnueabi-gcc-ranlib* 46 -rwxr-xr-x 1 pengdl pengdl 307000 May 30 2014 arm-none-linux-gnueabi-gcov* 47 -rwxr-xr-x 1 pengdl pengdl 4484452 May 30 2014 arm-none-linux-gnueabi-gdb* 48 -rwxr-xr-x 1 pengdl pengdl 805164 May 30 2014 arm-none-linux-gnueabi-gprof* 49 -rwxr-xr-x 2 pengdl pengdl 1200784 May 30 2014 arm-none-linux-gnueabi-ld* 50 -rwxr-xr-x 2 pengdl pengdl 747500 May 30 2014 arm-none-linux-gnueabi-nm* 51 -rwxr-xr-x 2 pengdl pengdl 912812 May 30 2014 arm-none-linux-gnueabi-objcopy* 52 -rwxr-xr-x 2 pengdl pengdl 1109932 May 30 2014 arm-none-linux-gnueabi-objdump* 53 -rwxr-xr-x 2 pengdl pengdl 763504 May 30 2014 arm-none-linux-gnueabi-ranlib* 54 -rwxr-xr-x 1 pengdl pengdl 420160 May 30 2014 arm-none-linux-gnueabi-readelf* 55 -rwxr-xr-x 1 pengdl pengdl 737260 May 30 2014 arm-none-linux-gnueabi-size* 56 -rwxr-xr-x 1 pengdl pengdl 736332 May 30 2014 arm-none-linux-gnueabi-strings* 57 -rwxr-xr-x 2 pengdl pengdl 912812 May 30 2014 arm-none-linux-gnueabi-strip*
即在原来的工具链上面做一些软连接,对arm-linux-gcc/g++/gcc-4.8.3做一些特殊处理:
1 $cat arm-linux-gcc 2 #!/bin/bash 3 arm-none-linux-gnueabi-gcc -march=armv4t $* 4 5 $cat arm-linux-g++ 6 #!/bin/bash 7 arm-none-linux-gnueabi-g++ -march=armv4t $* 8 9 $cat arm-linux-gcc-4.8.3 10 #!/bin/bash 11 arm-none-linux-gnueabi-gcc-4.8.3 -march=armv4t $*
此外, 还需要注意的是, 将来在制作用于TQ2440的根文件系统的时候拷贝的工具链的lib库的位置:
arm-2014.05/arm-none-linux-gnueabi/libc/armv4t/lib
而不是:
arm-2014.05/arm-none-linux-gnueabi/libc/lib
这个用于高于armv4t架构的平台,如exynos4412用的是armv7架构。
二、Bootloader
使用的uboot可以到https://github.com/pengdonglin137/u-boot下载,可以参考:
将来的分区稍有变化:
1MB SPL | 1MB UBOOT |
1MB PARAMS |
5MB KERNEL |
1MB DTB | 247MB ROOTFS |
bootargs:
noinitrd root=/dev/nfs rw nfsroot=192.168.1.101:/nfsroot/rootfs ethmac=1C:6F:65:34:51:7E ip=192.168.1.6:192.168.1.101:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0,115200n
这里板子的IP是192.168.1.6,HOST的IP是192.168.1.101, 当然由于采用了设备树的方式, 所以也可以不在uboot里设置bootargs,而是放到设备树的chosen节点当中。
bootcmd:
nand read 0x300080000x3000000x500000; nand read 0x320000000x8000000x100000; bootm 0x30008000-0x32000000
三、kernel
可以到https://github.com/pengdonglin137/linux-4.9下载,tq2440_dt分支, 使用方法参考 讓TQ2440也用上設備樹(1)烧写kernel和dtb到nand中:
1 烧写kernel: 2 mw.b 0x30008000 0xff 0x500000 3 tftp 0x30008000 uImage 4 nand erase 0x300000 0x500000 5 nand write 0x30008000 0x300000 0x500000 6 7 烧写dtb: 8 mw.b 0x30008000 0xff 0x100000 9 tftp 0x30008000 dtb 10 nand erase 0x800000 0x100000 11 nand write 0x30008000 0x800000 0x100000
四、Python
参考
由于上面两篇博文采用的是qemu模拟的cortex-a9平台,属于armv7架构,而我们的tq2440是armv4架构,所以需要做一些修改。
-
SQlite
1 #!/bin/bash 2 3 ../sqlite-autoconf-3170000/configure --host=arm-none-linux-gnueabi 4 --prefix=`pwd` 5 CFLAGS="-march=armv4t" 6 CPPFLAGS="-march=armv4t" 7 LDFLAGS="-march=armv4t" 8 9 make -j4 10 make install
-
Readline
1 #!/bin/bash 2 3 ../readline-7.0/configure --host=arm-none-linux-gnueabi 4 --prefix=`pwd` 5 CFLAGS="-march=armv4t" 6 CPPFLAGS="-march=armv4t" 7 LDFlAGS="-march=armv4t" 8 9 make -j4 10 make install
-
Termcap
配置:
1 #!/bin/bash 2 3 ../termcap-1.3.1/configure --host=arm-none-linux-gnueabi 4 --prefix=`pwd`
修改Makefile:
1 CC = arm-none-linux-gnueabi-gcc 2 AR = arm-none-linux-gnueabi-ar 3 RANLIB = arm-none-linux-gnueabi-ranlib 4 ... ... 5 CFLAGS = -g -march=armv4t
然后 make && make install
-
Python3
配置:
1 #!/bin/bash 2 3 ../Python-3.6.0/configure 4 --host=arm-linux 5 --build=armv4 6 --prefix=`pwd` 7 --enable-ipv6 8 --enable-shared 9 ac_cv_file__dev_ptmx="yes" 10 ac_cv_file__dev_ptc="no" 11 LDFLAGS="-L/home/pengdl/Study/tq2440/Python/SQlite/tq2440/lib 12 -L/home/pengdl/Study/tq2440/Python/Readline/tq2440/lib 13 -L/home/pengdl/Study/tq2440/Python/Termcap/tq2440" 14 CPPFLAGS="-I/home/pengdl/Study/tq2440/Python/SQlite/tq2440/include 15 -I/home/pengdl/Study/tq2440/Python/Readline/tq2440/include"
别忘了修改Modules/Setup文件,然后执行 make && make install即可。
五、根文件系统
参考博客 用Qemu搭建aarch32学习环境
下面是制作根文件系统的脚本:
1 #!/bin/bash 2 3 sudo rm -rf rootfs 4 sudo rm -rf tmpfs 5 sudo rm -rf ramdisk* 6 7 sudo mkdir rootfs 8 sudo cp ../busybox-1.24.2/_install/* rootfs/ -raf 9 10 sudo mkdir -p rootfs/proc/ 11 sudo mkdir -p rootfs/sys/ 12 sudo mkdir -p rootfs/tmp/ 13 sudo mkdir -p rootfs/root/ 14 sudo mkdir -p rootfs/var/ 15 sudo mkdir -p rootfs/mnt/ 16 17 sudo cp etc rootfs/ -arf 18 sudo mkdir -p rootfs/lib 19 20 sudo cp -arf /home/pengdl/Study/cross_compile/arm-2014.05/arm-none-linux-gnueabi/libc/armv4t/lib/*.so* rootfs/lib 21 22 #Python3 23 sudo mkdir -p rootfs/usr 24 pushd rootfs/usr 25 sudo cp -raf /home/pengdl/Study/tq2440/Python/Python3/tq2440/lib . 26 sudo cp -raf /home/pengdl/Study/tq2440/Python/Python3/tq2440/include . 27 sudo cp -raf /home/pengdl/Study/tq2440/Python/Python3/tq2440/bin . 28 sudo cp -raf /home/pengdl/Study/tq2440/Python/Python3/tq2440/share . 29 sudo arm-none-linux-gnueabi-strip lib/python* 30 popd 31 32 #sqlite3 33 sudo cp -raf /home/pengdl/Study/tq2440/Python/SQlite/tq2440/bin/* rootfs/bin 34 sudo cp -raf /home/pengdl/Study/tq2440/Python/SQlite/tq2440/include/* rootfs/include 35 sudo cp -raf /home/pengdl/Study/tq2440/Python/SQlite/tq2440/lib/* rootfs/lib 36 sudo cp -raf /home/pengdl/Study/tq2440/Python/SQlite/tq2440/share/* rootfs/usr/share 37 sudo arm-linux-strip rootfs/bin/sqlite3 38 39 #readline 40 sudo cp -raf /home/pengdl/Study/tq2440/Python/Readline/tq2440/include/* rootfs/include 41 sudo cp -raf /home/pengdl/Study/tq2440/Python/Readline/tq2440/lib/* rootfs/lib 42 43 sudo rm -f rootfs/lib/libwv* rootfs/lib/libuniconf* 44 sudo rm -f rootfs/lib/*.a 45 sudo rm -f rootfs/lib/*.la 46 sudo arm-none-linux-gnueabi-strip rootfs/lib/* 47 48 sudo mkdir -p rootfs/dev/ 49 sudo mknod rootfs/dev/tty1 c 4 1 50 sudo mknod rootfs/dev/tty2 c 4 2 51 sudo mknod rootfs/dev/tty3 c 4 3 52 sudo mknod rootfs/dev/tty4 c 4 4 53 sudo mknod rootfs/dev/console c 5 1 54 sudo mknod rootfs/dev/null c 1 3 55 56 sudo rm /nfsroot/rootfs_bak -rf 57 sudo mv /nfsroot/rootfs /nfsroot/rootfs_bak 58 sudo cp ./rootfs /nfsroot/ -raf
其中的etc目录可以到这里下载:http://files.cnblogs.com/files/pengdonglin137/etc.zip
六、测试
-
启动log
1 U-Boot 2015.04-g5095150 (Dec 21 2015 - 06:17:05) 2 CPUID: 32440001 3 FCLK: 400 MHz 4 HCLK: 100 MHz 5 PCLK: 50 MHz 6 I2C: ready 7 DRAM: 64 MiB 8 WARNING: Caches not enabled 9 Flash: 0 Bytes 10 NAND: 256 MiB 11 In: serial 12 Out: serial 13 Err: serial 14 Net: dm9000 15 Hit any key to stop autoboot: 0 16 NAND read: device 0 offset 0x300000, size 0x500000 17 5242880 bytes read: OK 18 NAND read: device 0 offset 0x800000, size 0x100000 19 1048576 bytes read: OK 20 ## Booting kernel from Legacy Image at 30008000 ... 21 Image Name: Linux-4.9.0+ 22 Created: 2017-04-19 9:51:19 UTC 23 Image Type: ARM Linux Kernel Image (uncompressed) 24 Data Size: 3503832 Bytes = 3.3 MiB 25 Load Address: 30008000 26 Entry Point: 30008000 27 Verifying Checksum ... OK 28 ## Flattened Device Tree blob at 32000000 29 Booting using the fdt blob at 0x32000000 30 Loading Kernel Image ... OK 31 Loading Device Tree to 33aa6000, end 33aaa62c ... OK 32 Starting kernel ... 33 Uncompressing Linux... done, booting the kernel. 34 [ 0.000000] Booting Linux on physical CPU 0x0 35 [ 0.000000] Linux version 4.9.0+ (pengdl@ubuntu) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #1 Wed Apr 19 02:51:06 PDT 2017 36 [ 0.000000] CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c000717f 37 [ 0.000000] CPU: VIVT data cache, VIVT instruction cache 38 [ 0.000000] OF: fdt:Machine model: TQ2440 39 [ 0.000000] Memory policy: Data cache writeback 40 [ 0.000000] DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map 41 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 42 [ 0.000000] Kernel command line: noinitrd root=/dev/nfs rw nfsroot=192.168.1.101:/nfsroot/rootfs ethmac=1C:6F:65:34:51:7E ip=192.168.1.6:192.168.1.101:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0,115200n 43 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) 44 [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) 45 [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) 46 [ 0.000000] Memory: 57900K/65536K available (4729K kernel code, 234K rwdata, 1376K rodata, 204K init, 262K bss, 7636K reserved, 0K cma-reserved) 47 [ 0.000000] Virtual kernel memory layout: 48 [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) 49 [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) 50 [ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB) 51 [ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) 52 [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) 53 [ 0.000000] .text : 0xc0008000 - 0xc04a67f0 (4730 kB) 54 [ 0.000000] .init : 0xc0627000 - 0xc065a000 ( 204 kB) 55 [ 0.000000] .data : 0xc065a000 - 0xc0694840 ( 235 kB) 56 [ 0.000000] .bss : 0xc0694840 - 0xc06d60a8 ( 263 kB) 57 [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 58 [ 0.000000] NR_IRQS:103 59 [ 0.000000] irq: clearing pending status 00000002 60 [ 0.000000] _get_rate: could not find clock xti 61 [ 0.000131] sched_clock: 16 bits at 1000kHz, resolution 1000ns, wraps every 32767500ns 62 [ 0.000254] clocksource: samsung_clocksource_timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 29163075 ns 63 [ 0.001154] Console: colour dummy device 80x30 64 [ 0.001358] Calibrating delay loop... 199.47 BogoMIPS (lpj=498688) 65 [ 0.035124] pid_max: default: 32768 minimum: 301 66 [ 0.035715] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) 67 [ 0.035803] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) 68 [ 0.039125] CPU: Testing write buffer coherency: ok 69 [ 0.041720] Setting up static identity map for 0x30008200 - 0x30008258 70 [ 0.067396] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns 71 [ 0.068020] pinctrl core: initialized pinctrl subsystem 72 [ 0.071279] NET: Registered protocol family 16 73 [ 0.074528] DMA: preallocated 256 KiB pool for atomic coherent allocations 74 [ 0.096698] cpuidle: using governor ladder 75 [ 0.097401] No ATAGs? 76 [ 0.357763] SCSI subsystem initialized 77 [ 0.359225] usbcore: registered new interface driver usbfs 78 [ 0.359894] usbcore: registered new interface driver hub 79 [ 0.360865] usbcore: registered new device driver usb 80 [ 0.364272] Advanced Linux Sound Architecture Driver Initialized. 81 [ 0.395750] clocksource: Switched to clocksource samsung_clocksource_timer 82 [ 0.462505] NET: Registered protocol family 2 83 [ 0.466700] TCP established hash table entries: 1024 (order: 0, 4096 bytes) 84 [ 0.466838] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) 85 [ 0.466899] TCP: Hash tables configured (established 1024 bind 1024) 86 [ 0.467514] UDP hash table entries: 256 (order: 0, 4096 bytes) 87 [ 0.467638] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) 88 [ 0.468746] NET: Registered protocol family 1 89 [ 0.547937] RPC: Registered named UNIX socket transport module. 90 [ 0.548047] RPC: Registered udp transport module. 91 [ 0.548062] RPC: Registered tcp transport module. 92 [ 0.548076] RPC: Registered tcp NFSv4.1 backchannel transport module. 93 [ 0.556526] futex hash table entries: 256 (order: -1, 3072 bytes) 94 [ 0.565590] workingset: timestamp_bits=30 max_order=14 bucket_order=0 95 [ 0.699034] NFS: Registering the id_resolver key type 96 [ 0.699281] Key type id_resolver registered 97 [ 0.699297] Key type id_legacy registered 98 [ 0.699372] nfs4filelayout_init: NFSv4 File Layout Driver Registering... 99 [ 0.699649] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. 100 [ 0.709262] romfs: ROMFS MTD (C) 2007 Red Hat, Inc. 101 [ 0.730545] io scheduler noop registered 102 [ 0.730657] io scheduler deadline registered 103 [ 0.732323] io scheduler cfq registered (default) 104 [ 0.947381] 50000000.serial: ttySAC0 at MMIO 0x50000000 (irq = 32, base_baud = 0) is a S3C2440 105 [ 1.387359] random: fast init done 106 [ 1.611283] console [ttySAC0] enabled 107 [ 1.767633] brd: module loaded 108 [ 1.772241] s3c24xx-nand 4e000000.nand: Tacls=1, 10ns Twrph0=3 30ns, Twrph1=1 10ns 109 [ 1.774282] s3c24xx-nand 4e000000.nand: NAND ECC disabled 110 [ 1.780114] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xda 111 [ 1.786112] nand: Samsung NAND 256MiB 3,3V 8-bit 112 [ 1.790528] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 113 [ 1.798195] nand: NAND_ECC_NONE selected by board driver. This is not recommended! 114 [ 1.805811] Scanning device for bad blocks 115 [ 1.835095] Bad eraseblock 364 at 0x000002d80000 116 [ 1.835485] Bad eraseblock 369 at 0x000002e20000 117 [ 1.848196] Bad eraseblock 558 at 0x0000045c0000 118 [ 1.884281] Bad eraseblock 1291 at 0x00000a160000 119 [ 1.909046] Bad eraseblock 1792 at 0x00000e000000 120 [ 1.909215] Bad eraseblock 1793 at 0x00000e020000 121 [ 1.925484] Creating 6 MTD partitions on "tq2440-0": 122 [ 1.925650] 0x000000000000-0x000000100000 : "SPL" 123 [ 1.934143] ftl_cs: FTL header not found. 124 [ 1.941575] 0x000000100000-0x000000200000 : "U-BOOT" 125 [ 1.949569] ftl_cs: FTL header not found. 126 [ 1.954926] 0x000000200000-0x000000300000 : "PARAMS" 127 [ 1.963831] ftl_cs: FTL header not found. 128 [ 1.969370] 0x000000300000-0x000000600000 : "KERNEL" 129 [ 1.978445] ftl_cs: FTL header not found. 130 [ 1.984058] 0x000000600000-0x000000700000 : "DTB" 131 [ 1.993049] ftl_cs: FTL header not found. 132 [ 1.998630] 0x000000700000-0x000010000000 : "ROOTFS" 133 [ 2.010883] ftl_cs: FTL header not found. 134 [ 2.023036] eth0: dm9000e at c4932000,c4934004 IRQ 7 MAC: 00:00:de:ad:be:ef (platform data) 135 [ 2.026768] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver 136 [ 2.032382] ohci-s3c2410: OHCI S3C2410 driver 137 [ 2.039610] s3c2410-ohci 49000000.usb_ohci: OHCI Host Controller 138 [ 2.042708] s3c2410-ohci 49000000.usb_ohci: new USB bus registered, assigned bus number 1 139 [ 2.051552] s3c2410-ohci 49000000.usb_ohci: irq 26, io mem 0x49000000 140 [ 2.124944] hub 1-0:1.0: USB hub found 141 [ 2.127292] hub 1-0:1.0: 2 ports detected 142 [ 2.133433] usbcore: registered new interface driver usb-storage 143 [ 2.136449] mousedev: PS/2 mouse device common for all mice 144 [ 2.141909] s3c-rtc 57000000.rtc: rtc disabled, re-enabling 145 [ 2.145961] rtc rtc0: alarm rollover not handled 146 [ 2.149532] rtc rtc0: invalid alarm value: 1900-2-1 0:0:0 147 [ 2.156227] s3c-rtc 57000000.rtc: rtc core: registered s3c as rtc0 148 [ 2.162236] i2c /dev entries driver 149 [ 2.168574] s3c2410-wdt 53000000.watchdog: watchdog inactive, reset disabled, irq disabled 150 [ 2.175323] sdhci: Secure Digital Host Controller Interface driver 151 [ 2.178802] sdhci: Copyright(c) Pierre Ossman 152 [ 2.185919] hidraw: raw HID events driver (C) Jiri Kosina 153 [ 2.197719] usbcore: registered new interface driver usbhid 154 [ 2.197849] usbhid: USB HID core driver 155 [ 2.206738] NET: Registered protocol family 17 156 [ 2.207505] Key type dns_resolver registered 157 [ 2.272831] s3c-rtc 57000000.rtc: setting system clock to 2000-04-11 20:01:10 UTC (955483270) 158 [ 2.305173] dm9000 20000000.ethernet eth0: link down 159 [ 4.410138] dm9000 20000000.ethernet eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 160 [ 4.412435] IP-Config: Complete: 161 [ 4.415784] device=eth0, hwaddr=00:00:de:ad:be:ef, ipaddr=192.168.1.6, mask=255.255.255.0, gw=192.168.1.1 162 [ 4.425577] host=192.168.1.6, domain=, nis-domain=(none) 163 [ 4.431373] bootserver=192.168.1.101, rootserver=192.168.1.101, rootpath= 164 [ 4.439728] ALSA device list: 165 [ 4.441430] No soundcards found. 166 [ 4.489327] VFS: Mounted root (nfs filesystem) on device 0:12. 167 [ 4.491287] Freeing unused kernel memory: 204K (c0627000 - c065a000) 168 [ 4.496048] This architecture does not have kernel memory protection. 169 Please press Enter to activate this console. 170 [root@tq2440 ]# 171 [root@tq2440 ]# 172 [root@tq2440 ]# ls 173 bin etc lib mnt root sys usr 174 dev include linuxrc proc sbin tmp var
-
测试1
1 [root@tq2440 ]# python3 2 Python 3.6.0 (default, Apr 19 2017, 20:20:18) 3 [GCC 4.8.3 20140320 (prerelease)] on linux 4 Type "help", "copyright", "credits" or "license" for more information. 5 >>> print("Hello World") 6 Hello World 7 >>> import sqlite3 8 >>>
-
测试2
1 [root@tq2440 ]# python3 /usr/lib/python3.6/test/test___all__.py 2 __phello__.foo 3 _bootlocale 4 _collections_abc 5 _compat_pickle 6 _compression 7 _dummy_thread 8 _markupbase 9 _osx_support 10 ... ... 11 . 12 ---------------------------------------------------------------------- 13 Ran 1 test in 97.391s 14 OK
完