2011年12月16日 星期五

Linux指令筆記

samba mount
mount -t cifs //ip/path /localpath -o username=user,password=pass

2011年12月2日 星期五

[轉貼] mkimage使用詳解

uboot源代碼的tools/目錄下有mkimage工具,這個工具可以用來製作不壓縮或者壓縮的多種可啟動映像檔案。

mkimage在製作映像檔案的時候,是在原來的可執行映像檔案的前面加上一個0x40位元組的頭,記錄參數所指定的訊息,這樣uboot才能識別這個映像是針對哪個CPU體系架構的,哪個OS的,哪種類型,加載內存中的哪個位置,入口點在內存的那個位置以及映像名是什麼

root@Glym:/tftpboot# ./mkimage
Usage: ./mkimage -l image
-l ==> list image header information
./mkimage -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)
參數說明︰

-A 指定CPU的體系架構︰

取值 表示的體系架構
alpha Alpha 
arm A RM 
x86 Intel x86
ia64 IA64
mips MIPS
mips64 MIPS 64 Bit
ppc PowerPC
s390 IBM S390
sh SuperH
sparc SPARC
sparc64 SPARC 64 Bit
m68k MC68000

-O 指定作業系統類型,可以取以下值︰
openbsd、netbsd、freebsd、4_4bsd、linux、svr4、esix、solaris、irix、sco、dell、ncr、lynxos、vxworks、psos、qnx、u-boot、rtems、artos

-T 指定映像類型,可以取以下值︰
standalone、kernel、ramdisk、multi、firmware、script、filesystem

-C 指定映像壓縮模式,可以取以下值︰
none 不壓縮
gzip 用gzip的壓縮模式
bzip2 用bzip2的壓縮模式

-a 指定映像在內存中的加載位址,映像下載到內存中時,要按照用mkimage製作映像時,這個參數所指定的位址值來下載

-e 指定映像營運的入口點位址,這個位址就是-a參數指定的值加上0x40(因為前面有個mkimage添加的0x40個位元組的頭)

-n 指定映像名

-d 指定製作映像的源檔案
Reference from http://www.wretch.cc/blog/poemsoul/15441093