`
xiaoer_1982
  • 浏览: 1819600 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(74):initramfs

阅读更多

快乐虾

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";

1 参考资料

uclinux-2008R1.5-RC3(bf561)VDSP5的移(69)SHARED_MEMORY(2009-02-20)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(70):保留VDSPheap(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)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics