最近pcduino官方公布了kernel源码,很是兴奋,决定开始在pcduino上移植linux系统,有兴趣的一起讨论哈 目标: 1.移植u-boot 2012.10 2.移植linux内核 3.移植最小文件系统 开发环境: 系统:ubuntu 10.04.4 单板:pcDuino 编译器:arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 下面移植pcDuino官方最新公布的u-boot 1.获取源码 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[2]: Leaving directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/standalone'
make -C examples/api all
make[2]: Entering directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/api'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/change/Si/A10/pcduino/u-boot-sunxi-sunxi/examples/api'
make[1]: 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 sda1 sda2 sda3 sda4 sda5 sda6 sdb
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 Technology
CPU: SUNXI Family
Board: pcDuino
I2C: ready
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
sun4i# u-boot基本移植成功,下阶段实现目标二linux内核移植。
转自:http://blog.csdn.net/u010216127/article/details/8825788
|