Chinaunix首页 | 论坛 | 博客
  • 博客访问: 567884
  • 博文数量: 63
  • 博客积分: 533
  • 博客等级: 中士
  • 技术积分: 1146
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-24 17:56
文章分类

全部博文(63)

文章存档

2016年(1)

2014年(23)

2013年(17)

2012年(22)

分类: LINUX

2012-09-24 18:13:57

问题一:linux2.6.30内核编译『zImage』出现Error: unrecognized/unsupported machine ID
解决方法一
======================================================
Linux 内核启动时出现:bad machine ID,原因大致是u-boot 传递给
内核的machine ID错误,可以手动在内核源代码中添加machine ID.
解决方法一:
在u-boot 命令行中输入bdinfo
查看板卡信息,我的输出如下:
FS2410# bdinfo
arch_number = 0x000000C1
env_t = 0x00000000
boot_params = 0x30000100
DRAM bank = 0x00000000
-> start = 0x30000000
-> size = 0x04000000
ethaddr = 08:00:3E:26:0A:5B
ip_addr = 10.1.8.245
baudrate = 115200 bps
修改内核的arch/arm/kernel/head.S,直接将s3c2410的参数赋给内核
# cd linux-2.6.19
# vi arch/arm/kernel/head.S +72
----------------------------------------------

70 __INIT
71 .type stext, %function
72 ENTRY(stext)

mov r0, #0
mov r1, #0xc1
ldr r2, =0x30000100
73 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
解决方法二
======================================================
==
修改u-boot,填写ID;
# vi common/cmd_boot.c
----------------------------------------------
31 #if defined(CONFIG_I386)
32 DECLARE_GLOBAL_DATA_PTR;
33 #endif
====>
31 //#if defined(CONFIG_I386)
32 DECLARE_GLOBAL_DATA_PTR;
33 //#endif
...
60 #if !defined(CONFIG_NIOS)
if(argc==2)
rc = ((ulong (*)(int, char *[]))addr) (0, gd->bd->bi_arch_number);
else
61 rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
62 #else
63
问题二:BusyBox编译时出现的问题:
In file included from /opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/if_tunnel.h:5,
from /opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.c:32:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/ip.h:85: error: redefinition of 'struct iphdr'
make[1]: *** [/opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.o] Error 1
make: *** [_all] Error 2

这句话讲了:In file included from /opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/if_tunnel.h:5,在头文件if_tunnel.h第五行调用了ip.h这个头文件;
下面这句话:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/ip.h:85: error: redefinition of 'struct iphdr'在头文件ip.h的85行又redefinition(翻译成中文是:重复定义)了结构体 iphdr。
iphdr结构在另外一个头文件中定义了:arm-none-linux-gnueabi/libc/usr/include/netinet/ip.h的45行。而这个头文件正好现在iptunnel.c文件的17行调用了。linux/if_tunnel.h头文件在24行调用的。

最合理的解决方法:修改busybox的源码:把busybox-1.13.0\networking\libiproute\iptunnel.c文件的24行屏蔽掉就行了。
 
问题三:NAND Flash分区问题:

 

修改arch/arm/plat-s3c24xx/common-smdk.c111行的static struct mtd_partition smdk_default_nand_part[]nandflash分区为:
static struct mtd_partition smdk_default_nand_part[] = {

    [0] = {

               .name   = "Rojian_Boot",

               .size   = 0x00040000,

               .offset = 0x00000000,

    },

        [1] = {

               .name   = " Rojian_param",

               .offset = 0x00040000,

               .size   =0x00020000,

        },

    [2] = {

               .name   = " Rojian_kernel",

               .offset = 0x00200000,

               .size   = 0x00300000,

    },

    [3] = {

               .name   = " Rojian_yaff2",

               .offset = 0x00500000,

               .size   = MTDPART_SIZ_FULL,

    }

};

    然后修改“drivers/mtd/nand/s3c2410.c”文件的752行(Linux-2.6.30.4)或者669行(Linux-2.6.25.8),将原来的内容改为如下所示:

chip->ecc.mode =NAND_ECC_NONE;

    最后在终端输入#make menuconfig配置相关选项。

 

问题四:编译内核时出现问题[drivers/video/console/vgacon.o]

drivers/video/console/vgacon.o:987:warning:comparison is always true due to limited range of data type
make[3]:***[drivers/video/console/vgacon.o] error 1
make[2]:***[drivers/video/console2] error 2
make[1]:***[drivers/video1] error 2
make:***[drivers] error 2

解决方法:

在make menuconfig 时
Graphics support ->
console display driver support->
vga text console(不选这个)

问题五:red hat在哪里设置机器IP

可以进入/etc/sysconfig/network-scripts。找到ifcfg-eth0.编辑它如下:
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR= 10.9.100.221(你需要的固定ip)
NETMASK=255.0.0.0
GATEWAY=10.255.255.254
如果需要动态分配IP,那么
DEVICE = eth0
ONBOOT = yes
USERCTL = yes
BOOTPROTO = dhcp

改了再运行/etc/rc.d/init.d/network restart

问题六:编译busybox-1.13.0错误解决

In file included from /opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/if_tunnel.h:5,
from /opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.c:32:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/ip.h:85: error: redefinition of 'struct iphdr'
make[1]: *** [/opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.o] Error 1
make: *** [_all] Error 2

解决办法:

make menuconfig找到下面的这一个设置项:

networking utilites->ip tunnel

[ *] ip tunnel用空格键取消 *即变成 [ ] ip tunnel 保存即可

阅读(2657) | 评论(1) | 转发(8) |
给主人留下些什么吧!~~

鸟哥のlinux2012-09-25 13:19:51

向博主学习……