3.2 操作系统生成
-
操作系统的生成
满足特定硬件环境和用户需要,组装和构建操作系统过程。 -
操作系统生成的主要步骤
1.根据硬件环境/用户需求配置功能模块和构造参数
2.构建(build)OS的映像。 -
操作系统的生成前提
1.操作系统由可拆装模块构成
2.有交互式配置工具
3.有映像构建(build)工具 -
Linux操作系统的生成
1.获取Linux内核的源代码
2.选择和启动内核配置程序
3.根据需要配置内核模块和参数
4.重新编译新的内核
5.编译和安装模块
6.启动新内核 -
1.获取Linux内核的源代码
http://www.kernel.org/
#cd /usr/src
#tar zxvf linux-2.6.38.12.tar.gz -
2.选择和启动内核配置程序
#cd /usr/src/linux-2.6
#make config( 文本界面,不推荐使用 )
#make xconfig( 图形窗口模式,xWindow使用)
#make menuconfig ( 文本选择界面,字符终端) -
make menuconfig
在Linux 内核源代码解压之后,在主目录,在命令行上输入 make menuconfig 回车后。弹出一个蓝色窗口:
通过反复的按下空格键,可以切换每一个模块的标记。 -
make xconfig 也可以对系统进行配置
-
3.根据需要配置内核模块和参数
1.Loadable module support 设置对可加载模块的支持
-Enable loadable module support
-Set version info on all module symbols
-Kernel module loader
2.Processor type ans features 设置CPU的类型
-Processor family
-High Memory Support
-Math emulation
-MTTR support:
-Symmetric multi-processing support
3.General setup 对普通的一些属性进行设置
-Networking support
-PCI support
-PCI access mode
-Support for hot-pluggable devices
-PCMCIA/CardBus support
- Parallel port support 并口支持
5.Plug and Play configuration 即插即用配置
6.Block devices 块设备支持的选项
-Normal PC floppy disk support
-Network block device support
7.Networking options //选取TCP/IP networking选项
8.Network device support //网络设备支持的选项
-Ethernet( 10 or 100Mbit)
-RealTeck RTL-8139 PCI Fast Ethernet Adapter support
9.Mice //鼠标设置选项:串口、PS/2等类型鼠标
10.File systems //文件系统类型
-DOS FAT fs
-NTFS file system support
-/proc file system support
11.Sound //声卡驱动、选项:声卡型号
12.USB support //USB接口的设置,根据需要选择
-
4.重新编译新的内核
#make dep 生成依赖 dependency 信息
#make clean 清除旧的编译结果
#make bzImage ./arch/i386/boot/bzImage -
5.编译和安装模块
#make module //编译操作系统的内核
#make module install //安装模块
模块被编译且安装到 /usr/lib<内核版本号> 目录下。 -
6.启动新内核(具体过程与版本有关)
cp bzImage /boot/bzImage
GRUB(常用的配置启动过程的工具):
配置/boot/grub/grub.conf