<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
快乐虾
http://blog.csdn.net/lights_joy/
本文适用于
ADI bf561 DSP
uclinux-2008r1.5-rc3
Visual DSP++ 5.0(update 5)
欢迎转载,但请保留作者信息
添加完head.s后有几个链接错误:
[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'__bss_start [___bss_start]' referenced from 'corea.dlb[head.doj]'
'__bss_stop [___bss_stop]' referenced from 'corea.dlb[head.doj]'
其中__bss_start和__bss_stop在arch/blackfin/kernel/vmlinus.lds.s中定义:
.bss :
{
. = ALIGN(4);
___bss_start = .;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(4);
___bss_stop = .;
__end = .;
}
再看看head.s中对这个两个值的使用:
/* Code update for BSS size == 0
* Zero out the bss region.
*/
p1.l = ___bss_start;
p1.h = ___bss_start;
p2.l = ___bss_stop;
p2.h = ___bss_stop;
r0 = 0;
p2 -= p1;
lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
.L_clear_bss:
B[p1++] = r0;
也就是说,它将把bss段中的所有数据清0,这个和vdsp程序中的bsz是一样的。为此我们在SDRAM中定义一块内存,并将bss段的数据都放到一起:
MEM_UCLINUX_BSS { TYPE(RAM) START(0x00010000) END(0x0001ffff) WIDTH(8) }
MEM_SDRAM_BANK0 { TYPE(RAM) START(0x00020000) END(0x00ffffff) WIDTH(8) }
MEM_SDRAM_BANK1 { TYPE(RAM) START(0x01000000) END(0x01ffffff) WIDTH(8) }
MEM_SDRAM_BANK2 { TYPE(RAM) START(0x02000000) END(0x02ffffff) WIDTH(8) }
MEM_SDRAM_BANK3 { TYPE(RAM) START(0x03000000) END(0x03ffffff) WIDTH(8) }
先从BANK0借64K出来,内存定义后面还要进行修改的,不要着急,呵呵。本来是不应该以64k为单位划分内存的,只不过vdsp的链接器有些BUG,不好使,只好先浪费点空间了。
接下来要在p0里面建一个段:
uclinux_bss ZERO_INIT
{
INPUT_SECTION_ALIGN(4)
___bss_start = .;
INPUT_SECTIONS($LIBRARIES_CORE_A(.bss .bss.*))
INPUT_SECTIONS($LIBRARIES_CORE_A(COMMON))
INPUT_SECTION_ALIGN(4)
. = (. + 3) / 4 * 4;
___bss_stop = .;
__end = .;
} > MEM_UCLINUX_BSS
注意,这里的___bss_start有三个下划线!
再链接,少了两个错误:
[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'_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_pda [_init_pda]' 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]'
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(1):前言(<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(2):代码注释(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(3):vdsp项目创建(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(4):目录差异(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(5):'bf561.h'的问题(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(6):CONFIG_BFIN_KERNEL_CLOCK(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(7):CONFIG_MEM_MT48LC16M16A2TG_75(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(8):CONFIG_CLKIN_HZ(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(9):CONFIG_MEM_SIZE(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(10):CONFIG_FLASH_SPEED_BTT(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(11):__INIT(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(12):trace_buffer_init(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(13):ENDPROC(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(14):__FINIT(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(15):CONFIG_BANK_x(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(16):使用head.s做为入口点(<chsdate w:st="on" year="2009" month="1" day="13" islunardate="False" isrocdate="False">2009-1-13</chsdate>)