DSP

uclinux-2008R1-RC8(bf561)到VDSP5的移植(54): initramfs

2019-07-13 16:56发布

  快乐虾 http://blog.csdn.net/lights_joy/ lights@hb165.com      本文适用于 ADI bf561 DSP 优视BF561EVB开发板 uclinux-2008r1-rc8 (移植到vdsp5) Visual DSP++ 5.0   默认情况下,2008r1版本的内核使用了initramfs做为rootfs,而为了将rootfs与内核放在一起,在链接文件ldf中做了一下处理:                INPUT_SECTION_ALIGN(4)              ___initramfs_start = (. + 3) / 4 * 4;              INPUT_SECTIONS($LIBRARIES_UCLINUX(.init.ramfs))              ___initramfs_end = .; 再看一下.init.ramfs这个段的数据来源: 在usr目录下有一个叫initramfs_data.S的文件,就两句话: .section .init.ramfs,"a" .incbin "/usr/initramfs_data.cpio.gz" 其意思无非就是说将initramfs_data.cpio.gz这个文件的内容读出来放在.init.ramfs这个段中。 但是在VDSP下使用时出现一个可恶的问题,老是提示无法找到规则编译initramfs_data.cpio.gz。况且在VDSP下也不支持.incbin,而是支持.inc/binary,因此直接将这两行代码复制到arch/blackfin/fixed_code.s中,并修改为: .section .init.ramfs,"a" .inc/binary "../../usr/initramfs_data.cpio.gz" 这样,就可以将initramfs_data.cpio.gz文件中的内容放到.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";