1、 内 核 移植的基本过程 1)下载内 核 ,解压到相应的目录。 2)修改 Makefile 文件 , 设置架构类型及使用的编译器。 3)配置内 核 ,通常是尽量裁减内核。 4)生成新 内 核。 移植流程如 内核移植步骤如下。 操 作 步 骤 步骤 1: 复 制 linux-2.6.22.5 内核压 缩 包到 embedded 目录 中,并解压缩。 rootlocalhost embedded# tar xjvf linux-2.6.22.5.tar.bz2 步骤 2: 进 入 linux-2.6.22.5 目录中。 rootlocalhost embedded# cd linux-2.6.22
2、.5/ 步骤 3: 修 改 Makefile 文件。 rootlocalhost linux-2.6.22.5# vi Makefile #ARCH ?= $(SUBARCH) #注释该行 #CROSS_COMPILE ?= #注释该行 ARCH ?= arm #添加该行 CROSS_COMPILE ?= arm-linux- #添加该行 步骤 4:执行 make menuconfig 配置 内 核。 rootlocalhost linux-2.6.22.5# make menuconfig make menuconfig 基于文本图形化终端配置菜单,是目前使用最广泛的配置内核方法。 修改以下
3、相关内容,要注意选的是 * 还是 M 之类。 General setup - * Initial RAM filesystem and RAM disk (initramfs/initrd) support System Type - ARM system type (ARM Ltd. Versatile family) - (X) ARM Ltd. Versatile family 改成 (X) Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443 ARM system type (Samsung S3C2410, S3C2
4、412, S3C2413, S3C2440, S3C2442, S3C2443) - S3C2410 DMA support (NEW) 改成 * S3C2410 DMA support S3C2410 Machines - SMDK2410/A9M2410 (NEW) 改成 * SMDK2410/A9M2410 Boot options - () Default kernel command string 改成 (console=ttySAC0 root=/dev/ram init=/linuxrc) Default kernel command string Device Drivers
5、- Character devices - Serial drivers - Samsung S3C2410/S3C2440/S3C2442/S3C2412 Serial port support (NEW) 改成 Samsung S3C2410/S3C2440/S3C2442/S3C2412 Serial port support * Support for console on S3C2410 serial port LED devices - LED Support (NEW) 改成 * LED Support LED Class Support LED Support for Sams
6、ung S3C24XX GPIO LEDs (NEW) 改成 LED Support for Samsung S3C24XX GPIO LEDs LED Trigger support (NEW) 改成 * LED Trigger support LED Timer Trigger LED Heartbeat Trigger Multimedia devices - Video For Linux 改成 Video For Linux * DAB adapters (NEW) 改成 DAB adapters Graphics support - S3C2410 LCD framebuffer
7、support (NEW) 改成 S3C2410 LCD framebuffer support Console display driver support - * VGA text console (NEW) 改成 VGA text console Framebuffer Console support (NEW) 改成 Framebuffer Console support * Framebuffer Console Rotation * Select compiled-in fonts * VGA 8x16 font * Mini 4x6 font Bootup logo (NEW)
8、- 改成 * Bootup logo - 上述修改是必须的,下面的修改是根据需要进行的。 Code maturity level options - * Prompt for development and/or incomplete code/drivers 改成 Prompt for development and/or incomplete code/drivers Floating point emulation - NWFPE math emulation (NEW) 改成 * NWFPE math emulation * Support extended precision Dev
9、ice Drivers - Memory Technology Device (MTD) support - 改成 Memory Technology Device (MTD) support - MTD partitioning support (NEW) 改成 (NEW) 改成 改成 改成 改成 改成 改成 改成 改成 * MTD partitioning support RAM/ROM/Flash chip drivers - Detect flash chips by Common Flash Interface (CFI) probe Detect flash chips by Co
10、mmon Flash Interface (CFI) probe Support for Intel/Sharp flash chips (NEW) Support for Intel/Sharp flash chips Support for RAM chips in bus mapping (NEW) Support for RAM chips in bus mapping Support for ROM chips in bus mapping (NEW) Support for ROM chips in bus mapping Mapping drivers for chip acce
11、ss - Map driver for platform device RAM (mtd-ram) (NEW) Map driver for platform device RAM (mtd-ram) Self-contained MTD device drivers - Physical system RAM (NEW) Physical system RAM MTD using block device (NEW) MTD using block device Parallel port support - Parallel port support Parallel port suppo
12、rt SCSI device support - SCSI device support 改成 SCSI device support Multi-device support (RAID and LVM) - * Multiple devices driver support (RAID and LVM) 改成 Multiple devices driver support (RAID and LVM) ISDN subsystem - ISDN support 改成 ISDN support Input device support - Joystick interface 改成 Joys
13、tick interface Touchscreen interface (NEW) 改成 Touchscreen interface (320) Horizontal screen resolution (240) Vertical screen resolution Touchscreens (NEW) - 改成 Touchscreens - Philips UCB1400 touchscreen (NEW) 改成 Philips UCB1400 touchscreen File systems - Miscellaneous filesystems - Journalling Flash
14、 File System v2 (JFFS2) support (NEW) 改成 Journalling Flash File System v2 (JFFS2) support * Advanced compression options for JFFS2 内核移 植关 键的步 骤就 在于配 置哪 些选项 是必 须选择 ,哪 些选项 是不 用选的 。实 际 上在配 置时 ,大部 分选 项可以 使用 其默认 值, 只有少 部分 要根据 用户 不同的 需要 选 择 。 选择的 原则 是,将 与内 核其他 部分 关系较 远且 不经常 使用 的部分 功能 代码编 译成 可 加 载 模块, 有利 于
15、减小 内核 的大小 、减 小内核 消耗 的内存 、简 化该功 能相 应的环 境改 变 时 对 内核的 影响 。不需 要的 s 功能就 不选 ,与内 核关 系紧密 而且 经常使 用的 部分功 能代 码 直接 编译到内核中。 步骤 5: 执 行 make dep 命令检查依赖关系。 rootlocalhost kernel# make dep 步骤 6: 生 成 zImage 内 核镜像文件。 rootlocalhost kernel# make zImage 生成的 zImage 文件在 arch/arm/boot/目录中。 步骤 7:将 zImage 文件复制到 /tftpboot 目录中。 rootlocalhost kernel# cp arch/arm/boot/zImage /tftpboot/ 步骤 8:测 试 生成的新内核能否启动。