(1)安裝module-init-tools-3.0.tar.gz: # tar -zxvf module-init-tools-3.0.tar.gz # cd module-init-tools-3.0 # ./configure --prefix=/sbin # make # make install # ./generate-modprobe.conf /etc/modprobe.conf
Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers [*] Select only drivers expected to compile cleanly 打開使用開發(fā)中、不完全的代碼/驅(qū)動會讓內(nèi)核配置多出很多選項,由于我們需要使用一些正在開發(fā)中的功能,因此必需打開這一選項。 通用設(shè)置選項,
General setup --->
() Local version - append to kernel release 這里填入的是64字符以內(nèi)的字符串,你在這里填上的字符口串可以用uname -a命令看到。 [*] Support for paging of anonymous memory (swap) 這是使用交換分區(qū)或者交換文件來做為虛擬內(nèi)存的,當然要選上了。 [*] System V IPC 表示系統(tǒng)5的Inter Process Communication,它用于處理器在程序之間同步和交換信息,如果不選這項,很多程序運行不起來 [*] POSIX Message Queues 這是POSIX的消息隊列,它同樣是一種IPC。建議你最好將它選上 [*] BSD Process Accounting 這是充許用戶進程訪問內(nèi)核將賬戶信息寫入文件中的。這通常被認為是個好主意,建議你最好將它選上。 [*] BSD Process Accounting version 3 file format [*] Sysctl support 這個選項能不重新編譯內(nèi)核修改內(nèi)核的某些參數(shù)和變量,如果你也選擇了支持/proc,將能從/proc/sys存取可以影響內(nèi)核的參數(shù)或變量。建議你最好將它選上 [ ] Auditing support 審記支持,用于和內(nèi)核的某些子模塊同時工作,例如SELinux。只有選擇此項及它的子項,才能調(diào)用有關(guān)審記的系統(tǒng)調(diào)用 (15) Kernel log buffer size (16 => 64KB, 17 => 128KB) 內(nèi)核日志緩存的大小,12 => 4 KB,13 => 8 KB,14 => 16 KB單處理器,15 => 32 KB多處理器,16 => 64 KB for x86 NUMAQ or IA-64,17 => 128 KB for S/390 [*] Support for hot-pluggable devices 是否支持熱插拔的選項,肯定要選上 [*] Kernel Userspace Events 內(nèi)核中分為系統(tǒng)區(qū)和用戶區(qū),這里系統(tǒng)區(qū)和用戶區(qū)進行通訊的一種方式,選上。 [*] Kernel .config support 將.config配置信息保存在內(nèi)核中,選上它及它的子項使得其它用戶能從/proc中得到內(nèi)核的配置 [*] Enable access to .config through /proc/config.gz [ ] Configure standard kernel features (for small systems) ---> 這是為了編譯某些特殊的內(nèi)核使用的,通常你可以不選擇這一選項,你也不用對它下面的子項操心了。 --- Configure standard kernel features (for small systems) [ ] Load all symbols for debugging/kksymoops 是否裝載所有的調(diào)試符號表信息,如果你不需要對內(nèi)核調(diào)試,不需要選擇此項。 [*] Enable futex support 不選這個內(nèi)核不一定能正確的運行使用glibc的程序,當然要選上 [*] Enable eventpoll support 不選這個內(nèi)核將不支持事件輪循的系統(tǒng)調(diào)用,最好選上 [*] Optimize for size 這個選項使gcc使用-Os的參數(shù)而不是-O2的參數(shù)來優(yōu)化編譯,以獲得更小尺寸的內(nèi)核,建議選上。 [*] Use full shmem filesystem 除非你在很少的內(nèi)存且不使用交換內(nèi)存時,才不要選擇這項 (0) Function alignment (0) Label alignment (0) Loop alignment (0) Jump alignment
可加載模塊: Loadable module support ---> [*] Enable loadable module support [*] Module unloading 不選這個功能,加載的模塊就不能卸載 [ ] Forced module unloading [ ] Module versioning support (EXPERIMENTAL) [ ] Source checksum for all modules [*] Automatic kernel module loading
處理器類型及特性: Processor type and features ---> Subarchitecture Type (PC-compatible) ---> Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon) ---> [ ] Generic x86 support 這一選項針對x86系列的CPU使用更多的常規(guī)優(yōu)化。如果你在上面一項選的是i386、i586之類的才選這個 [*] HPET Timer Support HPET是替代8254芯片的下一代時鐘處理器。這里你可以安全的選上這一選項。如果硬件不支持的話,將仍使用8254時鐘處理器 [*] Symmetric multi-processing support 對稱多處理器支持,在單CPU的機器上,不選這個選項會更快一些。由于超線程技術(shù),看起來是兩顆CPU,因些要選上這個選項 (1) Maximum number of CPUs (2-255) 支持的最大CPU數(shù) [ ] SMT (Hyperthreading) scheduler support [*] Preemptible Kernel 這個選項能使應用程序即使內(nèi)核在高負載時也很可靠,建議最好選上 [*] Machine Check Exception 這個選項能讓CPU檢測到系統(tǒng)故障時通知內(nèi)核,一般我用組裝的臺式機會選這項。 < > Toshiba Laptop support < > Dell laptop support < > /dev/cpu/microcode - Intel IA32 CPU microcode support < > /dev/cpu/*/msr - Model-specific register support < > /dev/cpu/*/cpuid - CPU information support Firmware Drivers ---> < > BIOS Enhanced Disk Drive calls determine boot disk (EXPERIMENTAL) High Memory Support (4GB) ---> [ ] Allocate 3rd-level pagetables from highmem [ ] Math emulation [*] MTRR (Memory Type Range Register) support [ ] Boot from EFI support (EXPERIMENTAL) [*] Enable kernel irq balancing [ ] Use register arguments (EXPERIMENTAL)
電源管理: Power management options (ACPI, APM) ---> [*] Power Management support [ ] Power Management Debug Support [ ] Software Suspend (EXPERIMENTAL) ACPI (Advanced Configuration and Power Interface) Support ---> APM (Advanced Power Management) BIOS Support ---> CPU Frequency scaling --->
ACPI (Advanced Configuration and Power Interface) Support ---> [*] ACPI Support 這是一種電源管理方式,你可以看看你的BIOS是否支持。如果支持的話建議你選上這項 [ ] Sleep States (EXPERIMENTAL) < > AC Adapter < > Battery <*> Button 捕獲Power、Sleep、Lid(我也不知道這是什么按鈕)等按鈕是否按下,并做相應的動作 <*> Video 集成在板上的顯卡的ACPI支持,對有些板卡可能不起作用 < > Fan <*> Processor <*> Thermal Zone < > ASUS/Medion Laptop Extras < > IBM ThinkPad Laptop Extras < > Toshiba Laptop Extras (0) Disable ACPI for systems before Jan 1st this year [ ] Debug Statements [*] Power Management Timer Support
APM (Advanced Power Management) BIOS Support ---> < > APM (Advanced Power Management) BIOS support 高級電源管理的支持,一般來說筆記本應該選上,臺式機可以不選。 [ ] Ignore USER SUSPEND [*] Enable PM at boot time [ ] Make CPU Idle calls when idle [ ] Enable console blanking using APM [ ] RTC stores time in GMT 按Unix的標準,硬件的時鐘應該設(shè)為格林威治時間 [ ] Allow interrupts during APM BIOS calls [*] Use real mode APM BIOS call to power off
總線類型: [*] PCI support PCI access mode (Any) --->強列建議選Any,系統(tǒng)將優(yōu)先使用MMConfig,然后使用BIOS,最后使用Direct檢測PCI設(shè)備。 [ ] Message Signaled Interrupts (MSI and MSI-X) [ ] Legacy /proc/pci interface [ ] PCI device name database [ ] ISA support [*] EISA support [*] Vesa Local Bus priming [*] Generic PCI/EISA bridge [*] EISA virtual root device [ ] EISA device name database [ ] MCA support < > NatSemi SCx200 support PCCARD (PCMCIA/CardBus) support ---> PCI Hotplug Support --->
PCCARD (PCMCIA/CardBus) support --->一般只有筆記本電腦上才會有PCMCIA插槽,如果你是臺式機的話,可以不選這一項,然后跳過這一部份。
PCI Hotplug Support ---> < > Support for PCI Hotplug (EXPERIMENTAL) 一般來講只有服務器上會有熱插拔的設(shè)備,如果你使用的是臺式機,你可以不選擇此項并跳過這一部份。
可執(zhí)行文件格式, [*] Kernel support for ELF binaries ELF是開放平臺下最常用的二進制文件,它支持不同的硬件平臺 < > Kernel support for a.out and ECOFF binaries <*> Kernel support for MISC binaries 此選項允許插入二進制的封裝層到內(nèi)核中,當使用Java、.NET、Python、Lisp等語言編寫的程序時非常有用
編譯內(nèi)核: # cd /usr/src/linux # make dep -----鏈接程序代碼與函數(shù)庫. # make clean -----刪除不必要的模塊和文件. # make bzImage -----開始編譯系統(tǒng)內(nèi)核. # make modules -----開始編譯外掛模塊. # make modules_install -----安裝編譯完成的模塊. 要好常時間的,我洗了一件衣服,抽了N根白沙之后,總算完成了,好激動呀! # su - # /sbin/depmod -a -----創(chuàng)建模塊的鏈接.
如果你用GRUB來管理開機,簡單點就是你裝了win還裝了linux就要修改/boot/grub下的menu.1st文件: # vi /boot/grub/menu.1st 鍵入i進入編輯模式:
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,1) # kernel /boot/vmlinuz-version ro root=/dev/hda2 # initrd /boot/initrd-version.img #boot=/dev/hda default=1 timeout=10 splashimage=(hd0,1)/boot/grub/splash.xpm.gz title Fedora Core(2.6.11) root (hd0,1) kernel /boot/vmlinuz ro root=/dev/hda2 ---你的linux所在的分區(qū) title DOS rootnoverify (hd0,0) chainloader +1