为什么这么做呢?源于虚荣心吧,不过更多的是方便!
设想方案:
方案A:如同引导Linux那样引导ucos,1:使用mkimage加工一下2:tftp下载3:bootm
实施-mkimage使用方法:
- Usage: mkimage -l image
- -l ==> list image header information
- mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
- -A ==> set architecture to 'arch'
- -O ==> set operating system to 'os'
- -T ==> set image type to 'type'
- -C ==> set compression type 'comp'
- -a ==> set load address to 'addr' (hex)
- -e ==> set entry point to 'ep' (hex)
- -n ==> set image name to 'name'
- -d ==> use image data from 'datafile'
- -x ==> set XIP (execute in place)
- mkimage [-D dtc_options] -f fit-image.its fit-image
建立shell脚本mkimage-sh:
- #/bin/bash
- mkimage -n 'kangear' -A arm -O ucos -T kernel -C none -a 0x30008000 -e 0x30008040 -d $1 $2
运行结果:
- [root@localhost uCos2]# ./mkimage-sh 2440ucos2_W35.bin 2440ucos2_W35.img
- Invalid OS Type - valid names are: linux, lynxos, netbsd, rtems, u-boot, qnx, vxworks, integrity, 4_4bsd, dell, esix, freebsd, irix, ncr, openbsd, psos, sco, solaris, svr4
- Usage: mkimage -l image
- -l ==> list image header information
- mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
- -A ==> set architecture to 'arch'
- -O ==> set operating system to 'os'
- -T ==> set image type to 'type'
- -C ==> set compression type 'comp'
- -a ==> set load address to 'addr' (hex)
- -e ==> set entry point to 'ep' (hex)
- -n ==> set image name to 'name'
- -d ==> use image data from 'datafile'
- -x ==> set XIP (execute in place)
- mkimage [-D dtc_options] -f fit-image.its fit-image
在U-BOOT支持的OS列表中并没有ucos,uCLinux看来这种方法行不通了。不过额外收获是OS里边居然有U-BOOT,那就说明把U-BOOT用mkimage加工一下也就可以用U-BOOT启动U-BOOT了。 |