linux ramdisk根文件系统,从ramdisk根文件系统启动Linux成功

7.下载内核映像和ramdisk映像

DRAM:  64 MB

Flash: 512 kB

In:    serial

Out:   serial

Err:   serial

whj2440 # printenv

bootargs=root=ramfs devfs=mount console=ttySA0,9600

bootdelay=3

baudrate=115200

ethenv=00:01:02:03:04:05

filesize=1da248

fileaddr=32000000

netmask=255.255.255.0

ipaddr=202.205.85.164

serverip=202.205.85.165

stdin=serial

stdout=serial

stderr=serial

Environment size: 248/65532 bytes

whj2440 # tftp 31000000 uImage

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

MAC: 00:80:00:80:00:80

TFTP from server 202.205.85.165; our IP address is 202.205.85.164

Filename 'uImage'.

Load address: 0x31000000

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

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#

done

Bytes transferred = 2329916 (238d3c hex)

whj2440 # tftp 32000000 ramdisk.gz

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

MAC: 00:80:00:80:00:80

TFTP from server 202.205.85.165; our IP address is 202.205.85.164

Filename 'ramdisk.gz'.

Load address: 0x32000000

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

#################################################################

#############################################

done

Bytes transferred = 891755 (d9b6b hex)

8.使用ramdisk根文件系统启动内核

whj2440 # bootm31000000

## Booting image at 31000000 ...

Image Name:   Linux-2.6.32.2-ARMofWHJ

Created:      2011-09-06  22:48:18UTC

Image Type:   ARM Linux Kernel Image (uncompressed)

Data Size:    2329852 Bytes =  2.2 MB

Load Address: 30008000

Entry Point:  30008000

Verifying Checksum ... OK

OK

Starting kernel ...

UncompressingLinux.............................................................

................................................................................

.......... done, booting the kernel.

Linux version 2.6.32.2-ARMofWHJ (root@localhost.localdomain) (gcc version 4.3.2

(Sourcery G++ Lite 2008q3-72) ) #17 Wed Sep 7 06:41:21 CST 2011

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177

CPU: VIVT data cache, VIVT instruction cache

Machine: FriendlyARM Mini2440 development board

Warning: bad configuration page, trying to continue

Memory policy: ECC disabled, Data cache writeback

CPU S3C2440A (id 0x32440001)

中间过长,省略

RAMDISK: gzip image found at block 0

VFS: Mounted root (ext2 filesystem) on device 1:0.

Freeing init memory: 176K

Processing /etc/profile... Done

#

至此系统启动成功。

-----------------------以下为引用------------------------------------------

后记:由 于友善之臂mini2440默认的配置文件是将驱动等直接编译到内核里去了,并没有使用内核模块。所以上述第6步制作根文件系统中的d)编译和e)安装内核模块的步骤可以不做。我就没有编译内核模块。因为参照友善之臂的root_qtopia根文件系统发现/lib/modules/`uname -r`里根本没有东西。而且以前用友善之臂的config_mini2440_t35默认配置编译内核模块的时候。发现友善只做了个 hello_modules的内核模块示例。在此我们不需要使用这个hello_modules,所以这两步就略过去了。

说明:由于最小系统里的etc配置文件没有写自动启动网卡的脚本,所以我做的ramdisk开始时并不能自动启动网卡。后来参照友善之臂的root_qtopia根文件系统里的脚本做如下修改,即可自动启动脚本。

修改如下:

修改要制作的ramdisk根文件系统的rootfs下的/etc/init.d/rcS文件

在最下边添加如下两行命令即可自动启动网卡:

/sbin/ifconfig lo127.0.0.1

/sbin/ifconfig eth0192.168.31.230 netmask 255.255.255.0 up

这个方法是通过分析友善之臂的root_qtopia根文件系统的启动流程时发现的。

通过分析友善之臂的root_qtopia根文件系统,我们还能发现更多的内容。在此不在详述。

锻炼一下自己分析解决问题的能力吧。呵呵。0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值