freezero大侠:
http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=672&show=0
todaygood大侠:
http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=816&show=0
我从这两个文档中找到很多要注意的问题。
ramfs的移植过程并没有想像中的容易。
一、我在执行”losetup /dev/loop2 ramdisk“这条命令的时候提示:“ramdisk 权限不够”
无奈之下我想起了babylinux的制作过程,里面就有用到ramfs,以下是参考其制作ramfs的制作过程:
1、dd if=/dev/zero of=/dev/ram1 bs=1k count=8000
2、mkfs.ext2 -m0 /dev/ram1
3、mount /dev/ram1 /mnt/ramdisk/
4、详细的复制文件的过程我在这不再详细说明,请参考以上两个贴。
以下是我的ramfs里面的内容:
bin dev etc lib lost+found proc sbin sys tmp usr var
注意:
要在/dev目录下建立console和null两个设备文件
cd /dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3
5、umount /dev/ram1
6、dd if=/dev/ram1 of=ramdisk.img
注:
此时你可以使用“mount -o loop ramdisk.img /mnt/ramdisk”命令把这个ramfs挂载在你pc的/mnt/ramdisk目录,它对pc来说就等同于光盘iso镜像文件
7、gzip -v9 ramdisk.img
到些,ramfs制作完毕,生成ramdisk.img.gz压缩的ramfs文件。
二、我按照上面贴子的提示,主要修改了:
1、选上 Float point emulation ->
[ * ] NWFE math emnulaiton
2、修改Driver device ->
Block device ->
(4096)Default RAM disk size (kbytes)
改4096为8192
3、选择了以上项以外还要选上
[ * ]Initial Ramdisk (initrd) support
4、选上filesystems->Second extended fs support
注:
这个内核默认都有,不过我以前去掉了,为此郁闷了一阵子。
5、设置linux_cmd_line:
setenv bootargs "console=ttySAC0 initrd=0x30800000,0x500000 root=/dev/ram"
注:
我的ramfs比较大,ramfs里面我没有使用linuxrc
好了,配置好了下载到内核运行,提示以下错误:
RAMDISK: Compressed image found at block 0
RAMDISK: incomplete write (-28 != 32768) 8388608
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing init memory: 108K
attempt to access beyond end of device
ram0: rw=0, want=16530, limit=16384
EXT2-fs error (device ram0): ext2_get_inode: unable to read inode block - inode4attempt to access beyond end of device
ram0: rw=0, want=16522, limit=16384
EXT2-fs error (device ram0): ext2_get_inode: unable to read inode block - inode0Kernel panic - not syncing: No init found. Try passing init= option to kernel.
查看上面的帖子,发现有以下不同:
freezero的帖中是这个错误:
ram0: rw=0, want=8506, limit=8192
而我的是这个错误:
ram0: rw=0, want=16530, limit=16384
折腾了一阵子后,我毅然决定把
Driver device ->
Block device ->
(8192)Default RAM disk size (kbytes)
改8192为16384
呵呵,这个大胆的尝试居然成功了^_^以下是启动信息:
U-Boot 1.1.3 (Jan 14 2007 - 15:26:13)
U-Boot code: 33F80000 -> 33F9BAC0 BSS: -> 33F9FBAC
RAM Configuration:
Bank #0: 30000000 64 MB
Nor Flash: 512 kB
Nand Flash: 64 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
sbc2410=>tftp
TFTP from server 192.168.1.115; our IP address is 192.168.1.128
Filename 'zImage.img'.
Load address: 0x30008000
Loading: #################################################################
#################################################################
#################################################################
##########################################################
done
Bytes transferred = 1290920 (13b2a8 hex)
sbc2410=>tftp 30800000 ramdisk.img.gz
TFTP from server 192.168.1.115; our IP address is 192.168.1.128
Filename 'ramdisk.img.gz'.
Load address: 0x30800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#######################################
done
Bytes transferred = 1526346 (174a4a hex)
sbc2410=>bootm 30008000
## Booting image at 30008000 ...
Image Name: linux-2.6.14
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1290856 Bytes = 1.2 MB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
Starting kernel ...
Uncompressing Linux.............................................................Linux version 2.6.14 (root@localhost.localdomain) (gcc version 3.4.1) #10 Mon J7CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
Machine: SMDK2410
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists
Kernel command line: console=ttySAC0 mem=64M initrd=0x30800000,0x500000 root=/dmirq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 57088KB available (1972K code, 533K data, 108K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
softlockup thread 0 started up.
Freeing initrd memory: 5120K
NET: Registered protocol family 16
USB Control, (c) 2006 sbc2410
S3C2410: Initialising architecture
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
NetWinder Floating Point Emulator V0.97 (double precision)
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x1
yaffs Jan 15 2007 15:39:21 Installing.
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
s3c2410-rtc s3c2410-rtc: rtc is disabled, re-enabling now
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 4 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
usbcore: registered new driver ub
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev E at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4980000
s3c2410-nand: timing: Tacls 10ns, Twrph0 30ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bi)Scanning device for bad blocks
Bad eraseblock 1884 at 0x01d70000
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
0x00020000-0x00030000 : "param"
0x00030000-0x00200000 : "kernel"
0x00200000-0x04000000 : "root"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usbcore: registered new driver usbmouse
drivers/usb/input/usbmouse.c: v1.6:USB HID Boot Protocol mouse driver
mice: PS/2 mouse device common for all mice
s3c2410 TouchScreen successfully loaded
UDA1341 audio driver initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
TCP bic registered
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET: Registered protocol family 1
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing init memory: 108K
init started: BusyBox v1.1.3 (2006.09.20-14:52+0000) multi-call binary
Starting pid 698, console /dev/tts/0: '/etc/init.d/rcS'
Please press Enter to activate this console.
[root@luofuchong /]# ls
bin etc lost+found sbin tmp var
dev lib proc sys usr
好了,记录如上,希望对以后碰到类似问题的朋友有点帮助!