设为首页 加入收藏

TOP

裸机移植yaffs2文件系统(一)
2014-11-24 03:17:17 来源: 作者: 【 】 浏览:6
Tags:裸机 移植 yaffs2 文件 系统

将bootstrap.bin文件拷贝到/tfpt目录下

s3c2440开发板上

[ s3c2440@guowenxue ]# set bstarp 'tftp 31000000 bootstrap.bin;go 31000000'

[ s3c2440@guowenxue ]# save

Saving Environment to NAND...

Erasing Nand...

Erasing at 0x60000 -- 100% complete.

Writing to Nand... done

[ s3c2440@guowenxue ]# run bstarp

dm9000 i/o: 0x20000300, id: 0x90000a46

DM9000: running in 16 bit mode

MAC: 08:00:3e:26:0a:6b

could not establish link

operating at 100M full duplex mode

Using dm9000 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.111

Filename 'bootstrap.bin'.

Load address: 0x31000000

Loading: T ##############

done

Bytes transferred = 193924 (2f584 hex)

## Starting application at 0x31000000 ...


Bootstrap nandflash yaffs2 test Version 0.0.1

malloc memory space: 0x30f00000~0x31000000

Malloc address: 30f00008, string: Hello World!


Configures yaffs mount /nand: start block 16, end block 96

'/nand' mounted

Create directory [/nand/foo]

Create File [/nand/foo/f1] content: [foo/f1]

Create File [/nand/foo/f2] content: [foo/f2]

Create File [/nand/foo/f3] content: [foo/f3]

Create File [/nand/foo/f4] content: [foo/f4]

Create directory [/nand/bar]

Create File [/nand/bar/f1] content: [bar/f1]

List folder '/nand' with recursive:

drw- 1 /nand/bar 2048 bytes

-rw- 1 /nand/bar/f1 6 bytes

drw- 1 /nand/foo 2048 bytes

-rw- 1 /nand/foo/f4 6 bytes

-rw- 1 /nand/foo/f3 6 bytes

-rw- 1 /nand/foo/f2 6 bytes

-rw- 1 /nand/foo/f1 6 bytes

drw- 1 /nand/lost+found 2048 bytes

Remove /nand/foo/f4

Remove /nand/bar

List folder '/nand' with recursive:

drw- 1 /nand/foo 2048 bytes

-rw- 1 /nand/foo/f3 6 bytes

-rw- 1 /nand/foo/f2 6 bytes

-rw- 1 /nand/foo/f1 6 bytes

drw- 1 /nand/lost+found 2048 bytes

unmount and remount


List folder '/nand' with recursive:

drw- 1 /nand/lost+found 2048 bytes


代码分析

[fulinux@centos6 yaffs2]$ ls

bootstrap.bin bootstrap.c bootstrap.lds bootstrap.map bsp common makefile start.S yaffs2

[fulinux@centos6 yaffs2]$

先看看make后生成的bootstrap.map文件中主要的段:

Linker script and memory map startsize size

0x0000000000000000 . = ALIGN (0x4)

(.stack xxxxxxxxxxxxxxxxxx xxxx 运行时初始化这个段)

.text 0x0000000031000000 0x2c3dc

.rodata 0x000000003102c3dc 0x2c58

.data 0x000000003102f054 0x10

.bss 0x000000003102f588 0x36b4


其中代码段的第一个代码是start.S

start.S文件

/********************************************************************************************

* File: start.S - Startup Code for ARM920 CPU-core

* Version: 1.0.0

* Copyright: 2011 (c) Guo Wenxue <guowenxue@gmail.com>

* Description: When system power up, the CPU will comes here to excute the first code here.

* ChangeLog: 1, Release initial version on "Tue Jul 12 16:43:18 CST 2011"

*

*******************************************************************************************/



/*

*************************************************************************

*

* Jump vector table as in table 3.1 in [1]

*

*************************************************************************

*/


.globl _start

_start: b start_code


_TEXT_BASE:

.word TEXT_BASE



.globl _armboot_start

_armboot_start:

.word _start


/*

* These are defined in the board-specific linker script.

*/

.globl _bss_start

_bss_start:

.word __bss_start


.globl _bss_end

_bss_end:

.word _end


start_code:

/* Set up the sta

首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇PHP的SO扩展编程入门 下一篇C++你所不知道的sprintf_s与sprin..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)
·索引堆及其优化 - 菜 (2025-12-24 20:18:50)
·Shell 中各种括号的 (2025-12-24 19:50:39)
·Shell 变量 - 菜鸟教 (2025-12-24 19:50:37)