最近开始学习linux驱动编写,目前直接使用jz2440已移植好的系统配合视频开始学习驱动编写,但是总是出现这样那样的问题。于是决定重头开始,先自己移植内核,在开始驱动学习。
今天参照《嵌入式linux完全应用手册》进行驱动移植。
cross_compile:4.9.3(下载地址:https://launchpad.net/gcc-arm-embedded/+download)。
kernel:2.6.22.6
1、先修改顶层目录下的Makefile文件:
ARCH = arm
CROSS_COMPILE = arm-none-eabi-
2、输入make s3c2410_defconfig进行编译,在编译的过程中发生错误。
CC fs/binfmt_aout.o
In file included from include/linux/spinlock.h:53:0,
from include/linux/module.h:9,
from fs/binfmt_aout.c:7:
fs/binfmt_aout.c: In function 'load_aout_binary':
include/linux/a.out.h:141:38: error: 'SEGMENT_SIZE' undeclared (first use in this function)
#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
^
include/linux/kernel.h:36:37: note: in definition of macro '__ALIGN_MASK'
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
^
include/linux/a.out.h:141:29: note: in expansion of macro 'ALIGN'
#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
^
include/linux/a.out.h:148:9: note: in expansion of macro '_N_SEGMENT_ROUND'
: (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
^
fs/binfmt_aout.c