在 Target 端做測試

From JK2410.org

Jump to: navigation, search

本步驟以 Jollen-Kit! 為例,Jollen-Kit! 是由 www.jollen.org 所推出的 ARM9 training board,詳細介紹請參考 [1]。請注意,本階段的操作,視 target device 的不同而不同,因此以下示範只適用於 Jollen-Kit! 或是其他的 SMDK2410 平臺。

步驟 8 所得到的 ext2.gz 必須再包裝成 U-Boot 的格式,才能透過 U-Boot 載入到 RAM,以成為 kernel 的 initial ramdisk(initrd):

# mkimage -A arm -O linux -T ramdisk -C none -a 0x30800000 -e 0x30800000 -n ramdisk -d ext2fs.gz urootfs.img

mkimage的參數使用說明可以由mkimage (不接任何參數)得到

# mkimage
-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)

其中特別要注意的是當製作kernel映像檔時,使用-T kernel -a 0x30008000 -e 0x30008000;製作rootfs映像檔時,使用-T ramdisk -a 0x30800000 -e 0x30800000。

執行mkimage後可得到 urootfs.img 檔案,在測試階段為了方便起見,我們可以直接將 urootfs.img 載到 RAM 做測試;U- Boot 指令如下:

jollen.org # tftpboot 32000000 urootfs.img; tftpboot 30F00000 uimage.img; bootm 30F00000  32000000 

urootfs.img 是我們製作的 root filesystem,uimage-*.img 則是給 Jollen-Kit! 使用的 Linux kernel(pre-built)。

Views
個人工具
導航
工具