2009年1月13日 星期二

2009年1月10日 星期六

kernel 重置

Kernel 重製:

流程:

  1. 設定 kernel 選項
  2. 編譯 kernel
  3. 編譯 modules, 安裝 modules
  4. 安裝 kernel
  5. 設定 boot loader
  6. 重新開機

步驟:

  1. cd 您解壓後的目錄下的 linux 目錄中
  2. make mrproper
  3. make xconfig (menuconfig 或 config), 它會存成 .config
  4. make dep
  5. make bzImage
  6. make modules
  7. make modules_install
  8. cp arch/boot/i386/bzImage /boot
  9. 編輯 /etc/lilo.conf 或 /boot/grub/grub.conf
  10. 執行 lilo -v -v; 若是使用 grub, 則不必.
  11. reboot

scheduler

schedule_timeout
ex:
schedule_timeout(30*HZ);
// sleep for 30 seconds.

linux question website

http://www.linuxquestions.org/questions/programming-9/

linux question website

http://www.linuxquestions.org/questions/programming-9/

2009年1月8日 星期四

kthread

find current kernel threads in the system:
ps -ef
the process with [ ] is kernel thread

is kernel thread preemptive?
1. if CONFIG_PREEMPT is defined, kernel thread is preemptive
2. if CONFIG_PREEMPT is not defined, kernel thread is not preemptive. It will freeze the system if it doesn’t go to sleep.

kthread_create


2009年1月7日 星期三

interrupt

in_interrupt():
 to find out whether it's executing in interrupt context.