快乐虾http://blog.csdn.net/lights_joy/lights@hb165.com本文适用于ADI bf561 DSP优视BF561EVB开发板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). Syntax:.INC/BINARY [symbol = ] "filename" [,skip [,count]] ; .INC/BINARY [symbol[] = ] "filename" [,skip [,count]] ; where 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. Example:.SECTION data1;.VAR jim;.INC/BINARY sym[] = "bert",10,6;.VAR fred;.INC/BINARY Image1[] = "photos/Picture1.jpg";