添加一个简单的命令,yinming,打印helloworld
1 common/yinming.c
/*
* Command for accessing DataFlash.
*
* Copyright (C) 2008 Atmel Corporation
*/
#include <common.h>
static int do_yinming(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
printf("hello world\n");
return 1;
}
U_BOOT_CMD(
yinming, 2, 1, do_yinming,
"yinming make uboot cmd exercise",
"yinming make uboot cmd exercise");
2 common/Makefile
# command
COBJS-$(CONFIG_CMD_YINMING) += cmd_yinming.o
COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
3 include/configs/配置文件.h
/***********************************************************
* Command definition
***********************************************************/
#include <config_cmd_default.h>
#define CONFIG_CMD_YINMING 1
#define CONFIG_CMD_PING
4 重新编译uboot
OK