Responsive image
博碩士論文 etd-0730106-013540 詳細資訊
Title page for etd-0730106-013540
論文名稱
Title
基於ARM微控制器linux平台的開發
Porting Linux on ARM-Based Micro-controllers
系所名稱
Department
畢業學年期
Year, semester
語文別
Language
學位類別
Degree
頁數
Number of pages
123
研究生
Author
指導教授
Advisor
召集委員
Convenor
口試委員
Advisory Committee
口試日期
Date of Exam
2006-07-10
繳交日期
Date of Submission
2006-07-30
關鍵字
Keywords
乙太網、快閃記憶體、非同步傳輸、子系統、移植、微控制器
MAC, JTAG, XIP, FTL, ARM EVB, MTD subsystem, NOR flash, BSP, SDRAM, JFFS2, modbus, Embedded Linux, CFI, MCU, UART
統計
Statistics
本論文已被瀏覽 5862 次,被下載 9598
The thesis/dissertation has been browsed 5862 times, has been downloaded 9598 times.
中文摘要
愈來愈多的嵌入式系統選擇ARM微控制器當作中央處理器,這類系統若沒有作業系統支持,應用範圍及便利性將受到限制,因此嵌入式作業系統變得迫切需要。市面上存在多種商業化嵌入式作業系統,其中Linux具有多項優點,已廣為接受。商業版Linux支付權利金比其他種類的嵌入式作業系統低,核心和應用程式源碼大多以GPL版權公開原始碼發怖,易於移植跨多種機器平台。
現今硬體技術發展成熟,3C產值利潤毛利逐步快速下滑,因此整合現有技術符合實用經濟以使得產品增值,並提高自行開發比例以降低成本。開發者根據產品功能需求選用ARM微控制器,Linux自由發表版未盡支持該廠牌ARM處理器,此時開發人員得自行移植Linux支援該機器平台,嵌入式作業系統無需額外支出權利金;或者尋求有支持的商業版Linux,如此成本將額外支付權利金。
嵌入式系統以輕巧實用配置週邊設備,例如UART介面是低速率且經濟的傳輸方式,主機與目標板溝通可採用RS-232埠,Linux下RS-232埠實現序列操控台功能,扮演鍵盤與螢幕的角色;工業控制常搭配RS-xxx資料傳輸介面,例如RS-485結合應用modbus協定構建廉價的監控網。網路傳輸也是嵌入式系統不可或缺的功能,需求較高資料傳輸速率的應用一般都選擇乙太網,socket系統呼叫方便網路應用程式開發。嵌入式系統一般不搭載磁碟,為了保存永久性資料,flash區塊磁碟系統是一個普遍的策略,藉由MTD子系統層([28])驅動flash。MTD區分成驅動模組及使用者模組,驅動模組採用CFI([40])偵測flash晶片基本資訊(大小、廠牌ID、單位可抹除區塊大小、分割區),以及抹除、寫入方法;使用者模組提供flash轉譯層及檔案系統,MTD BLOCK模擬flash分割區成為磁碟區塊裝置,如此Linux能以檔案系統掛載flash分割區,在此我選用JFFS2檔案系統,JFFS2是專為flash裝置特性設計的檔案系統型態。
本論文對移植Linux到ARM微控制器步驟做探討,第一章導論說明本實作動機,第二章簡介各項用於開發的工具與軟體,以及簡述移植實作的主要步驟。第三章說明LH79525架構平台及模擬板主要週邊,再介紹ARM的程式設計者模型。第四章全盤概括地提出ARM Linux基本知識,以及移植ARM Linux的重要議題。第五章詳述移植Linux至夏普LH79525機器平台,主要嵌入驅動週邊界面含UART、網路MAC、MTD子系統層,各部份原始碼修改及核心組態設定。第六章我們一步步測試移植的ARM Linux,並與樂謙電腦科技公司的LF-314CP溫度控制器([46])整合應用。第七章將整個系統實作提出未來展望、改善空間與結論,由於移植工作包含許多技術細節,我們希望本移植使ARM Linux移植有效率及降低成本,為開發者提供嵌入式系統發展程序及實驗平台帶來助益。
Abstract
More and more embedded systems choose ARM-based micro-controllers as CPU. If no embedded OS built with the system, the application scope will be restricted. Therefore, the need of embedded OS is vital. There are many embedded OS’s in the market, but the embedded Linux has many advantages and is widely accepted. Commercial embedded Linux takes less refund than other embedded OS’s. The kernel and most applications are distributed in GPL open source copyright, and is highly portable to many machine platforms.
Presently, the hardware key-technology is highly skilled. The margin of 3C industrial has gone down rapidly. Therefore, people focus on adapting integrated technology to practicality and innovation to make cost down. Developers choose appropriate ARM micro-controllers according to demanding functionality of their products. The microcontroller is not necessary running with Linux distribution. Two approaches can be used to resolve the embedded OS issue. The first approach is porting Linux to the platform without any refund. The second approach is to pay for commercial Linux.
Embedded system peripheral devices aim at powerful functionalities and economy. For instance, UART interface is cheap and low data transfer rate. The target board communicates with host via RS-232. RS-232 acts as serial console to play dumb terminal under Linux. Industrial applications often make use of RS-xxx for UART physical transmission layer. For instance, RS-485 applies modbus protocol to build cheap monitor systems. Network transmission is a necessary function, and it generally achieves high data transfer rate application through Ethernet. The UNIX-like network socket has served network application very well. Embedded systems are usually diskless systems. In order to keep permanent data, using flash memory as block disk system is a widely adapted strategy and which operates flash memory through MTD subsystems([28]). An MTD subsystem contains two different modules, “user”and “driver”. In the driver module, CFI([40]) is applied to probe flash chip, partition it and provide operating function. Flash translation layer and file-system are applied in the user module. MTD BLOCK is used to emulate the flash partitions as block devices which are then mounted into Linux virtual file system(VFS)with JFFS2 type, designed according to the feature of flash devices.
In this thesis, we will describe in detail the procedure of porting Linux to ARM micro-controllers. The motivation of the work is introduced in chapter 1. In chapter 2, we introduce development tools and the main flow of the porting procedure. In chapter 3, we describe the LH79525 platform and the main perepherals on the target board, then introduce the ARM programmer model. In chapter 4, we examine the required knowledge and the important issues for porting ARM Linux. In chapter 5, we describe the details of porting Linux to run with Sharp LH79525, including modifying the key source codes and adjusting kernel configuration for embedding the UART, ethernet MAC, and MTD subsystem. In chapter 6, we do step-by-step validation and apply an integrated application with the LF-314CP temperature controller([46]) by law-chain technology for the LH79525 target board running with the ported ARM Linux. In chapter 7, we present some issues for future work and improvement, then make a conclusion for the thesis.
目次 Table of Contents
第1章 導論
1.1 研究動機
1.2 研究貢獻
1.3 論文架構
第2章 嵌入式系統與ARM Linux開發流程與工具
2.1 嵌入式系統應用領域
2.1.1 軟硬系統整合:嵌入式作業系統(RTOS)
2.1.2 SOC設計
2.1.3 應用程式發展
2.1.4 內容服務
2.2 ARM Linux開發流程
2.2.1 選用微控制器
2.2.2 選用作業系統
2.2.3 實作流程
2.3 開發環境規劃
2.3.1 開發主機平台
2.3.2 Jtag-ICE除錯
2.4 開發工具與使用的軟體套件
第3章 機器架構平台與模擬板主要元件
3.1 LH79525微控制器
3.1.1 ARM720T組成單元
3.1.2 外部記憶體控制器(EMC)
3.1.3 非同步傳輸控制(UART)
3.1.4 Real Time Clock、Watchdog Timer、Timer
3.1.5 Reset, Clock, Power Controler(RCPC)
3.1.6 Ethernet MAC(EMAC)
3.2 Flash Memory
3.2.1 NAND v.s. NOR flash
3.2.2 NOR flash:MX29LV640BT
3.3 SDRAM
3.4 ARM處理器程式設計者模型
3.4.1 記憶體格式
3.4.2 暫存器群
3.4.3 程式旗標暫存器
3.4.4 ARM處理器模式與例外處理
第4章 移植Linux作業系統
4.1 Linux kernel 2.6
4.1.1 Linux核心發展歷史
4.1.2 Linux核心組成主要部份
4.1.3 Linux核心的分層次概念
4.1.4 Linux原始碼目錄
4.2 移值ARM Linux 的一般化步驟
4.3 Bootloader與作業系統載入初期初始化
4.4 Linux驅動程式運行原理
4.4.1 檔案裝置型驅動程式主要功能
4.4.2 網路裝置區動程式
4.4.3 驅動程式與使用者層之關係
4.4.4 新增驅動程式模組至Linux核心
4.5 操控台(console)、TTY、序列埠
4.6 程式區段規劃與連結草本(linking script)
4.7 核心映像與根目錄檔案系統映像配置規劃
4.8 根目錄檔案系統掛載
4.8.1 掛載RAM disk成根目錄檔案系統
4.8.2 掛載MTD裝置成根目錄檔案系統
4.9 Linux下存取NOR flash
第5章 移值ARM Linux支援Sharp LH79525
5.1 新增支援機器平台的目錄與組態參數
5.1.1 命令列參數CONFIG_CMDLINE
5.1.2 重要的符號
5.1.3 定義連結草本(linking script)區段
5.2 ARM linux核心啟動步驟
5.2.1 Bootstrapping
5.2.2 核心啟動
5.2.3 start_kernel函式
5.2.4 setup_arch函式
5.2.5 例外向量表初始化:trap_init函式
5.2.6 ARM Linux建立虛擬記憶體分頁表
5.3 註冊MCU ID與ARM Linux啟動ID檢查
5.3.1 機器平台ID
5.3.2 機器平台描述子
5.3.3 處理器平台描述子
5.3.4 MCU ID及ARM CORE ID檢查
5.4 機器平台初始化及週邊驅動程式
5.4.1 計時器初始化
5.4.2 中斷控制器與中斷資源管理描述子初始化
5.4.3 初始化操控台
5.4.4 序列埠驅動
5.4.5 乙太網MAC層驅動
5.4.6 MTD驅動NOR flash:MX29LV640BT
5.5 網路服務設置
第6章 驗證移植至Sharp LH79525的ARM Linux
6.1 基本測試
6.2 連接溫度控制器應用
第7章 結論及未來展望
參考文獻及附錄
附錄 A. ARM cross compiler、uclibc、busybox
附錄 B. Linux核心組態參數設置與原始碼關係
附錄 C. 初始化Sharp LH79525的SDRAM控制器
附錄 D. 設定Nor flash存取時序
附錄 E. ARM虛擬記憶體存取流程
附錄 F. Skyeye模擬器安裝與使用
附錄 G. 幾種燒錄NOR flash的方法
附錄 H. tty層與終端機設定
附錄 I. MTD裝置下使用JFFS2檔案系統
附錄 J. 模擬板線路圖
附錄 K. 模擬板設計要點說明
附錄 L. 原始碼重要檔案索引列表
參考文獻 References
[1] http://www.linuxdevices.com/
[2] http://www.microsoft.com/windows/embedded/default.mspx
[3] KARIM YAGHMOR, “Building embedded system”, Sebastopol, CA: O’Reilly.
[4] Micro C lib project, www.uclibc.org; Busybox project, http://busybox.net/
[5] EVB: SDK-LH79524-3126-10, http://www.logicpd.com/
[6] ARM corp., www.arm.com
[7] ARM720(Rev 3)Technical Reference Manual, ARM Doc. No.: ARM DDI-0192A.
[8] ARM Developer Suite-Assembler Guide, ARM Doc. No.: ARM DUI-0068B.
[9] “Standard Test Access Port and Boundary Scan Architecture”, IEEE std 1149.1-2001.
[10] David Seal, “ARM Architecture Reference Manual”, Boston: Addison Wesley (Known as the “ARM ARM”, ARM Doc No.: DDI-0100)
[11] Sharp corp., http://www.sharpsma.com
[12] Sharp corp., “LH79524-525 Data Sheet”, date 2-28-05
[13] Sharp corp., “LH79524-LH79525 Advanced Users Guide”, date 10-25-04
[14] http://www.ucos-ii.com/
[15] www.uclinux.org
[16] ARM Linux original distribution, www.arm.linux.org.uk
[17] Linux author Linus Torvalds web home, http://www.cs.helsinki.fi/u/torvalds/
[18] Linux kernel archive, http://www.kernel.org/
[19] http://www.linux.org/
[20] Andrew S. Tanenbaum and Albert S. Woodhull, “Operating system”, Second Edition, Upper Saddle River, NJ: Prentice-Hall.
[21] Daniel P. Bovet and Marco Cesati, “Understanding the linux kernel”, Sebastopol, CA: O’Reilly.
[22] Alessandro Rubini, “Linux device drivers”, Sebastopol, CA: O’Reilly.
[23] Modbus protocol via RS-485 and TCP/IP, http://www.modbus.org/
[24] multi-ice-gdb-server, http://ecos.sourceware.org/multi-ice.html
[25] Sharp technology application note, “LH79520 SDRAM Connection Usage”
[26] SDRAM, “winbond W982516 datasheet”
[27] Mel Gorman, “Understanding the linux virtual memory management”, Upper Saddle River, NJ: Prentice-Hall.
[28] MTD(memory technology system)subsystem official site,
http://www.linux-mtd.infradead.org/index.html
[29] NOR flash:MXIC MX29LV640BT, datasheet, REV. 0.5, JUL. 08, 2004
[30] ARM simulator/emulator, http://www.skyeye.org
[31] Wiggler-jtag:parallel-jtag, http://www.macraigor.com/
[32] Banyau-U:usb-jtag, agent by http://www.kaise.com.tw/
[33] The newest linux device number assignment,
http://www.lanana.org/docs/device-list/
[34] Q2400 GPRS/GSM modem,
http://www.ravirajtech.com/gsmgprsmodule.html
[35] M. Beck, “linux kernel internel”, Boston: Addison Wesley.
[36] HOWTO:Linux kernelanalysis HOWTO, mini-HOWTO
[37] newsgroup:comp.arch.embedded、comp.sys.arm、comp.os.linux
[38] IEEE Std 802.3x-1997 and IEEE Std 802.3y-1997, ISBN 1-55937-905-7
[39] Archive of many GNU projects, http://directory.fsf.org/
[40] JEDEC standard: JESD 68.01, “Common Flash Interface(CFI)”, http://www.jedec.org
[41] Resources and information on Linux Training and Linux Seminars
http://www.ottawalinuxsymposium.org/
[42] David Woodhouse, “JFFS : The Journalling Flash File System”, Ottawa Linux Symposium 2001
[43] DM9161A, “10/100 Mbps Fast Ethernet Physical Layer Single Chip Transceiver datasheet”, Version:DM9161A-DS-P04, May 17, 2005.
[44] “DM9161 Layout Guide”, Version:DM9161-LG-V01
[45] Vmware Gsx Server, http://www.vmware.com/
[46] Law-chain computer technology co. ltd., www.law-chain.com.tw
[47] “Flash Memory Technology”, Integrated Circuit Corporation,
smithsonianchips.si.edu/ice/cd/MEMORY97/SEC10.PDF
電子全文 Fulltext
本電子全文僅授權使用者為學術研究之目的,進行個人非營利性質之檢索、閱讀、列印。請遵守中華民國著作權法之相關規定,切勿任意重製、散佈、改作、轉貼、播送,以免觸法。
論文使用權限 Thesis access permission:校內外都一年後公開 withheld
開放時間 Available:
校內 Campus: 已公開 available
校外 Off-campus: 已公開 available


紙本論文 Printed copies
紙本論文的公開資訊在102學年度以後相對較為完整。如果需要查詢101學年度以前的紙本論文公開資訊,請聯繫圖資處紙本論文服務櫃台。如有不便之處敬請見諒。
開放時間 available 已公開 available

QR Code