linux+ramdisk移植的时候遇到的某些问题及解决方法

1.

Uncompressing Linux................................................................ done, booting the kernel.

就不动了

 

解决:把console=/dev/ttySAC0 改成 console=ttySAC0

 

2. 启动参数 initrd=0x30800000,0x200000x30800000表示ramdiskRAM中的地址,0x20000表示ramdisk的大小

 

3. Failed to execute /linuxrc;Kernel panic No init fo...

原因:initrd=0x30800000,0x20000 0x20000小于ramdisk的实际大小

 

4. RAMDISK: incomplete write (-28 != 32768) 4194304
RAMDISK: ran out of compressed data
invalid compressed format (err=1)
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

出现上面情况,查阅资料才知道是因为没有修改
Driver device ->
Block device ->
(4096)Default RAM disk size (kbytes)
40968192

 

5.Error: unrecognized/unsupported machine ID (r1 = 0x33f60264).

解决办法:参考我的CSDN博客

 

6. Kernel panic - not syncing: Attempted to kill init!

其中一个原因是内核不是用带eabi的的编译器编译的,而制作rootfs是的busybox使用带eabi的编译器编译的。

 

7.编译busybox时可能遇到的问题

将会遇到下面问题:
applets/applets.c:20:2:
error: #warning Static linking against glibc produces buggy executables
applets/applets.c:2
1:2: error:
#warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:22:2:
error:
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:23:2:
error:
#warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:24:2:
error:
#warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:25:2:
error:
#warning from top-level Makefile and remove this warning.
make[
1]: *** [applets/applets.o] Error 1


这个警告的定义在applets/applets.c中。将这段警告注释掉就可以了。这段警告的意思是告诉你最好用uclibc编译,而不是用glibc因为glibc比较大,busybox在寸土寸金的嵌入式系统中运用比较多,所以会有这样的要求。

你可能感兴趣的:(LINUX)