新闻  |   论坛  |   博客  |   在线研讨会
uclinux到VDSP5的移植(4):使用head.s做为入口(ZT)
moran | 2008-08-07 16:32:31    阅读:1293   发布文章

 
创建uclinux工程时,默认的入口是uclinux-2008r1-rc8_basiccrt.s,而我们需要用head.s做为入口,因此需要修改ldf文件中的相关定义。
在uclinux-2008r1-rc8.ldf文件中有这么几行:
$OBJECTS_CORE_A =
 
/*$VDSG<insert-user-objects-for-coreA-beginning>                */
/* Text inserted between these $VDSG comments will be preserved */
/*$VDSG<insert-user-objects-for-coreA-beginning>                */
 
   ".\Debug\uclinux-2008r1-rc8_basiccrt.doj"
   , RT_LIB_NAME(profile561)
   , $COMMAND_LINE_OBJECTS {!DualCoreMem("CoreB")}
   , "cplbtab561a.doj"
   , RT_OBJ_NAME(crtn561)
在此先删除uclinux-2008r1-rc8_basiccrt.doj,于是就变成了
$OBJECTS_CORE_A =
 
/*$VDSG<insert-user-objects-for-coreA-beginning>                */
/* Text inserted between these $VDSG comments will be preserved */
/*$VDSG<insert-user-objects-for-coreA-beginning>                */
 
   RT_LIB_NAME(profile561)
   , $COMMAND_LINE_OBJECTS {!DualCoreMem("CoreB")}
   , "cplbtab561a.doj"
   , RT_OBJ_NAME(crtn561)
此外,还要在processor p0中保留__start的位置。在默认生成的LDF文件中,是这样的:
   RESOLVE(start, 0xFFA00000)
   KEEP(start,_main)
我们将其指向head.s中的__start,修改后变成:
   RESOLVE(__start, 0xFFA00000)
   KEEP(__start,_main)
当然,这样修改后会造成一系列的错误:
        'CONFIG_BANK_0' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_1' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_2' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_3' referenced from 'corea.dlb[head.doj]'
        'V_AMBEN' referenced from 'corea.dlb[head.doj]'
        '__bss_start [___bss_start]' referenced from 'corea.dlb[head.doj]'
        '__bss_stop [___bss_stop]' referenced from 'corea.dlb[head.doj]'
        '_sdata [__sdata]' referenced from 'corea.dlb[head.doj]'
        '_stext [__stext]' referenced from 'corea.dlb[head.doj]'
        'bf53x_relocate_l1_mem [_bf53x_relocate_l1_mem]' referenced from 'corea.dlb[head.doj]'
        'cmdline_init [_cmdline_init]' referenced from 'corea.dlb[head.doj]'
        'init_thread_union [_init_thread_union]' referenced from 'corea.dlb[head.doj]'
        'start_kernel [_start_kernel]' referenced from 'corea.dlb[head.doj]'
没关系,这正好说明我们的head.s已经开始起作用了。

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
推荐文章
最近访客