創建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已經開始起作用了。
uclinux-2008R1-RC8(bf561)到VDSP5的移植(62)
uclinux-2008R1-RC8(bf561)到VDSP5的移植(61):KBUILD_MODNAME
uclinux-2008R1-RC8(bf561)到VDSP5的移植(60):current_text_addr
uclinux-2008R1-RC8(bf561)到VDSP5的移植(58)
uclinux-2008R1-RC8(bf561)到VDSP5的移植(57)
uclinux-2008R1-RC8(bf561)到VDSP5的移植(52):cache.s的問題