uboot最简单命令hello

来源:互联网 发布:怎么解绑淘宝账号 编辑:程序博客网 时间:2024/05/14 23:11
#include <common.h>#include <command.h>static void do_hello(){printf("hello the world!\n");}U_BOOT_CMD(hello, 1, 0, do_hello,"It is just a cmd example and print hello the world!\n","no related help infomation/n"); 
将上面一段代码,以cmd_hello.c命名,放在uboot/common目录中,修改common目录中的Makefile,在对应的地方照葫芦画瓢,添加 COBJS-y +=cmd_hello.o,再编译uboot,烧进Nand中,进入uboot,用?可以看到hello命令出现。
原创粉丝点击