当前位置:文档之家› linux内核的配置编译与移植

linux内核的配置编译与移植

linux内核的配置编译与移植
周建设 zhoujianshe@
概要
Linux内核源码版本命名 Linux的内核构成 Linux内核的目录结构 Linux内核编译步骤
Linux内核源码版本命名
主版本号。次版本号。修改的次数 [root@localhost ~]# uname -r 2.6.18-92.el5xen
文件系统
bin Dev etc Lib Proc Sbin Tmp Usr Var
Usr/bin Usr/lib Usr/sbin
virt 内核虚拟机
清除目标文件ቤተ መጻሕፍቲ ባይዱ
Cleaning targets:
Linux内核编译步骤(一)
► make clean
remove most generated files but keep the config
► make mrproper
remove all generated files + config + various backup files
3.ECC校验 Drivers/mtd/nand/s3c2410.c UBOOT和内核校验算法不一样 chip->ecc.mode =NAND_ECC_SOFT--> 改为 chip->ecc.mode = NAND_ECC_NONE
4.文件系统的支持 修改 fs/Kconfig支持devfs 。 在Pseudo filesystems 主菜单的最后添加我们所要的内容。
Linux内核的目录结构
Kernel Linux大部分关键的核心功能都在这个目录实现 lib 库文件代码 mm 内存管理相关的代码 net 网络协议的实现代码
samples 一些内核编程的范例
Linux内核的目录结构
scripts 配置内核的脚步 security 安全管理模块 sound 音频设备的驱动程序 usr cpio命令实现
Linux内核编译步骤(二)
配置
config - Update current config utilising a line-oriented program menuconfig - Update current config utilising a menu based program xconfig - Update current config utilising a QT based front-end gconfig - Update current config utilising a GTK based front-end oldconfig - Update current config utilising a provided .config as base defconfig - New config with default answer to all options
Linux内核编译步骤(三)
编译
make zImage make bzImage
Makefile
Kconfig
Kbuild
移植
1、修改顶层Makefile 架构 arch 交叉编译器 2.分区 Uboot kernel fs /arch/arm/mach-s3c2410/common-smdk.c
Linux内核的目录结构
fs
存放各种文件系统的实现代码, 每个子目录对应一个文件系统的实现, 公用的源程序用于实现虚拟文件系统vfs
inculde
内核所需要的头文件。与平台无关的头文件放在include/linux子目录下, 与平台相关的头文件放在相应的子目录中
init
内核初始化代码
ipc
进程间通信的实现代码
文件系统补丁,mtd + yaffs /cgi-bin/viewcvs.cgi/#dirlist tar –zxvf yaffs2.tar.gz [root@Binnary ~ ]# cd yaffs2
2440 晶振
Machine ID
Make uImage
Linux体系结构
Linux内核的构成
虚拟文件系统VFS
Linux内核的目录结构
Linux内核的目录结构
arch
内核所支持的每种CPU体系,在该目录下都有对应的子目录
block
部分块设备驱动程序
crypto
加密、压缩、CRC校验算法
documentation
内核的文档
driver
设备驱动程序
相关主题