more: Jollen 的 Embedded Linux 教育訓練

« Linux Kernel Porting #1, 基本概念 | Home | Embedded Linux 的系統管理,#2: /etc/fstab 與 /etc/inittab »

Linux Kernel Porting #2, 基本流程與方法

jollen 發表於 January 17, 2005 4:13 PM

Copyright (c) 2005 www.jollen.org
Last date: 2005/01/17

在將 Linux kernel porting 到其它的 ARM 平臺之前, 必須先取得標準 Linux kernel,然後再做 ARM Linux patch。

下載以下檔案:

ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.26-vrs1.gz
ftp://ftp.nsysu.edu.tw/Linux/Kernel/linux/kernel/v2.4/linux-2.4.26.tar.bz2

安裝 Linux kernel 與 patch:

# bzip2 -dc linux-2.4.26.tar.bz2 | tar xf -
# mv linux-2.4.26 linux-2.4.26-vrs1
# cd linux-2.4.26-vrs1
# gzip -dc ../patch-2.4.26-vrs1.gz | patch -p1 -

本文以 KS8695 板子為實例,說明如何將 kernel 2.4.26 (vrs1) porting 到其它的 ARM 平臺。對於所有的 ARM 平臺而言,我們可以歸納出 3 個基本的 porting 流程如下:

1. 登錄一個 Machine ID
2. 編輯 config.in 設定檔與 Makefile.

linux/arch/arm/config.in
arch/arm/Makefile
arch/arm/boot/Makefile
arch/arm/mach-XXX/Makefile

3. 修改原始檔如下.

arch/arm/kernel/entry-armv.S
arch/arm/kernel/debug-armv.S
arch/arm/mach-XXX/arch.c
arch/arm/mach-XXX/irq.c
arch/arm/mach-XXX/mm.c
include/asm/arch/dma.h
include/asm/arch/hardware.h
include/asm/arch/io.h
include/asm/arch/irq.h
include/asm/arch/irqs.h
include/asm/arch/keyboard.h
include/asm/arch/memory.h
include/asm/arch/param.h
include/asm/arch/system.h
include/asm/arch/timex.h
include/asm/arch/uncompress.h
include/asm/arch/vmalloc.h

以上是 porting Linux 到其它 ARM 平臺的大原則與方法。

--jollen

引用通告

如果您想引用這篇文章到您的Blog,
請複製下面的鏈接,並放置到您發表文章的相應界面中。

http://blog.jollen.org/mt-tb.cgi/28

發表一個評論

(您發表的意見將被立即接受,但需要一點時間與後端伺服器做同步,您的留言才會顯示在網站上。為避免 spam 攻撃,按「發表」後請輸入帳號密碼。使用者帳號:「nospam」、密碼:「nospam」。)

Top | 授權條款 | Jollen's Forum: Blog 評論、討論與搜尋
Copyright(c) 2006 www.jollen.org