快乐虾
http://blog.csdn.net/lights_joy/
本文适用于
ADI bf561 DSP
uclinux-2008r1.5-rc3(smp patch)
Visual DSP++ 5.0(update 5)
欢迎转载,但请保留作者信息
默认情况下,内核使用了initramfs做为rootfs,而为了将rootfs与内核放在一起,在链接文件ldf中做了一下处理:
.init.ramfs
{
INPUT_SECTION_ALIGN(4)
___initramfs_start = .;
INPUT_SECTIONS($LIBRARIES_SML3_CM(.init.ramfs))
___initramfs_end = .;
} > MEM_UCLINUX_INIT_RAMFS
.init.ramfs这个段其实只有一个数据,那就是rootfs。为此选择rootfs.initramfs这个文件,将之插入到内核中。建一个.s的汇编文件,插入两行代码:
.section .init.ramfs,"a"
.inc/binary "rootfs.initramfs"
这样,就可以将rootfs.initramfs文件的内容放到.init.ramfs段中了。
参考VDSP文档:
INC/BINARY, Include Contents of a File
The .INC/BINARY directive includes the content of file at the current location. You can control the search paths used via the -i command-line switch (click here).
.INC/BINARY [ symbol = ] "filename" [,skip [,count]] ;
.INC/BINARY [ symbol[] = ] "filename" [,skip [,count]] ;
symbol – the name of a symbol to associate with the data being included from the filefilename – the name of the file to include. The argument is enclosed in double quotes.
The skip argument skips a number of bytes from the start of the file.
The count argument indicates the maximum number of bytes to read.
.INC/BINARY sym[] = "bert",10,6;
.INC/BINARY Image1[] = "photos/Picture1.jpg";
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(69):SHARED_MEMORY(2009-02-20)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(70):保留VDSP的heap(2009-02-20)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(71):l1_data_sram_init的疑惑(2009-02-20)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(72):中断时SP的保存(2009-2-22)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(73):.init.setup(2009-02-27)