The kernel

kernel就是vmlinuz,就名稱上來說,vm指的是virtual memory,就是有support (DOS不行)。而vmlinuz就是bzImage或是zImage,看其大小。就字面上來說,bzImage是big zImage,也就是如果zImage超過了限制(Bill Gates' 640k),就必須使用bzImage。現在的kernel隨便build一下都會超過,因此都是使用bzImage。make zImage會有如下的錯誤:

Root device is (8, 1)
Setup is 12636 bytes (padded to 12800 bytes).
System is 2173 kB
System is too big. Try using bzImage or modules.
make[1]: *** [arch/x86/boot/zImage] Error 1
make: *** [zImage] Error 2

zImage和bzImage還有一些差別,zImage是將kernel解到low memory(第一個640K); 而bzImage則是解到high memory (1M以上),意思就是說,如果kernel很小,不到640k,那zImage和bzImage都可以引導kernel。這有些歷史架構的因素,不是很了解,不過應該還是跟virtual memory的support有點關係,有錯歡迎補充與指正。

note: http://lxr.linux.no/#linux+v2.6.31/Documentation/x86/boot.txt 有空再來看看這篇。

再來是build kernel

kernel就是vmlinuz,就名稱上來說,vm指的是virtual memory,就是有support (DOS不行)。而vmlinuz就是bzImage或是zImage,看其大小。就字面上來說,bzImage是big zImage,也就是如果zImage超過了限制(640k),就必須使用bzImage。現在的kernel隨便build一下都會超過,因此都是使用 bzImage。make zImage會有如下的錯誤:

Root device is (8, 1)
Setup is 12636 bytes (padded to 12800 bytes).
System is 2173 kB
System is too big. Try using bzImage or modules.
make[1]: *** [arch/x86/boot/zImage] Error 1
make: *** [zImage] Error 2

zImage和bzImage還有一些差別,zImage是將kernel解到low memory; 而bzImage則是解到high memory,這有些歷史架構的因素,不是很了解,不過應該還是跟virtual memory的support有點關係。

build kernel

# Cleaning is done on three levels.
# make clean     Delete most generated files。Leave enough to build external modules
# make mrproper  Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like

其關係如下:

 

make distclean (clean up the unzipped distribution)

    distclean = clean + several additional removes
    distclean = mrproper + 1 additional remove
    mrproper = clean + several additional removes
    get it? distclean is all you should need

 

這樣就應該很清楚了。clean刪了大部分在build中產生的檔案,包括o, ko, tmp, cmd等。mrproper再多刪一點,包括.config。最乾淨的就是distclean,連備份檔都刪了(patch時產生),包括orig, bak, rej等,直接回到剛解開的樣子。

 

make dep

這是在setup dependency,不過在2.6以後已不需要這個步驟了。

make

之後就會build出bzImage了

 

 

 

arrow
arrow
    全站熱搜

    kezeodsnx 發表在 痞客邦 留言(0) 人氣()