u-boot-1.2.0 移植粗解 - bycore的blog
#ifdef CFG_LONGHELP
char *help; /* Help message (long) */
#endif
#ifdef CONFIG_AUTO_COMPLETE
/* do auto completion on the arguments */
int (*complete)(int argc, char *argv[], char last_char, int maxv, char *cmdv[]);
#endif
};
其中Cmd就是实际需要调用的命令函数!name为该命令名字符串(比如go,bootm等)。 在command.h里面还一个叫U_BOOT_CMD的宏。
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage, help}
这段代码的意思是说,对于U_BOOT_CMD(name,maxargs,rep,cmd,usage,help)来说,就是定义一个cmd_tbl_t(cmd_tbl_t就是struct cmd_tbl_s)类型的__u_boot_cmd_name变量,并将此变量放到.
u_boot_cmd段,.u_boot_cmd的定义可以在board/yourboard/u-boot.lds找到。在U-boot中的shell中,根据用户输入的命令,就会在.u_boot_cmd这个内存区域中查找,当.u_boot_cmd中某一个cmd_tbl_s命令结构体的cmd_tbl_s.name和输入的命令字符串相符时,就调用该命令。
下面以添加mycmd命令为例说明方法。
1). 在include/configs/xxxx.h中的CONFIG_COMMDNDS中增加一项CFG_ CMD_MYCMD:
CFG_CMD_USBLOAD,
/***********************************************************
* Command definition
***********************************************************/
#define CONFIG_COMMANDS \
(CONFIG_CMD_DFL | \
CFG_CMD_CACHE | \
CFG_CMD_NET | \
CFG_CMD_ENV | \
CFG_CMD_FLASH | \
CFG_CMD_PING | \
CFG_CMD_NAND | \
/*CFG_CMD_EEPROM |*/ \
/*CFG_CMD_I2C |*/ \
/*CFG_CMD_USB |*/ \
CFG_CMD_REGINFO | \
CFG_CMD_DATE | \
CFG_CMD_ELF |\
CFG_ CMD_MYCMD
)
.2.tar.gz) () Uboot:u-boot-1.2.0(下载地址:ftp://ftp.denx.de/pub/u-boot/) : (下载地址: ) 先说明一下,移植过程按照 tekkaman 的 blog 移植...
u-boot-1.1.6移植笔记_IT/计算机_专业资料。因...Core */ #define CONFIG_S3C2410 1 /* in a ...http://blog.chinaunix.net/u1/34474/showart_...
3 mini2440 的 u-boot 移植 1、建立自己的开发...Core*/ /* in a SAMSUNG S3C24x0-type SoC*/ ...by setting all bits in the INTMR – default *...
几经艰辛,终于基本完成了 u-boot 在 s3c44b0 的移植工作,在些记录一下在移植...参考资料: http://blog.21ic.com/more.asp?name=sockit&id=8509 我所认为...
bootloader与u-boot移植_信息与通信_工程科技_专业...{ struct tag_core struct tag_mem32 core; mem;...命令、加/解写保护命令 protect、擦除命令 erase。...
u-boot-2014.04移植手册(TQ2440)_计算机硬件及...Core */ /* in a SAMSUNG S3C24x0-type SoC *...PCLK = 1:2:4 */ /* default FCLK is 120 ...
嵌入式Linux之我行 史上最牛最详细的uboot移植,...Core */ #define CONFIG_S3C2410 #define CONFIG_...[r0] /* * mask all IRQs by setting all ...
移植u-boot-2009.11: 参考:http://blog.china...Core /* in a SAMSUNG S3C2410 SoC /* on a ...[ r0] /* * mask all IRQs by setting all ...
uboot移植到具体板上的详解_IT/计算机_专业资料。uboot移植到s3c2440的具体解析。本文从以下几个方面粗浅地分析 u-boot 并移植到 FS2410 板上: 1、u-boot ...
热门文档