jollen.org

Jollen 的 Blog
Jollen's email: jollen # jollen.org
more:  Jollen's Training

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 平臺的大原則與方法。

Tags:

純手工打造說明:技術專欄文章為 Jollen 原創,內容皆為人工撰寫,無 AI 生成。轉載請註明出處與作者,並全文引用。轉載時請在文章開頭或結尾明顯處註明「本文出處:https://www.jollen.org,已取得原作者同意並授權使用。」
訂閱電子報:不定期 Jollen's Blog 精選文章隨 Moko365 電子報寄送;請透過 Moko365 電子報訂閱(可隨時取消)。

Copyright(c) 2001–2005 www.jollen.org. All rights reserved.
Last update: 2026-07-22