linux 2.6内核升级,Linux内核编译(2.6.18内核升级到V2.6.26.4)

一、当前系统概况:

当前系统为CentOS5.2,内核版本为:2.6.18,欲升级内核到V2.6.26.4

二、准备工作:

首先到http://www.eu.kernel.org/pub/linux/kernel/或http://www.kernel.org/pub/linux/kernel/下载最新的内核源代码。下载linux-2.6.26.4.tar.gz完毕后,将其解压至/usr/src/目录下,即:/usr/src/linux-2.6.26.4/。#cd /usr/src/linux-2.6.26.4 进入源代码目录。

三、开始编译

依次执行如下命令:

#make mrproper

配置内核选项

#make menuconfig [xconfig]

#make dep

编译内核:

#make bzImage

编译成功后,make会在最后输出

Kernel:arch/x86/boot/bzImage is ready(#1)

内核编译成功后,下面开始编译可加载模块:

#make modules

安装可加载模块:

#make modules_install

模块安装成功后,会在/lib/modules/目录下生成一个与当前内核版本号同名的目录,其安装的可加载模块就是被安装到该目录下。

安装刚才编译的内核:

#make install

在此之前最好先备份一下/boot/grub/grub.conf文件

重新启动系统,在启动时选择刚才编译的内核版本号就可以了。

注:如果对内核编译的make选项不太清楚,可以输入:

#make help查看详细解释。下面时make help的部分内容截取

Cleaning targets:

clean - Remove most generated files but keep the config and

enough build support to build external modules

mrproper - Remove all generated files + config + various backup files

distclean - mrproper + remove editor backup and patch files

Configuration targets:

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

silentoldconfig - Same as oldconfig, but quietly

randconfig - New config with random answer to all options

defconfig - New config with default answer to all options

allmodconfig - New config selecting modules when possible

allyesconfig - New config where all options are accepted with yes

allnoconfig - New config where all options are answered with no

Other generic targets:

all - Build all targets marked with []

* vmlinux - Build the bare kernel

* modules - Build all modules

modules_install - Install all modules to INSTALL_MOD_PATH (default: /)

dir/ - Build all files in dir and below

dir/file.[ois] - Build specified target only

dir/file.ko - Build module including final link

rpm - Build a kernel as an RPM package

tags/TAGS - Generate tags file for editors

cscope - Generate cscope index

kernelrelease - Output the release version string

kernelversion - Output the version stored in Makefile

headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH

(default: /src/linux-2.6.21/usr)

Static analysers

checkstack - Generate a list of stack hogs

namespacecheck - Name space analysis on compiled kernel

headers_check - Sanity check on exported headers

Kernel packaging:

rpm-pkg - Build the kernel as an RPM package

binrpm-pkg - Build an rpm package containing the compiled kernel

and modules

deb-pkg - Build the kernel as an deb package

tar-pkg - Build the kernel as an uncompressed tarball

targz-pkg - Build the kernel as a gzip compressed tarball

tarbz2-pkg - Build the kernel as a bzip2 compressed tarball

Documentation targets:

Linux kernel internal documentation in different formats:

htmldocs - HTML

installmandocs - install man pages generated by mandocs

mandocs - man pages

pdfdocs - PDF

psdocs - Postscript

xmldocs - XML DocBook

Architecture specific targets (i386):

* bzImage - Compressed kernel image (arch/i386/boot/bzImage)

install - Install kernel using

(your) ~/bin/installkernel or

(distribution) /sbin/installkernel or

install to $(INSTALL_PATH) and run lilo

bzdisk - Create a boot floppy in /dev/fd0

fdimage - Create a boot floppy image

isoimage - Create a boot CD-ROM image

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build

make V=2 [targets] 2 => give reason for rebuild of target

make O=dir [targets] Locate all output files in "dir", including .config

make C=1 [targets] Check all c source with $CHECK (sparse by default)

make C=2 [targets] Force check of all c source with $CHECK

Execute "make" or "make all" to build all targets marked with []

For further info see the ./README file0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
共计8个压缩包 本压缩包是:part01.rar 出版社:人民邮电出版社 ·页码:368 页 ·出版日期:2008年 ·ISBN:7115187118/9787115187116 ·条形码:9787115187116 ·包装版本:1版 ·装帧:平装 ·开本:16 ·中文:中文 ·附带品描述:附光盘一张 ·市场价格:49元 内容简介 Linux内核Linux操作系统中最核心的部分,用于实现对硬件部件的编程控制和接口操作。《Linux2.6内核标准教程》深入、系统地讲解了 Linux内核的工作原理,对Linux内核的核心组件逐一进行深入讲解。 全书共8章,首先讲解Linux系统的引导过程;然后对Linux内核的3大核心模块——内存管理、进程管理、中断和异常处理进行了深入的分析; 在此基础上,对时间度量、系统调用进行了分析和讨论;最后讲解了Linux内核中常见的同步机制,使读者掌握每处理器变量和RCU这两种新的 同步机制。 《Linux2.6内核标准教程》适合Linux内核爱好者、Linux驱动开发人员、Linux系统工程师参考使用,也可以作为计算机及相关专业学生深入学 习操作系统的参考书。 引用: 目录 第1章 Linux内核学习基础 1 1.1 为什么研究Linux内核 2 1.1.1 Linux的历史来源 2 1.1.2 Linux的发展现状 3 1.1.3 Linux的前景展望 3 1.2 选择什么版本进行研究 3 1.3 内核基本结构 4 1.3.1 内核在操作系统中的地位 4 1.3.2 Linux 2.6内核源代码目录树简介 5 1.3.3 Linux 2.6内核的新特性 8 1.4 如何阅读本书 9 1.4.1 内核探索工具 10 1.4.2 推荐阅读方法 12 第2章 引导过程分析 14 2.1 内核镜像的构建过程 15 2.1.1 编译内核的步骤及分析 15 2.1.2 内核镜像构建过程分析 16 2.2 系统引导过程分析 18 2.2.1 傀儡引导扇区 18 2.2.2 探测系统资源 21 2.2.3 解压内核镜像 35 2.2.4 进入保护模式 40 2.2.5 系统最终初始化 47 2.3 系统引导过程总结 47 第3章 内存管理 50 3.1 基础知识 51 3.1.1 存储器地址 51 3.1.2 分段机制 52 3.1.3 分页机制 59 3.2 内核页表的初始化过程 65 3.2.1 启用分页机制 65 3.2.2 构建内核页表 68 3.3 物理内存的描述方法 76 3.3.1 内存节点 77 3.3.2 内存区域 81 3.3.3 物理页框 85 3.4 物理内存的初始化过程 86 3.4.1 探测系统物理内存 87 3.4.2 初始化内存分配器 89 3.5 物理内存的分配与回收 101 3.5.1 伙伴分配算法 101 3.5.2 对象缓冲技术 103 3.6 内核地址空间 105 3.6.1 常规映射地址空间 105 3.6.2 固定映射地址空间 107 3.6.3 长久内核映射空间 109 3.6.4 临时内核映射空间 116 3.6.5 非连续映射地址空间 119 第4章 进程管理 128 4.1 进程与线程的概念 129 4.1.1 程序与进程 129 4.1.2 进程与线程 129 4.2 进程描述符 131 4.2.1 进程标识符 132 4.2.2 进程的状态 132 4.2.3 进程上下文 134 4.2.4 当前进程 139 4.3 进程的组织形式 143 4.3.1 进程标识符构成的哈希表 143 4.3.2 所有进程构成的双向链表 148 4.3.3 执行态进程组成的运行队列 149 4.3.4 阻塞态进程组成的等待队列 152 4.4 进程的创建过程 155 4.4.1 进程创建的接口函数 156 4.4.2 进程创建的处理过程 162 4.5 进程调度算法 177 4.5.1 进程的分类 178 4.5.2 进程优先级 178 4.5.3 时间片分配 181 4.5.4 进程调度时机 182 4.6 进程切换过程分析 183 4.6.1 选取合适进程 183 4.6.2 完成上下文切换 184 4.7 空闲进程的初始化 187 4.7.1 空闲进程的内核态栈 187 4.7.2 空闲进程的内存描述符 188 4.7.3 空闲进程的硬件上下文 190 4.7.4 空闲进程的任务状态段 190 第5章 中断和异常 192 5.1 基础知识 193 5.1.1 中断和异常的定义 193 5.1.2 中断和异常的分类 193 5.1.3 中断和异常的对比 194 5.2 处理机制 195 5.2.1 IA32架构下的处理机制 195 5.2.2 Linu
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值