快乐虾
http://blog.csdn.net/lights_joy/
lights@hb165.com
本文适用于
ADI bf561 DSP
uclinux-2008r1.5-rc3 (移植到vdsp5)
Visual DSP++ 5.0(update 5)
欢迎转载,但请保留作者信息
linux-2.6.x\arch\blackfin\mach-bf561\head.S是uclinux的入口点,uclinux的第一条语句就是从__start这个入口开始执行的,本文分析的就是head.s这个文件。
/* R0: argument of command line string, passed from uboot, save it */
R7 = R0;
这一行看起来很简单,实际上涉及到很多内容。
首先要知道的是R0保存的是什么东西。由于uclinux是由u-boot这类的bootloader进行引导的,这类程序通常需要将内核解压缩到一个指定的地址,然后通过一个函数调用将控制权交给内核,通常还要传递一个”console=/dev/ttyBF0”之类的字符串给内核,R0就保存了这个字符串的头指针,因此这行代码先把这个指针保存起来。
下面的代码来自于u-boot-1.1.6-2008R1.5\lib_blackfin\boot.c,从中可以看出这个参数的传递过程:
void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
ulong addr, ulong *len_ptr, int verify)
{
int (*appl) (char *cmdline);
char *cmdline;
#ifdef SHARED_RESOURCES
swap_to(FLASH);
#endif
appl = (int (*)(char *))ntohl(header.ih_ep);
printf("Starting Kernel at = %x\n", appl);
cmdline = make_command_line();
if (icache_status())
icache_disable();
if (dcache_status())
dcache_disable();
(*appl) (cmdline);
}
全局变量header中存放了压缩的uClinux映象文件的信息(参见《用u-boot引导uclinux》一文),ip_ep这个成员存放的就是uClinux解压后的入口点的地址,所以在此直接将它赋给appl作为函数指针。而cmdline这个变量存放的就是要传递给uClinux的参数,它是一个字符串。
关键的调用是由(*appl)(cmdline);来完成的,看看它的汇编代码:
R0 = [FP – 4];
P1 = [FP – 8];
CALL(P1);
[FP-4]存放的就是cmdline这个局部变量的值,而[FP-8]存放的则是app1这个局部变量的值。也就是说,编译器是将要传递的字符串参数指针放在R0中的。
在保存了这个指针之后,uclinux在下面还要将这个指针指向的内容复制到uclinux自己的数据段中。
分享到:
相关推荐
elasticsearch-head-compile-after.tar.gz+node-v8.1.2-linux-x64.ta
ELK: elasticsearch-7.6.1-linux-x86_64.tar.gz filebeat-7.6.1-linux-x86_64.tar.gz ...elasticsearch-head-compile-after.tar.gz elasticsearch-head-master.zip ik分词器: elasticsearch-analysis-ik-7.6.1.zip
功能是对编译好的u-boot再次添加一个文件头,以保证在emmc和tf卡中能够正确的运行。
head first android development: a brain-friendly guide 2nd edition,英文第二版,清晰无水印,带书签
1. <s:head/>-----在<head></head>里使用,表示头文件结束 2. <s:hidden></s:hidden>-----隐藏值 I: 1. <s:i18n name=""></s:i18n>-----加载资源包到值堆栈 2. <s:include value=""></s:include>-----包含...
arm-linux head.S 源代码分析 arm-linux head.S 源代码分析
elasticsearch-6.1.2.tar.gz,elasticsearch-5.5.2.tar和head插件 linux下安装软件,下载后即可安装使用
176.1M2017-10-10 21:13 Head First HTML5 Programming.pdf 65.2M2017-10-10 21:13 Head First Excel.pdf 176.1M2017-10-10 21:13 Head First C.pdf 110.2M2017-10-10 21:13 Head First C#.pdf 338.9M2017-10-10 21:...
head.first.java 中文版1-3 章
2022年7月9号从官网上最新下载 在window 环境可以安装,亲测可用 node-v16.16.0-x64.msi elasticsearch-head-master.zip
head.first.java 中文版15-18章.rar 包可以看
Head.First.设计模式-中文版-带目录Head.First.设计模式-中文版-带目录Head.First.设计模式-中文版-带目录Head.First.设计模式-中文版-带目录Head.First.设计模式-中文版-带目录
| | |-- head.S | | |-- include | | | |-- ctype.h | | | |-- gcclib.h | | | |-- kernel.h | | | |-- stdio.h | | | |-- string.h | | | |-- system.h | | | `-- types.h | | |-- init.c | | |-- interrupt.c | | ...
嵌入式,Source-Insight建立Uboot工程
该文档主要是elasticsearch7.x版本的安装及集群配置,配合head,ik插件的安装。【备注,配置参数更新如下: cluster.name: es-7 node.name: t-1 network.host: 10.96.141.45 http.port: 9200 transport.tcp.port: ...
Head.First.design.patterns-中文超清.pdf Head.First.design.patterns-中文超清.pdf
Linux 0.00 intel 汇编语法,包含boot.s,head.s,以及编译添加汇编地址的对应文件,可通过NASM进行编译,
关于Linux启动项bootsect、setup、head的阅读心得,和常遇的问题与解决。
- handled ts file larger then 800M by only process the first 800M data - added "defrag" by delete the broken packet or otvheader at head or tail of ts file <br/>2002.06.09: alpha 0.1.3 -...
ElasticSearch-head(后续简称es-head)是ElasticSearch的一个插件,提供了es 的可视化操作界面.