当前位置: 技术问答>linux和unix
编译内核出错,高手指教
来源: 互联网 发布时间:2016-07-07
本文导语: 以下为我的步骤: gedit Makefile ARCH ?= arm CROSS_COMPILE ?= /home/zilong/crosstool/work/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu- 2.cp arch/arm/configs/s3c2410_defconfig .config 3. 修改arch/arm/mach-s3c2440/mach-smdk2440.c static void __...
以下为我的步骤:
gedit Makefile
ARCH ?= arm
CROSS_COMPILE ?= /home/zilong/crosstool/work/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-
2.cp arch/arm/configs/s3c2410_defconfig .config
3.
修改arch/arm/mach-s3c2440/mach-smdk2440.c
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
// s3c24xx_init_clocks(16934400);
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
4、
修改内核源码的“arch/arm/tools/mach-types”文件
s3c2440 ARCH_S3C2440 S3C2440 782
5.禁用Flash ECC校验
修改drivers/mtd/nand/s3c2410.c
修改drivers/mtd/nand/s3c2410.c
找到chip->eccmode = NAND_ECC_SOFT;
改为chip->eccmode = NAND_ECC_NONE;
6.修改NandFlash 分区信息。
在arch/arm/plat-s3c24xx/common-smdk.c中修改smdk_default_nand_part[],
static struct mtd_partition smdk_default_nand_part[] = {
[0] = { .name = "vivi",
.size = 0x00020000,
.offset = 0X00000000,
},
[1] = { .name = "kernel_linux",
.offset = 0x00050000,
.size = 0x00200000,
},
[2] = { .name = "root_fs",
.offset =0x00250000,
.size =0x03dac000,
}
};
7.MAKE menuconfig
System Type ---->
[*] S3C2410 DMA support
S3C2410 Machines --->
[*] SMDK2410/A9M2410
S3C2440 Machines --->
[*] SMDK2440
[*] SMDK2440 with S3C2440 CPU module
[*] Enable loadable module support --->
[*] Module unloading
[*] Automatic kernel module loading
选择这两个,剩下的可以去掉
Boot option ----->
修改启动参数为:noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
Device Drivers --->
Memory Technology Device (MTD) support --->
[*] MTD partitioning support
NAND Device Support --->
NAND Flash support for S3C2410/S3C2440 SoC
[ ] S3C2410 NAND Hardware ECC //这个要去掉
[*] Network device support --->
[*] Ethernet (10 or 100Mbit) --->
DM9000 support
Kernel Features ->
[*]Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel
make zImage
结果出现以下错误:
drivers/usb/core/hcd.c:144: error: expected expression before '>>' token
drivers/usb/core/hcd.c:144: error: expected expression before '>>' token
drivers/usb/core/hcd.c:167: error: expected expression before '>>' token
drivers/usb/core/hcd.c:167: error: expected expression before '>>' token
请问如何解决???
gedit Makefile
ARCH ?= arm
CROSS_COMPILE ?= /home/zilong/crosstool/work/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-
2.cp arch/arm/configs/s3c2410_defconfig .config
3.
修改arch/arm/mach-s3c2440/mach-smdk2440.c
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
// s3c24xx_init_clocks(16934400);
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
4、
修改内核源码的“arch/arm/tools/mach-types”文件
s3c2440 ARCH_S3C2440 S3C2440 782
5.禁用Flash ECC校验
修改drivers/mtd/nand/s3c2410.c
修改drivers/mtd/nand/s3c2410.c
找到chip->eccmode = NAND_ECC_SOFT;
改为chip->eccmode = NAND_ECC_NONE;
6.修改NandFlash 分区信息。
在arch/arm/plat-s3c24xx/common-smdk.c中修改smdk_default_nand_part[],
static struct mtd_partition smdk_default_nand_part[] = {
[0] = { .name = "vivi",
.size = 0x00020000,
.offset = 0X00000000,
},
[1] = { .name = "kernel_linux",
.offset = 0x00050000,
.size = 0x00200000,
},
[2] = { .name = "root_fs",
.offset =0x00250000,
.size =0x03dac000,
}
};
7.MAKE menuconfig
System Type ---->
[*] S3C2410 DMA support
S3C2410 Machines --->
[*] SMDK2410/A9M2410
S3C2440 Machines --->
[*] SMDK2440
[*] SMDK2440 with S3C2440 CPU module
[*] Enable loadable module support --->
[*] Module unloading
[*] Automatic kernel module loading
选择这两个,剩下的可以去掉
Boot option ----->
修改启动参数为:noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
Device Drivers --->
Memory Technology Device (MTD) support --->
[*] MTD partitioning support
NAND Device Support --->
NAND Flash support for S3C2410/S3C2440 SoC
[ ] S3C2410 NAND Hardware ECC //这个要去掉
[*] Network device support --->
[*] Ethernet (10 or 100Mbit) --->
DM9000 support
Kernel Features ->
[*]Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel
make zImage
结果出现以下错误:
drivers/usb/core/hcd.c:144: error: expected expression before '>>' token
drivers/usb/core/hcd.c:144: error: expected expression before '>>' token
drivers/usb/core/hcd.c:167: error: expected expression before '>>' token
drivers/usb/core/hcd.c:167: error: expected expression before '>>' token
请问如何解决???
|
usb驱动出错啊,看看usb选项
|
先去掉USB选项试试
|
那就是驱动有问题
|
expected expression before
检查一下代码,可能是什么没定义之类的
检查一下代码,可能是什么没定义之类的