# 24. Linux kernel

For controlling hardware, that means it include driver and hardware detection

Loading after BIOS and MBR

* if we have new hardware to use,  compile its kernel module, and loading on, then you can control your hardware, that makes you dont have to re-compile entire kernel.
* The hardware vendor should provide it's linux driver kernel module for using it&#x20;

kernel module directory

`$(ls /lib/modules/$(uname -r)/kernel/)`

Download Linux Kernel

[http://www.kernel.org/](http://www.kernel.org/pub/linux/kernel/)

<ftp://linux.cis.nctu.edu.tw/kernel/linux/kernel/>

<ftp://ftp.twaren.net/pub/Unix/Kernel/linux/kernel/>

## Upgrade Kernel by patch

If you wanna upgrade kernel from 3.10.85 to 3.10.89

you have to download the following patch files

patch-3.10.86, patch-3.10.87, patch-3.10.88, patch-3.10.89

### Source dir description

* arch ：與硬體平台有關的項目，大部分指的是 CPU 的類別，例如 x86, x86\_64, Xen 虛擬支援等；
* block ：與區塊裝置較相關的設定資料，區塊資料通常指的是大量儲存媒體！還包括類似 ext3 等檔案系統的支援是否允許等。
* crypto ：核心所支援的加密的技術，例如 md5 或者是 des 等等；
* Documentation ：與核心有關的一堆說明文件，若對核心有極大的興趣，要瞧瞧這裡！
* drivers ：一些硬體的驅動程式，例如顯示卡、網路卡、PCI 相關硬體等等；
* firmware ：一些舊式硬體的微指令碼 (韌體) 資料；
* fs ：核心所支援的 filesystems ，例如 vfat, reiserfs, nfs 等等；
* include ：一些可讓其他程序呼叫的標頭 (header) 定義資料；
* init ：一些核心初始化的定義功能，包括掛載與 init 程式的呼叫等；
* ipc ：定義 Linux 作業系統內各程序的溝通；
* kernel ：定義核心的程序、核心狀態、執行緒、程序的排程 (schedule)、程序的訊號 (signle) 等
* lib ：一些函式庫；
* mm ：與記憶體單元有關的各項資料，包括 swap 與虛擬記憶體等；
* net ：與網路有關的各項協定資料，還有防火牆模組 (net/ipv4/netfilter/\*) 等等；
* security ：包括 selinux 等在內的安全性設定；
* sound ：與音效有關的各項模組；
* virt ：與虛擬化機器有關的資訊，目前核心支援的是 KVM (Kernel base Virtual Machine)

24.2
