在u-boot中添加命令hello
来源:互联网 发布:ansys14.5软件下载 编辑:程序博客网 时间:2024/06/06 02:45
在u-boot中添加命令hello
1. 在common目录下添加文件cmd_hello.c
#include <common.h>
#include <command.h>
int do_hello(cmd_tbl_t *cmdtp, int flag , int argc, char *argv[])
{
printf(“Hello World\n”);
}
U_BOOT_CMD(
hello, CONFIG_SYS_MAXARGS, 1, do_hello,
“hello - my hello command\n”,
“hello world\n”
);
2. 修改common/Makefile,添加如下内容
COBJS-y += cmd_hello.o
1. 在common目录下添加文件cmd_hello.c
#include <common.h>
#include <command.h>
int do_hello(cmd_tbl_t *cmdtp, int flag , int argc, char *argv[])
{
printf(“Hello World\n”);
}
U_BOOT_CMD(
hello, CONFIG_SYS_MAXARGS, 1, do_hello,
“hello - my hello command\n”,
“hello world\n”
);
2. 修改common/Makefile,添加如下内容
COBJS-y += cmd_hello.o
备注:
#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,repeatable,command,"usage","help")
name: is the name of the commad. THIS IS NOT a string.
maxargs: the maximumn numbers of arguments this function takes
command: Function pointer (*cmd)(struct cmd_tbl_s *, int, int, char *[]);
usage: Short description. This is a string
help: long description. This is a string
每一个 U-Boot 命令有一个结构体来描述。结构体包含的成员变量:命令名称、最大参,数个数、重复数、命令执行函数、用法、帮助。
而相关命令的具体执行在uboot/common/cmd_xxxx.c文件中实现的。
- 在u-boot中添加命令hello
- 在U-boot中添加加命令
- 在U-boot中添加加命令
- 在u-boot中添加命令
- 在u-boot中添加命令
- 在U-boot中添加命令
- 在U-Boot中添加命令
- 如何在u-boot中添加命令
- 在u-boot中添加命令
- u-boot中添加命令
- 在U-boot-1.3.4中添加加命令
- 在u-boot下添加自定义命令
- u-boot中添加自定义命令
- u-boot中添加自定义命令
- U-boot中mtdparts命令添加
- 【记录】u-boot中添加命令
- 添加u-boot命令
- 添加U-Boot命令
- ABAP调用外部WebService
- E:Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
- animation效果
- 学习日志--自定义控件
- Java String相关
- 在u-boot中添加命令hello
- Struts2的Convention插件的好处与使用
- 分别使用递归和非递归实现二分查找算法
- android的窗口机制分析------事件处理
- 递归练习
- hdu 1025 Constructing Roads In JGShining's Kingdom(最长上升序列n*logn算法)
- POJ 2377 最大生成树
- ffmpeg的使用
- POJ3630-静态字典树