uboot中bootargs实现
setup.h通过宏定义实现了bootargs传递参数到内核,值得以后编程学习。
include/asm-arm/setup.h
14 * NOTE:
15 * This file contains two ways to pass information from the boot
16 * loader to the kernel. The old struct param_struct is deprecated,
17 * but it will be kept in the kernel for 5 years from now
18 * (2001). This will allow boot loaders to convert to the new struct
19 * tag way.
The new way of passing infomation: a list of tagged eneries.
208 struct tag {
209 struct tag_header hdr;
210 union {
211 struct tag_core core;
212 struct tag_mem32 mem;
213 struct tag_videotext videotext;
214 struct tag_ramdisk ramdisk;
215 struct tag_initrd initrd;
216 struct tag_serialnr serialnr;
217 struct tag_revision revision;
218 struct tag_videolfb videolfb;
219 struct tag_cmdline cmdline;
220
221 /*
222 * Acorn specific
223 */
224 struct tag_acorn acorn;
225
226 /*
227 * DC21285 specific
228 */
229 struct tag_memclk memclk;
230 } u;
231 };
232
233 struct tagtable {
234 u32 tag;
235 int (*parse)(const struct tag *);
236 };
实现参数遍历:
238 #define __tag __attribute__((unused, __section__(".taglist")))
239 #define __tagtable(tag, fn) \
240 static struct tagtable __tagtable_##fn __tag = { tag, fn }
241
242 #define tag_member_present(tag,member) \
243 ((unsigned long)(&((struct tag *)0L)->member + 1) \
244 <= (tag)->hdr.size * 4)
245
246 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
247 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
248
249 #define for_each_tag(t,base) \
250 for (t = base; t->hdr.size; t = tag_next(t))
具体应用在lib_arm/bootm.c
uboot中bootargs实现的更多相关文章
- u-boot中分区和内核MTD分区关系
一.u-boot中环境变量与uImage中MTD的分区关系 分区只是内核的概念,就是说A-B地址放内核,C-D地址放文件系统,(也就是规定哪个地址区间放内核或者文件系统)等等. 一般我们只需要分3-4 ...
- 在uboot中加入cmd_run命令,运行环境变量
在学习uboot的过程中会经常烧录程序,每次都要敲一些下载指令.这样是不是很麻烦,有什么办法能快速的烧写呢.很简单,将需要敲击的指令编译到uboot中,以环境变量的形式存在.但是环境变量很好加,如何运 ...
- uboot中变量env(收集)
Env在u-boot中通常有两种存在方式,在永久性存储介质中(flash.NVRAM等),在SDRAM中.可配置不适用env的永久存储方式,但不常用.U-boot在启动时会将存储在永久性存储介质中的e ...
- u-boot中环境变量的实现
转载:http://blog.chinaunix.net/uid-28236237-id-3867041.html U-boot中通过环境参数保存一些配置,这些配置可以通过修改环境参数.保存环境参数. ...
- 关于NAND flash的MTD分区与uboot中分区的理解
关于NAND flash的MTD分区与uboot中分区的理解 转自:http://blog.csdn.net/yjp19871013/article/details/6933455?=40085044 ...
- u-boot中添加mtdparts支持以及Linux的分区设置
简介 作者:彭东林 邮箱:pengdonglin137@163.com u-boot版本:u-boot-2015.04 Linux版本:Linux-3.14 硬件平台:tq2440, 内存:64M ...
- uboot中添加自定义命令
uboot中可以通过修改源程序来添加自定义命令,进一步扩展uboot的功能. 我想在uboot下添加一条新的命令(名为varcpy),用来拷贝uboot中的环境变量. 修改方式如下: 创建新文件com ...
- uboot中setenv和saveenv分析
转:https://blog.csdn.net/weixin_34355715/article/details/85751477 Env在u-boot中通常有两种存在方式,在永久性存储介质中(flas ...
- uboot中添加FIQ中断及相关问题
本文主要说明了在uboot中添加FIQ中断时遇到的问题以及对应的解决办法. 首先交代一下项目的软硬件环境.硬件方面,使用s3c2440作为主控芯片,外接串口.网卡等设备.软件方面,主控芯片上电后运行u ...
随机推荐
- django和mysql
一.在python2中使用mysql django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No mod ...
- 网站跳转到cgi-sys/defaultwebpage.cgi的原因和解决方式
cpanel遇到这种问题,看了这篇文章老鹰主机域名解析A记录教程–关于cgi-sys/defaultwebpage.cgi后,尝试后 首先ping 域名,结果如下 看到没有ping结果 ...
- Chrome 错误代码:ERR_UNSAFE_PORT
最近在用Nginx发布多个站点测试,使用了87.88端口, 88端口访问正常,87端口就怎么也访问不了, 点击更多,提示错误代码:ERR_UNSAFE_PORT 不安全的端口?尼玛就只靠端口就能解决不 ...
- WebDav的java客户端开发包:Jackrabbit
上一篇帖子“WebDav的java客户端开发包:sardine”中说到,对于开发WebDav客户端 sardine是一个很好的选择,但sardine并未实现WevDav的全部规范,所以我又试了试 ap ...
- UVa 10298 - Power Strings
题目:求一个串的最大的循环次数. 分析:dp.KMP,字符串.这里利用KMP算法. KMP的next函数是跳跃到近期的串的递归结构位置(串元素取值0 ~ len-1): 由KMP过程可知: 假设存在循 ...
- win7下安装ubuntu双系统的方法及心得体会(ps:要死好几回的节奏)
1.win7下安装ubuntu系统后,可以很好进入ubuntu系统 但是进不去win7,开机有win7选项,但是选择后不管用 方法思路:各种修复win7的mbr 我的问题是:在winpe中发现,根本看 ...
- 使用SplashScreenManager控件定制程序加载页面
需要devexpress版本在12.0及以上才支持 https://www.cnblogs.com/wuhuacong/p/6112461.html 在DevExpress程序中使用SplashScr ...
- spring中AOP
1 AOP 的功能是把横切的问题(如性能监视.事务管理)模块化.AOP的核心是连接点模型,他提供在哪里发生横切. Spring AOP 的底层是通过使用 JDK 或 CGLib 动态代理技术为目标 b ...
- MongoDB查询指定字段(field)返回指定字段的方法
使用MongoDB的时候需要只查询指定的字段进行返回,也就是类似mysql里面的 SELECT id,name,age 这样而不是SELECT *.在MongoDB里面映射(projection)声明 ...
- openvpn证书吊销
声明变量source ./vars使用revoke-full命令吊销客户端证书./revoke-full client-name(common name)命令执行后,我们能在keys目录中找到一个文件 ...