?? 編譯linux.txt
字號:
(1)安裝toolchain,2.4.19指定用gcc2.95.3(見Readme)
bash# cd /usr/local
bash# mkdir arm
bash# cd arm
bash# tar Ixvf cross-2.95.3.tar.bz2
Add /usr/local/arm/2.95.3/bin to your path to use the cross compiler
(2)編譯Linux
bash$ su
Password:
bash# cd /usr/src
bash# mkdir arm
bash# chown myuser.mygroup arm
bash# exit
bash$
(3)
First of all, as you are not compiling the kernel natively, you need to modify the top level
kernel makefile. You will need to change the definition of "ARCH" and "CROSS_COMPILE". Replace
the line starting with ARCH := with ARCH := arm.
Set the starting with CROSS_COMPILE = to be the path and prefix to your compiler tools (eg, CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-).
(4)
bash$ make at91rm9200dk_config(必須步驟)
bash$ make oldconfig (直接執行.config腳本,不會出現配置畫面)這兩步等同于下面一步
If you want to further customize your kernel configuration your use either "make menuconfig" which will display a text configuration browser inside your shell or "make xconfig" which will pop up a TCL/TK interface. We choose here to use "make xconfig" because it's very simple and intuitive.
bash$ make xconfig(這步和上面的是互斥的,一種即可,如果.config存在會讀入作為默認值)
(5)
bash$ make clean
bash$ make dep
bash$ make Image
A "vmlinux" file is created in the kernel source directory (where you compiled ofcourse) which leads to the next step : building the uImage. But before you proceed you need to know where the "mkimage" binary is. You can usually find it in U-Boot source distribution. the operation goes like this :
生成vmlinux
Once done, you need to build an uImage from your kernel.
(6)
In order to build an uImage you have to make an uncompressed Image of your kernel, then you have to type the following command when you compile your kernel on your host PC :
[ root @PCLinux ~/linux-2.4.19] /usr/local/arm/2.95.3/bin/arm-linux-objcopy -O binary -S vmlinux linux.bin
[ root @PCLinux ~/linux-2.4.19] gzip -v9 linux.bin
[ root @PCLinux ~/linux-2.4.19] mkimage -A arm -O linux -C gzip -a 0x20008000 -e 0x20008000 -d linux.bin.gz uImage
At this time a "uImage" file is created in the current directory. All you have to do now is to copy this file in your TFTP server directory :
[ root @PCLinux ~/linux-2.4.19] cp uImage /tftpboot/AS/
Note: You can write a script with all these
關于make
make mrproper 是清理代碼樹的動作,保證源代碼是干凈的
make config是純文本方式界面配置
make menuconfig是以文本菜單方式配置
make xconfig是以圖形界面方式配置
make oldconfig
make config — 互動文本程序。組件以線形格式出現,并被一個一個地回答。這種方法不需要運行 X 窗口系統,而且不允許你改變對前面問題的回答。
make xconfig — 這種方法要求 X 窗口系統和 tk 軟件包。我們不推薦你使用這種方法,因為它不能可靠地解析配置文件。
make oldconfig — 這是一個讀取現存配置文件(.config)的非互動腳本,它只提示你回答以前沒有的新問題。
其實make oldconfig和make menuconfig差不多,都會讀取以前的.config文件,但是make oldconfig是非交互的,除非碰到未設置的選項
才會提示輸入。
主目錄下的makefile里面又包含了include arch/$(ARCH)/Makefile
make at91rm9200dk_config是調用arch/$(ARCH)/Makefile里面的規則,將主目錄下面的.config備份為.config.old。然后
將arch/arm/def-configs/$$CFG下的配置文件拷貝為主目錄的.config文件
配置項都是放在config.in里面的。.config文件是保存配置生成的結果。
下載
解壓
將patch文件拷貝linux目錄下,patch -p1 < xxxxx
make at91熱敏200_config(生成.config文件)
make oldconfig(產生真正的動作)或make menuconfig
make dep
make Image
/usr/local/arm/2.95.3/bin/arm-linux-objcopy -O binary -S vmlinux linux.bin
gzip -v9 linux.bin
/usr/local/uboot/mkimage -A arm -O linux -C gzip -a 0x20008000 -e 0x20008000 -d
linux.bin.gz uImage
cp uImage /samba/company/Computer/tftp/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -