Chinaunix首页 | 论坛 | 博客
  • 博客访问: 397496
  • 博文数量: 53
  • 博客积分: 1910
  • 博客等级: 中尉
  • 技术积分: 1130
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-10 14:56
文章分类

全部博文(53)

文章存档

2013年(1)

2012年(17)

2011年(33)

2010年(2)

分类: LINUX

2011-06-02 14:49:48

如何运行到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
阅读(1299) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~