Linux内核包含了很多东西,她能支持很多的驱动,设备,所以Linux内核会很大(通常一个压缩的Linux内核包在70多M)。在嵌入式开发中,我们需要我们自己的内核小一点,以便能放到我们的设备上面跑,但又不失其内核的功能。所以,我们需要对Linux内核进行裁剪,使其足够小。
使用如下的命令,可以配置实现内核的裁剪
[Linuxidc@centos6 linux-3.0]$
[Linuxidc@centos6 linux-3.0]$ export TERM=vt100
[Linuxidc@centos6 linux-3.0]$ make menuconfig
scripts/kconfig/mconf Kconfig
.config - Linux/x86_64 3.0.0 Kernel Configuration
----------------------------------------------------------------------------------------------------------------------------------
+------------------------------------------ Linux/x86_64 3.0.0 Kernel Configuration ------------------------------------------+
| Arrow keys navigate the menu.
|
| [ ] excluded
| |
| +-------------------------------------------------------------------------------------------------------------------------+ |
| | General setup ---> | |
| | [*] Enable loadable module support ---> | |
| | -*- Enable the block layer ---> | |
| | Processor type and features ---> | |
| | Power management and ACPI options ---> | |
| | Bus options (PCI etc.) ---> | |
| | Executable file formats / Emulations ---> | |
| | -*- Networking support ---> | |
| | Device Drivers ---> | |
| | Firmware Drivers ---> | |
| | File systems ---> | |
| | Kernel hacking ---> | |
| | Security options ---> | |
| | -*- Cryptographic API ---> | |
| | [*] Virtualization ---> | |
| | Library routines ---> | |
| | --- | |
| | Load an Alternate Configuration File | |
| | Save an Alternate Configuration File | |
| +---------------------------------------------------------------------------------------------------------------------+ |
|+------------------------------------------------------------------------------------------------------------- +|| +
linux内核是以模块化的形式存在的,或者说linux驱动是以模块化的形式存在的。在linux中,存在有两条链(做一个形象的比喻),一条是驱动链,一条是设备链。