- 论坛徽章:
- 0
|
bootloader没有烧写工具,暂时不能修改,想把ramdisk和内核编译到一起,让系统先跑起来。
linux-2.6.27中好像不支持将ramdisk和内核编译到一起了,提供了一个升级版本的工具initramfs。
我将busybox1.00编译后的都放在了usr/ramdisk目录下,加上了dev/console设备。
内核选项选择支持initramfs,并指定位置./usr/ramdisk,同时选择支持ramdisk,大小4096。
启动参数设置为rdinit=/linuxrc再加上console的设置。
linuxrc脚本如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/cp -a /mnt/etc/* /etc
echo "re-create the /etc/mtab entries"
echo "now to exec /sbin/init"
exec /sbin/init
启动,信息如下:
Linux version 2.6.27 (root@localhost.localdomain) (gcc version 3.4.3) #340 Tue Jun 9 11:47:23 CST 2009
Parallel flash device: name AM29LV320MT, id 0x2201, size 32768KB
96359PONG prom init
mips_hpt_frequency = 0x8f0d180, r4k_interval = 0x927c0
CPU revision is: 0002a010 (Broadcom BCM635
Determined physical RAM map:
memory: 07fa0000 @ 00000000 (usable)
# initrd_start = 0, initrd_end = 0
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00007fa0
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00007fa0
On node 0 totalpages: 32672
free_area_init_node: node 0, pgdat 80150410, node_mem_map 81000000
Normal zone: 32416 pages, LIFO batch:7
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32416
Kernel command line: rdinit=/linuxrc console=ttyS0,115200
Primary instruction cache 32kB, VIPT, 2-way, linesize 16 bytes.
Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
PID hash table entries: 512 (order: 9, 2048 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 127488k/130688k available (1108k kernel code, 3012k reserved, 177k data, 340k init, 0k highmem)
Calibrating delay loop... 299.00 BogoMIPS (lpj=598016)
Mount-cache hash table entries: 512
Total Flash size: 32768K with 512 sectors
File system address: 0xbf000100
msgmni has been set to 249
io scheduler noop registered (default)
brd: module loaded
loop: module loaded
brcmboard: brcm_board_init entry
Serial: BCM63XX driver $Revision: 3.00 $
ttyS0 at MMIO 0xfffe0100 (irq = 10) is a BCM63XX
Freeing unused kernel memory: 340k freed
# run run_init_process /linuxrc
Data bus error, epc == 801ad13c, ra == 8001f0c0
Oops[#1]:
Cpu 0
$ 0 : 00000000 10008000 fffd9000 00000001
$ 4 : 801a2000 fffd9000 801a3000 fffd9000
$ 8 : 801d0000 80150410 00000044 00000b3b
$12 : 00031c7f 2dfeec14 ffed6166 15010000
$16 : 801a2000 810f22c0 81003440 0791668b
$20 : 87a5b100 87a5c518 10001658 87a5ade0
$24 : 00000000 00460920
$28 : 87818000 87819db8 00000000 8001f0c0
Hi : 00000000
Lo : 00000000
epc : 801ad13c 0x801ad13c
Not tainted
ra : 8001f0c0 0x8001f0c0
Status: 10008003 KERNEL EXL IE
Cause : 0000001c
PrId : 0002a010 (Broadcom BCM635
Modules linked in:
Process linuxrc (pid: 1, threadinfo=87818000, task=87817958, tls=00000000)
Stack : 87a5b100 87a5c518 10001658 87a5ade0 87a5b100 80075540 00000000 0000005d
0045d000 00000000 00000000 00000000 87a5b100 0791668b 10001658 10001658
87a5ade0 87a5c518 00000001 00000001 00000000 80076ac4 81100487 80024384
00000001 87a5b004 87a5b100 87a5ae20 0791668b 87a39ea0 87810010 7fd546f0
7fd54884 80034c8c 87a5c518 87a5ade0 87817958 10001658 87a5ae14 00030000
...
Call Trace:[<80075540>] 0x80075540
[<80076ac4>] 0x80076ac4
[<80024384>] 0x80024384
[<80034c8c>] 0x80034c8c
[<8001ea84>] 0x8001ea84
[<800fb8e4>] 0x800fb8e4
[<800fb82c>] 0x800fb82c
[<80095ed0>] 0x80095ed0
[<80095f90>] 0x80095f90
[<80039c14>] 0x80039c14
[<80096290>] 0x80096290
[<80010400>] 0x80010400
Code: 24861000 8ca80000 8ca90004 <8caa0008> 8cab000c ac880000 ac890004 ac8a0008 ac8b000c
note: linuxrc[1] exited with preempt_count 2
Kernel panic - not syncing: Attempted to kill init!
Rebooting in 1 seconds..ÿ
到run_init_process()执行linuxrc就死机了。
epc == 801ad13c,该地址对应copy_page()和copy_page_array()
请问关于initramfs,上面的设置是否有误?还缺什么没有设置?initramfs能不能支持将ramdisk和内核编译到一起支持启动?
还是可能我别的地方错了?
谢谢各位高手赐教!
[ 本帖最后由 moon146 于 2009-6-9 12:15 编辑 ] |
|