树老大 发表于 2013-5-18 23:41:27

pcDuino的linux移植一

最近pcduino官方公布了kernel源码,很是兴奋,决定开始在pcduino上移植linux系统,有兴趣的一起讨论哈目标:1.移植u-boot 2012.102.移植linux内核3.移植最小文件系统开发环境:系统:ubuntu 10.04.4单板:pcDuino编译器:arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2下面移植pcDuino官方最新公布的u-boot1.获取源码pcDuino提供的u-boot-sunxi https://github.com/pcduino/kernel 下载u-boot-sunxi源码获取交叉编译链 http://code.google.com/p/smp-on-qemu/downloads/list 选择arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2并下载。然后在ubuntu下直接解压即可,还要配置环境变量sudo gedit/etc/environment修改PATH,在最后再加“:/.../arm-2009q3/bin”,其中“...”是上面arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2解压的路径。接着Log Out ubuntu系统,就可以直接使用交叉编译链。2.编译u-boot解压上面下载的u-boot-sunxi-sunxi.zip到工作目录,接着配置单板并编译make pcduino CROSS_COMPILE=arm-none-linux-gnueabi-最后输出如下,编译成功arm-none-linux-gnueabi-ld-g -Ttext 0x50000000 \
   -o hello_world -e hello_world hello_world.o libstubs.o \
   -L/home/change/tools/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1 -lgcc
arm-none-linux-gnueabi-objcopy -O srec hello_world hello_world.srec 2>/dev/null
arm-none-linux-gnueabi-objcopy -O binary hello_world hello_world.bin 2>/dev/null
make: Leaving directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/standalone'
make -C examples/api all
make: Entering directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/api'
make: Nothing to be done for `all'.
make: Leaving directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/api'
make: Leaving directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi'3.烧写、测试上述生成的第一阶段/spl/sunxi-spl.bin 、第二阶段 /u-boot.bin,是支持sd卡启动的,准备tf卡读卡器,连接到PC,下面是烧写命令change@change:~/Si/A10/pcduino/u-boot-sunxi-sunxi$ sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.511973 s, 2.0 MB/s
change@change:~/Si/A10/pcduino/u-boot-sunxi-sunxi$ sudo dd if=spl/sunxi-spl.bin of=/dev/sdb bs=1024 seek=8
20+0 records in
20+0 records out
20480 bytes (20 kB) copied, 0.0134902 s, 1.5 MB/s
change@change:~/Si/A10/pcduino/u-boot-sunxi-sunxi$ sudo dd if=u-boot.bin of=/dev/sd
sda   sda1sda2sda3sda4sda5sda6sdb   
change@change:~/Si/A10/pcduino/u-boot-sunxi-sunxi$ sudo dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32
171+1 records in
171+1 records out
175272 bytes (175 kB) copied, 0.0930407 s, 1.9 MB/s
取下tf卡,插到pcDuino的tf卡槽,接上串口线,pcDuino默认是从sd卡启动的,上电串口输出如下:U-Boot SPL 2012.10 (Apr 19 2013 - 18:46:44)
DRAM: 1024MB
SUNXI SD/MMC: 0
U-Boot 2012.10 (Apr 19 2013 - 18:46:44) Allwinner TechnologyCPU:   SUNXI Family
Board: pcDuino
I2C:   ready
DRAM:1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environmentIn:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:0
sun4i#u-boot基本移植成功,下阶段实现目标二linux内核移植。
转自:http://blog.csdn.net/u010216127/article/details/8825788

topzdx 发表于 2013-8-22 12:04:19

支持移植

潇齐 发表于 2013-9-29 10:15:18

树老大 QQ拒决我呀.....:dizzy:

mouselt 发表于 2014-4-9 19:44:28

:)感谢楼主分享
页: [1]
查看完整版本: pcDuino的linux移植一