如何运行到okl4 2.1 app _start

1406阅读 0评论2011-06-02 liu090
分类:LINUX

如何运行到okl4 2.1 app _start

  • 每个okl4 app 都有个_start ,包含到 _sys_entry 的跳转,碰到个问题 ,有个app 没跑起来,不确定是否跑到了_start,跟了下,没发觉有这样的代码
  • 因为每个app 开始也总是一个thread, 但是代码里没有显示thread 创建过程,查到weaver 的代码,大体情况如下:
  • 在对各个elf 用weaver 生成 boot image 时会判断如果,app 带有_start entry 那么就对它在bootinfo 中创建一个main thread(占个位置),root server 跑起来后,调度会切换到当前那个可运行的,app 的thread. 就是那个_start 开始的地方, 如果跑iguana server 这件事情就由server 开始的时候帮你做掉了,跟下bi_execute 就可以看到bootinfo 解析时候有创建thread,如果跑rootserver 就需要自己call bootinfo_parse 来实现parse bootinfo 然后创建包含在bootinfo 中的thread
  • 具体代码和注释见 collect_thread 代码:

(tools\pyelf\weaver\prog_pd_xml.py)

collect_thread
HACK: There is no easy way for a PD to specify the main thread, so is the user entry point is '_start' (the traditional entry point symbol), then start there rather then the thread entry point.
(iguana\server\src\main.c)
bi_execute
上一篇:生成openmoko gta01 模拟器 ,运行okl4 image
下一篇:ADB push 文件通讯包的device端分析