Chinaunix首页 | 论坛 | 博客
  • 博客访问: 291170
  • 博文数量: 65
  • 博客积分: 1490
  • 博客等级: 上尉
  • 技术积分: 835
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-16 20:00
文章分类

全部博文(65)

文章存档

2015年(1)

2012年(3)

2010年(7)

2009年(54)

我的朋友

分类: 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

 

 
 
 
 
 
 
 
阅读(815) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~