全部博文(65)
分类: LINUX
2009-04-06 10:03:43
*This is a Learning Note of Robert Love's
*By Neil Chiao ( neilchiao at gmail.com )
*From ( neilengineer.cublog.cn )
*欢迎到“新星湾()”指导
*/
1. Kernel basics
1. Download the official kernel from
2. Extract it using: tar jxvf xxx.tar.bz2 or tar zxvf xxx.tar.gz
3. Build it:
1) Kernel configuration
make menuconfig (need ncurses) or
make xconfig (need X11, qt) or
make gconfig (need gtk+) or
make defconfig (default config)
2)Compile
make or
make –j4 (Usual practice is to spawn 1 or 2 jobs per CPU, so j4 for dual core CPU)
4. Install it if you want
make install (install the new kernel to /boot/ if you use grub, it will add a entry in menu.lst automatically)
make modules_install (install the modules to dirs in /lib)
2. Important features of the kernel
1. No libc Linux kernel doesn’t have access to the C library.
2. GNU C Linux kernel is coded in GNU C.
GNU C has its own features. e.g. :
inline functions are used for small time-critical functions.
unlikely() is used when something will unlikely happen.
3. No Memory Protection
4. Do not use Floating point in kernel
5. The kernel has a small fixed-size stack
6. Synchronization and Concurrency
7. Portability is Important