1、在common目录下建立一个cmd_hello.c文件

2、仿照/common/cmd_bootm.c文件修改,把cmd_bootm.c头文件复制过来

3、再复制do_bootm、U_BOOT_CMD函数过来

4、代码如下:

#include <common.h>
#include <watchdog.h>
#include <command.h>
#include <image.h>
#include <malloc.h>
#include <zlib.h>
#include <bzlib.h>
#include <environment.h>
#include <asm/byteorder.h>

int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{

int i;

printf("hello,world!,%d\n",argc);

for(i=0;i<argc;i++)

{

printf("argv[%d]:%s/n",i,argv[i]);

}

return 0;

}

U_BOOT_CMD(
 hello, CFG_MAXARGS, 1, do_hello,
 "hello - just for test\n",

"hello ,long help............................\n"
);

5、修改common目录下的Makefile文件,添加cmd_hello.o

u-boot添加一个hello命令的更多相关文章

  1. linux一条命令添加一个root级别账户并设置密码

    内网机器提权添加账户,无回显,设置密码就不好弄,下面就是添加一个root级别的账户并设置密码的命令   ? 1 useradd -p `openssl passwd -1 -salt 'lsof' a ...

  2. 如何基于Spring Boot搭建一个完整的项目

    前言 使用Spring Boot做后台项目开发也快半年了,由于之前有过基于Spring开发的项目经验,相比之下觉得Spring Boot就是天堂,开箱即用来形容是绝不为过的.在没有接触Spring B ...

  3. nova boot添加volume_type参数支持

    早前由于添加了全SSD的高性能Ceph集群,区别于现有的HDD集群,在OpenStack端需要能够选择使用两种集群.Cinder配置多Ceph后端的文档早已整理,整理文件夹时发现这篇为nova boo ...

  4. RK平台Android4.4 添加一个新的遥控器支持以及添加特殊按键【转】

    本文转载自:http://blog.csdn.net/coding__madman/article/details/52904063 版权声明:本文为博主原创文章,未经博主允许不得转载. 瑞芯微平台 ...

  5. N天学习一个linux命令之ip

    用途 show / manipulate routing, devices, policy routing and tunnels 用法 通用格式 ip [ OPTIONS ] OBJECT { CO ...

  6. linux下如何添加一个用户并且让用户获得root权限

    1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 #passwd tommy //修改密码 Changing pass ...

  7. nodejs 编写(添加时间戳)命令行工具 timestamp

    Nodejs除了编写服务器端程序还可以编写命令行工具,如gulp.js就是Nodejs编写的. 接下来我们来实现一个添加时间戳的命令: $ timestamp action https://www.n ...

  8. 每天一个linux命令(46):vmstat命令

    vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写,可对操作系统的虚拟内存.进程.CPU活动进行监控.他是对系统的整体情况进行统计,不足之处是无法对某个进程进行深 ...

  9. spring boot 添加拦截器

    构建一个spring boot项目. 添加拦截器需要添加一个configuration @Configuration @ComponentScan(basePackageClasses = Appli ...

随机推荐

  1. Chapter 2 Open Book——11

    "Hey, Dad, welcome home." hey爸爸,欢迎回家. "Thanks." He hung up his gun belt and step ...

  2. HTML 锚点链接,链接到同一个页面的不同位置

    <html>    <head>        <title></title>    </head>    <body>     ...

  3. hdu_1536_S-Nim(DFS_SG博弈)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1536 题意:首先输入K ,表示一个集合的大小 , 之后输入集合, 表示对于这对石子只能去这个集合中的元 ...

  4. JavaScript学习总结(十七)——Javascript原型链的原理

    一.JavaScript原型链 ECMAScript中描述了原型链的概念,并将原型链作为实现继承的主要方法.其基本思想是利用原型让一个引用类型继承另一个引用类型的属性和方法.在JavaScript中, ...

  5. TypeConverter的使用

    我们知道,C#中有int.Parse,int.TryParse这样神奇的功能,那它们又是如何做到的呢?我们试着自己也来自定义一个“转换器”. 首先,定义一个类: public class Human ...

  6. rndc 错误解决 和 远程配置

    dc: connect failed: connection refusedrndc: connect failed: connection refused 解决办法:默认安装BIND9以后,是无法直 ...

  7. 前台改变asp button控件的值,后台取值没有改变的问题

    前台: <asp:Button ID="btnEdit" Style="margin-left: 600px;" runat="server&q ...

  8. 使用SQL Server Management Studio 创建作业备份数据库

    在项目中,经常需要备份数据库,如果能做到只需点个按钮(“开始备份数据库”按钮),然后什么都不管,数据库就自动备份好了,或者服务器上的数据库隔一段时间自动备份一次,那该多好啊. Sql server 的 ...

  9. transform 属性小解

    css中transform包括三种: 旋转rotate(), translate()移动, 缩放scale(), skew()扭曲以及矩形变换matrix() 语法: transform: none ...

  10. background和background-position相关笔记

    background 可在一个声明中设置background-color,background-image,background-repeat,background-attachment,backgr ...