Linux2.4.18核心移植到s3c2410全過程(轉)
Linux2.4.18核心移植到s3c2410全過程(轉)[@more@]一.下載核心以及相應補丁:
Linux核心:linux-2.4.18.tar.bz2
補丁:
patch-2.4.18-rmk7.gz
patch-2.4.18-rmk7-swl8.gz
patch-2.4.18-rmk7-swl8-cy2.gz
patch-2.4.18-rmk7-swl8-cy2-lc3.gz
二. 解壓縮:
# tar xzvf linux-2.4.18.tar.gz
# gunzip patch-2.4.18-rmk7.gz
# gunzip patch-2.4.18-rmk7-swl8.gz
# gunzip patch-2.4.18-rmk7-swl8-cy2.gz
# gunzip patch-2.4.18-rmk7-swl8-cy2-lc3.gz
三. 打補丁:
# cd linux-2.4.18
# patch -p1 < .. patch-2.4.18-rmk7
# patch -p1 < .. patch-2.4.18-rmk7-swl8
# patch -p1 < .. patch-2.4.18-rmk7-swl8-cy2
# patch -p1 < .. patch-2.4.18-rmk7-swl8-cy2-lc3
四. 修改相關程式碼:
(1)修改主目錄的Makefile
vi linux/Makefiel
a.指定目標平臺為ARM:
#ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
ARCH := arm
b.指定交叉編譯器:
CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-
(我的交叉編譯工具放在/usr/local/arm資料夾下)
(2)修改arch目錄中的檔案
Linux的arch目錄存放硬體相關的核心程式碼,因此,在Linux核心中增加對S3C2410的支援,最主要就是要修改arch目錄中的檔案。
在arch/arm/Makefile檔案中加入:
ifeq ($(CONFIG_ARCH_S3C2410),y)
TEXTADDR = 0xC0008000
MACHINE = s3c2410
Endif
(3) 在arch/arm/boot/Makefile檔案中加入:
ifeq ($(CONFIG_ARCH_S3C2410),y)
ZTEXTADDR = 0x30008000
ZRELADDR = 0x30008000
endif
(4) 修改arch/arm/mm/mm-armv.c檔案(arch/arm/mm/目錄中的檔案完成與ARM相關的MMU處理):
修改:
init_maps->bufferable = 0;
為:
init_maps->bufferable = 1;
五.編譯核心:
make menuconfig
一定要選上 :FILE_SYSTEM
CONFIG_DEVFS_FS=y
修改啟動命令列:
CONFIG_CMDLINE="root=/dev/mtdblock2 init=/linuxrc console=ttyS0,115200 devfs=mount load_ramdisk=0"
Make dep
Make zImage
執行結果:(成功)
Uncompressing Linux..................................................... done, booting the kernel.
Linux version 2.4.18-rmk7-swl8 (ldomain) (gcc version 2.95.3 20010315 (release)) #1 三 9月 6 15:05:59 CST 2006
CPU: SAMSUNG S3C2410(Arm920T)sid(wb) revision 0
Machine: CyberLab LN2410
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttyS0 mem=64M devfs=mount
Console: colour dummy device 80x30
Calibrating delay loop... 96.05 BogoMIPS
Memory: 64MB = 64MB total
Memory: 62668KB available (1402K code, 328K data, 68K init)
Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.10 (20020120) Richard Gooch ()
devfs: boot_options: 0x1
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
l3 S3C2410 Adapter Initialized
ttyS00 at MEM 0xe0000000 (irq = 52) is a S3C2410
ttyS01 at MEM 0xe0004000 (irq = 55) is a S3C2410
screen_cpu:c480e000 ,screen_dma:33f01000
Console: switching to colour frame buffer device 80x30
Installed LN2410X TFT 16bpp frame buffer
by redizi, CyberLab 2003
pty: 256 Unix98 ptys configured
Loading S3C2410 Touch Screen Driver
Installing S3C2410 RTC
S3C Real Time Clock driver v1.00
block: 128 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
eth0: incorrect signature 0x4000
cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP
loop: loaded (max 8 devices)
S3C2410 UDA1341 / IIS initialized
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Creating 5 MTD partitions on "Samsung K9D1208V0M":
0x00000000-0x00030000 : "boot"
0x00030000-0x00200000 : "kernel"
0x00200000-0x02000000 : "rootfs"
0x02000000-0x03000000 : "ext-fs1"
0x03000000-0x04000000 : "ext-fs2"
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xd9000000, IRQ 26
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
VFS: Mounted root (cramfs filesystem).
Mounted devfs on /dev
Freeing init memory: 68K
console=/dev/console
init started: BusyBox v0.60.3 (2002.05.13-08:36+0000) multi-call binary
Starting pid 16, console /dev/console: '/etc/init.d/rcS'
exec: /usr/etc/rc.local: No such file or directory
Waiting for enter to start '/bin/sh' (pid 19, terminal /dev/console)
Please press Enter to activate this console.
Starting pid 19, console /dev/console: '/bin/sh'
BusyBox v0.60.3 (2002.05.13-08:36+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ls
bin etc linuette mnt qt tmp var
dev lib linuxrc proc sbin usr
#
Linux核心:linux-2.4.18.tar.bz2
補丁:
patch-2.4.18-rmk7.gz
patch-2.4.18-rmk7-swl8.gz
patch-2.4.18-rmk7-swl8-cy2.gz
patch-2.4.18-rmk7-swl8-cy2-lc3.gz
二. 解壓縮:
# tar xzvf linux-2.4.18.tar.gz
# gunzip patch-2.4.18-rmk7.gz
# gunzip patch-2.4.18-rmk7-swl8.gz
# gunzip patch-2.4.18-rmk7-swl8-cy2.gz
# gunzip patch-2.4.18-rmk7-swl8-cy2-lc3.gz
三. 打補丁:
# cd linux-2.4.18
# patch -p1 < .. patch-2.4.18-rmk7
# patch -p1 < .. patch-2.4.18-rmk7-swl8
# patch -p1 < .. patch-2.4.18-rmk7-swl8-cy2
# patch -p1 < .. patch-2.4.18-rmk7-swl8-cy2-lc3
四. 修改相關程式碼:
(1)修改主目錄的Makefile
vi linux/Makefiel
a.指定目標平臺為ARM:
#ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
ARCH := arm
b.指定交叉編譯器:
CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-
(我的交叉編譯工具放在/usr/local/arm資料夾下)
(2)修改arch目錄中的檔案
Linux的arch目錄存放硬體相關的核心程式碼,因此,在Linux核心中增加對S3C2410的支援,最主要就是要修改arch目錄中的檔案。
在arch/arm/Makefile檔案中加入:
ifeq ($(CONFIG_ARCH_S3C2410),y)
TEXTADDR = 0xC0008000
MACHINE = s3c2410
Endif
(3) 在arch/arm/boot/Makefile檔案中加入:
ifeq ($(CONFIG_ARCH_S3C2410),y)
ZTEXTADDR = 0x30008000
ZRELADDR = 0x30008000
endif
(4) 修改arch/arm/mm/mm-armv.c檔案(arch/arm/mm/目錄中的檔案完成與ARM相關的MMU處理):
修改:
init_maps->bufferable = 0;
為:
init_maps->bufferable = 1;
五.編譯核心:
make menuconfig
一定要選上 :FILE_SYSTEM
CONFIG_DEVFS_FS=y
修改啟動命令列:
CONFIG_CMDLINE="root=/dev/mtdblock2 init=/linuxrc console=ttyS0,115200 devfs=mount load_ramdisk=0"
Make dep
Make zImage
執行結果:(成功)
Uncompressing Linux..................................................... done, booting the kernel.
Linux version 2.4.18-rmk7-swl8 (ldomain) (gcc version 2.95.3 20010315 (release)) #1 三 9月 6 15:05:59 CST 2006
CPU: SAMSUNG S3C2410(Arm920T)sid(wb) revision 0
Machine: CyberLab LN2410
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 load_ramdisk=0 init=/linuxrc console=ttyS0 mem=64M devfs=mount
Console: colour dummy device 80x30
Calibrating delay loop... 96.05 BogoMIPS
Memory: 64MB = 64MB total
Memory: 62668KB available (1402K code, 328K data, 68K init)
Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.10 (20020120) Richard Gooch ()
devfs: boot_options: 0x1
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
l3 S3C2410 Adapter Initialized
ttyS00 at MEM 0xe0000000 (irq = 52) is a S3C2410
ttyS01 at MEM 0xe0004000 (irq = 55) is a S3C2410
screen_cpu:c480e000 ,screen_dma:33f01000
Console: switching to colour frame buffer device 80x30
Installed LN2410X TFT 16bpp frame buffer
by redizi, CyberLab 2003
pty: 256 Unix98 ptys configured
Loading S3C2410 Touch Screen Driver
Installing S3C2410 RTC
S3C Real Time Clock driver v1.00
block: 128 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
eth0: incorrect signature 0x4000
cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP
loop: loaded (max 8 devices)
S3C2410 UDA1341 / IIS initialized
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Creating 5 MTD partitions on "Samsung K9D1208V0M":
0x00000000-0x00030000 : "boot"
0x00030000-0x00200000 : "kernel"
0x00200000-0x02000000 : "rootfs"
0x02000000-0x03000000 : "ext-fs1"
0x03000000-0x04000000 : "ext-fs2"
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xd9000000, IRQ 26
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
VFS: Mounted root (cramfs filesystem).
Mounted devfs on /dev
Freeing init memory: 68K
console=/dev/console
init started: BusyBox v0.60.3 (2002.05.13-08:36+0000) multi-call binary
Starting pid 16, console /dev/console: '/etc/init.d/rcS'
exec: /usr/etc/rc.local: No such file or directory
Waiting for enter to start '/bin/sh' (pid 19, terminal /dev/console)
Please press Enter to activate this console.
Starting pid 19, console /dev/console: '/bin/sh'
BusyBox v0.60.3 (2002.05.13-08:36+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ls
bin etc linuette mnt qt tmp var
dev lib linuxrc proc sbin usr
#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10617731/viewspace-961464/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 升級RH9.0到2.6.5核心全過程(轉)
- Exynos4412 核心移植(二)—— 核心編譯過程分析編譯
- i.MX8MP開發板移植驅動全過程
- Linux 核心處理中斷全過程解析Linux
- 基於S3C2410處理器目標板的Linux移植(轉)S3Linux
- solaris 10 網路配置全過程(轉)
- JVM核心之JVM執行和類載入全過程JVM
- 網頁訪問全過程剖析[轉].md網頁
- 從輸入 URL 到頁面載入全過程
- SlackWare10.1從(硬碟)安裝到配置(包括升級)全過程(轉)硬碟
- oracle索引核心過程Oracle索引
- 編譯核心過程編譯
- (轉)POSTFIX郵局系統搭建全過程1
- 透過例項看VCL元件開發全過程(一) (轉)元件
- 透過例項看VCL元件開發全過程(二) (轉)元件
- 如何將複雜的應用邏輯從儲存過程移植到業務層儲存過程
- Django 從啟動到請求到響應全過程分析-入門版Django
- 設定autotrace全過程
- Hydro OJ搭建全過程
- TS16949 全過程諮詢流程(轉載)
- Solaris到Linux應用的移植(轉)Linux
- 從 PostCSS 外掛,體驗編碼到釋出全過程CSS
- 瀏覽器輸入URL到響應頁面的全過程瀏覽器
- 手把手教你移植u-boot(目標平臺S3C2410)bootS3
- 從DBA到Oracle Applications DBA的轉變過程 (轉)OracleAPP
- 硬碟上安裝LINUX FC4全過程(轉)硬碟Linux
- 000 上傳本地庫到Github遠端庫過程全記錄Github
- Linux核心初始化過程簡要介紹(轉)Linux
- MapReduce 執行全過程解析
- 頁面載入全過程
- DNS解析全過程及原理DNS
- centos 安裝MySQL全過程CentOSMySql
- QQ黑市揭密:被盜到出售過程詳解(轉)
- 編譯移植Mplayer到mini2440開發板的過程及問題解決辦法編譯
- Android觸控事件全過程分析:由產生到Activity.dispatchTouchEvent()Android事件
- 在ARMSYS上進行uClinux核心移植的總結(轉)Linux
- 記憶體訪問全過程記憶體
- Git伺服器搭建全過程Git伺服器