主机平台:Gentoo 11.2
内核版本:Linux Kernel 3.2.1
CPU型号:Pentium Dual-Core T2370 32-bit
原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/7354039
1、通过查看CPU的信息可以看到Intel Core 2 Duo/Quad / Xeon 51xx/53xx, Pentium Dual-Core T23xx+/Exxxx的硬件信息如下:
首先设置/etc/make.conf中CFLAGS
我的make.conf文件如下:
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" # WARNING: Changing your CHOST is not something that should be done lightly. # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. CHOST="i686-pc-linux-gnu" MAKEOPTS="-j3" USE="gnome X dbus v4l -qt3 -qt4 gtk laptop samba -kde -arts consolekit policykit udev alsa cdr -cups -bluetooth" GENTOO_MIRRORS="http://mirrors.163.com/gentoo" SYNC="rsync://mirrors.163.com/gentoo-portage/" LINGUAS="en_US en_GB uk zh_CN "如果机器是64位的,则设置CFLAGS如下:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
2、内核编译选项
如果你的处理器是双核的,那么激活这个选项:
Linux Kernel Configuration: |
Processor type and features ---> [*] Symmetric multi-processing support (2) Maximum number of CPUs (2-256) [ ] SMT (Hyperthreading) scheduler support [*] Multi-core scheduler support |
Linux Kernel Configuration: |
Processor type and features ---> [*] Machine Check Exception < > Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4 |
Linux Kernel Configuration: |
Processor type and features ---> -- Machine check support [*] Intel MCE features Executable file formats / Emulations ---> [*] IA32 Emulation |
3、自动降频
内核的配置
Linux Kernel Configuration: CPU frequency scaling |
Power management options ---> ACPI (Advanced Configuration and Power Interface) Support ---> [*] ACPI Support <*> Processor CPU Frequency scaling ---> [*] CPU Frequency scaling <*> CPU frequency translation statistics [*] CPU frequency translation statistics details |
你可以随时改变你的CPU的省电方式。
Linux Kernel Configuration: governor |
Power management options ---> CPU Frequency scaling ---> # E.g. for ondemand <*> 'ondemand' cpufreq policy governor |
Linux Kernel Configuration: CPU frequency scaling driver |
Power management options ---> CPU Frequency scaling ---> # E.g. for Intel Core2 Duo <*> ACPI Processor P-States driver |
你启用了它之后它不会在每次启动后自动运行,所以你需要把它加入rc脚本中。
芯片内置的微代码,用于升级CPU中的微程序以修正处理器的BUG
首先添加内核的微码支持
然后添加软件的支持,并添加到开机启动服务自动运行。
sudo emerge emerge -av microcode-ctl sudo /etc/init.d/microcode_ctl start sudo rc-update add microcode_ctl default
如果没有modprobe一下
下面是信息日志
2012-03-14T16:09:01.441949+08:00 yan-laptop kernel: [27137.253418] Registering platform device 'microcode'. Parent at platform
2012-03-14T16:09:01.441986+08:00 yan-laptop kernel: [27137.253423] device: 'microcode': device_add
2012-03-14T16:09:01.455766+08:00 yan-laptop kernel: [27137.253432] bus: 'platform': add device microcode
2012-03-14T16:09:01.455797+08:00 yan-laptop kernel: [27137.253442] PM: Adding info for platform:microcode
2012-03-14T16:09:01.455804+08:00 yan-laptop kernel: [27137.253470] microcode: CPU0 sig=0x6fd, pf=0x80, revision=0xa1
2012-03-14T16:09:01.455810+08:00 yan-laptop kernel: [27137.253477] platform microcode: firmware: requesting intel-ucode/06-0f-0d
2012-03-14T16:09:01.455815+08:00 yan-laptop kernel: [27137.253482] device: 'microcode': device_add
2012-03-14T16:09:01.455819+08:00 yan-laptop kernel: [27137.253493] PM: Adding info for No Bus:microcode
2012-03-14T16:09:01.490927+08:00 yan-laptop kernel: [27137.302793] device: 'microcode': device_unregister
2012-03-14T16:09:01.490964+08:00 yan-laptop kernel: [27137.302799] PM: Removing info for No Bus:microcode
2012-03-14T16:09:01.490970+08:00 yan-laptop kernel: [27137.302852] microcode: CPU1 sig=0x6fd, pf=0x80, revision=0xa1
2012-03-14T16:09:01.490976+08:00 yan-laptop kernel: [27137.302859] platform microcode: firmware: requesting intel-ucode/06-0f-0d
2012-03-14T16:09:01.490981+08:00 yan-laptop kernel: [27137.302864] device: 'microcode': device_add
2012-03-14T16:09:01.490986+08:00 yan-laptop kernel: [27137.302878] PM: Adding info for No Bus:microcode
2012-03-14T16:09:01.508965+08:00 yan-laptop kernel: [27137.320982] device: 'microcode': device_unregister
2012-03-14T16:09:01.509000+08:00 yan-laptop kernel: [27137.320988] PM: Removing info for No Bus:microcode
2012-03-14T16:09:01.509006+08:00 yan-laptop kernel: [27137.321062] device: 'microcode': device_add
2012-03-14T16:09:01.509922+08:00 yan-laptop kernel: [27137.321213] PM: Adding info for No Bus:microcode
2012-03-14T16:09:01.509939+08:00 yan-laptop kernel: [27137.321238] microcode: Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
2012-03-14T16:09:36.164996+08:00 yan-laptop kernel: [27171.976391] microcode: CPU0 updated to revision 0xa4, date = 2010-10-02
2012-03-14T16:09:36.165032+08:00 yan-laptop kernel: [27171.976823] microcode: CPU1 updated to revision 0xa4, date = 2010-10-02
2012-03-14T16:09:36.258277+08:00 yan-laptop kernel: [27172.069653] device: 'microcode': device_unregister
2012-03-14T16:09:36.258314+08:00 yan-laptop kernel: [27172.069658] PM: Removing info for No Bus:microcode
2012-03-14T16:09:36.258321+08:00 yan-laptop kernel: [27172.069764] device: 'microcode': device_create_release
2012-03-14T16:09:36.258327+08:00 yan-laptop kernel: [27172.069794] PM: Removing info for platform:microcode
2012-03-14T16:09:36.258332+08:00 yan-laptop kernel: [27172.069804] bus: 'platform': remove device microcode
2012-03-14T16:09:36.258337+08:00 yan-laptop kernel: [27172.069817] microcode: Microcode Update Driver: v2.00 removed.
升级成功。
更多Gentoo的维护请参考Gentoo Linux维护(专栏)
参考:
http://en.gentoo-wiki.com/wiki/Intel_Microcode
http://hi.baidu.com/goomw/blog/item/3fc65a1b86cf97d2ac6e757f.html