Responsive image
博碩士論文 etd-0602104-164645 詳細資訊
Title page for etd-0602104-164645
論文名稱
Title
以NOR FLASH 記憶體為磁碟系統之嵌入式LINUX 實作
Implementation of Embedded LINUX with NOR Flash Memory
系所名稱
Department
畢業學年期
Year, semester
語文別
Language
學位類別
Degree
頁數
Number of pages
84
研究生
Author
指導教授
Advisor
召集委員
Convenor
口試委員
Advisory Committee
口試日期
Date of Exam
2004-05-18
繳交日期
Date of Submission
2004-06-02
關鍵字
Keywords
檔案系統、嵌入式系統
CFI, Filesystem, JFFS2, Linux, MTD, Flash disk
統計
Statistics
本論文已被瀏覽 5772 次,被下載 12202
The thesis/dissertation has been browsed 5772 times, has been downloaded 12202 times.
中文摘要
近來,手持式裝置越來越普及,它們大多趨向低價格、小體積、高運算能力且擁有強大的軟體功能;嵌入式作業系統因之變成迫切性的需求。目前市面上有已有許多不同的嵌入式作業系統,然而,Linux因有許多優點使其脫穎而出並廣泛地被使用。例如,它沒有授權金問題、容易移植且容易發展新應用程式,而最大的優點是它公開原始碼。

嵌入式系統通常是無磁碟系統,為了讓嵌入式Linux儲存永久性資料,使用Flash磁碟系統是一個普遍的策略。我使用MTD(記憶體技術裝置)系統來模擬Flash記憶體為Flash磁碟,並掛載到Linux的檔案系統。這使得存取Flash記憶體的資料只須使用標準的輸出(入)程序,不需要任保額外的作業。MTD系統包括兩個不同種類的模組:使用者模組及驅動程式模組。在驅動程式模組,我使用CFI(通用Flash介面)來偵測Flash晶片並分割它;在使用者模組,使用MTD BLOCK來模擬這些分割成為區塊裝置,並使用JFFS2檔案系統型態把這些區塊裝置掛載為Linux的檔案系統,其中JFFS2是專為Flash裝置特性所設計的檔案系統型態。

本篇論文的目的是在韓國三星公司發展的SMDK2410(以ARM微處理器為主CPU核心)發展板上,使用MTD系統來模擬Flash晶片(型號Am29LV320DB)成為嵌入式Linux的Flash磁碟,期望此實作能有助於其他進階應用的發展及為嵌入式系統研究提供實驗平臺。
Abstract
Recently, Handheld devices are more and more popular. Most of them aim at the low price, small size, high computing power, and powerful functionalities. Therefore, the need for embedded operating systems in the market is absolutely vital. There are many embedded systems in the market, but embedded Linux has some advantages to be outstanding and widely accepted. For example, it has no proprietary problem and high portability, and is comparatively easy to be reconstructed and to develop new applications. Best of them all, it is open source software.

Embedded systems are usually diskless systems. In order to keep permanent data in embedded Linux, using flash disk as its disk system is a widely adapted strategy. We use MTD (Memory Technology Devices) system to emulate flash memory as flash disk mounted into Linux virtual file system. This allows accessing flash memory with standard I/O operations without any extra effort. MTD system contains, “user” and driver”, two different modules. In driver modules, we use CFI (Common Flash Interface) to probe the flash chip and then partition it, while we use MTD BLOCK to emulate the flash partitions as block devices in user modules, and then mount them into Linux’s virtual file system with JFFS2 (Journaling Flash File System version 2) type, which is a file system type specifically designed for flash devices according to the features of flash devices.

The purpose of this thesis is to use MTD system to emulate Am29LV320DB flash chip as a flash disk in embedded Linux running on an ARM-based developing board, SMDK2410, designed by Samsung. I hope this porting can help the development of other advanced applications and provide an empirical platform for the research of embedded systems.
目次 Table of Contents
CHAPTER 1. INTRODUCTION 1
1.1 MOTIVATION 1
1.2 CONTRIBUTION 2
1.3 THESIS STRUCTURE 2
CHAPTER 2. PLATFORM ARCHITECTURE 3
2.1 SYSTEM OVERVIEW 3
2.2 SMDK2410 OVERVIEW 3
2.3 SMDK2410 BLOCK DIAGRAMS 4
2.4 MEMORY CONTROLLER 6
2.5 FLASH MEMORY 7
2.5.1 NAND Flash Controller 8
2.5.1.1 Overview 8
2.5.1.2 Boot Sequence 9
2.5.1.3 Special Function Registers 9
2.5.1.4 Read/Write Data via NAND Flash Controller 10
2.5.1.5 Drawbacks of NAND Flash Memory 11
2.5.2 Onboard NOR Flash, Am29LV320DB 11
2.5.2.1 Boot Sector Addresses 11
2.5.2.2 Command Definitions 13
2.5.2.2.1 Reading Array Data 14
2.5.2.2.2 Reset Command 14
2.5.2.2.3 Program Command Sequence 15
2.5.2.2.4 Chip Erase Command Sequence 15
2.5.2.2.5 Sector Erase Command Sequence 15
2.5.3 The Comparison of NOR Flash and NAND Flash 16
2.5.3.1 NOR Cell 16
2.5.3.2 NAND Cell 16
2.5.3.3 Features Summary 17
2.6 PROGRAMMER’S MODEL OF S3C2410X MICROPROCESSOR 17
2.6.1 Exceptions 18
2.6.1.1 Exception Vectors 18
2.6.1.2 Exception Priorities 18
2.6.2 Registers 19
CHAPTER 3. THE DEVELOPMENT OF EMBEDDED LINUX 21
3.1 TOOL CHAIN 21
3.2 BOOTLOADER 22
3.3 LINUX KERNEL 23
3.3.1 Booting Sequence in the very Beginning 23
3.3.1.1 start_kernel Function 24
3.3.1.1.1 Configure Kernel Command String 24
3.3.1.1.2 setup_arch Function 25
3.3.1.1.3 trap_init Function 26
3.3.2 Add a Device Driver into Kernel’s Source Tree and Build Kernel 26
3.3.3 Enable Flash Memory Devices as Linux’s Disk Systems 27
3.3.3.1 Memory Technology Device 27
3.3.3.1.1 MTD Block 30
3.3.3.1.2 JFFS version 2 32
3.3.3.1.3 Common Flash Interface (CFI) 33
3.3.4 Ram Disk 34
CHAPTER 4. PORTING LINUX TO NOR FLASH WITH FLASH DISK 35
4.1 THE REQUIRED FILES BEFORE GETTING START 35
4.2 INSTALL CROSS COMPILER 36
4.3 PORTING BOOTLOADER TO BOOT FROM NOR FLASH 36
4.3.1 Some Important Addresses and Labels in Linux Kernel 37
4.3.2 Our Bootloader Solution 38
4.4 PORTING LINUX KERNEL 40
4.4.1 Resolve the Interrupt of Keyboard that Causes System Panic 40
4.4.2 Enable MTD to Support Am29LV320DB Flash Chip 41
4.4.2.1 Important Files in This Porting 41
4.4.2.1.1 Important C Files: 41
4.4.2.1.2 Important Header Files 42
4.4.2.2 How the MTD System Probes NOR Flash and Partitions it 44
4.4.2.3 Porting MTD to Probe Am29LV320DB Chip and Partition it 46
4.4.2.4 Configure and Build Linux Kernel 47
4.5 REBUILD RAM DISK IMAGE TO MOUNT FLASH DISK 48
4.6 BUILD FLASH DISK IMAGE (JFFS2 IMAGE) 49
4.7 BUILD DOWNLOAD IMAGE 49
CHAPTER 5. VERIFICATION 51
5.1 SIMPLE TESTING 51
5.2 BRUTE FORCE TESTING 51
CHAPTER 6. FUTURE WORK 53
CHAPTER 7. CONCLUSION 54
REFERENCES 56
APPENDIX A. BUILD TOOL CHAIN FOR ARM MICROPROCESSOR 57
A.1 DOWNLOAD AND INSTALL PRE-BUILT TOOL CHAIN 57
A.2 BUILD TOOL CHAIN BY YOURSELF 57
A.2.1 binutils 58
A.2.2 gcc 58
A.2.3 glibc 60
A.2.4 Make gcc Supporting Threads 61
APPENDIX B. ADD A DEVICE DRIVER IN KERNEL AND BUILD IT 62
B.1 EXAMPLE DRIVER - SCULL 62
B.2 TRACE THE PROCEDURE OF BUILDING THE KERNEL AND MODULES 62
B.2.1 make mrproper 63
B.2.2 make menuconfig 64
B.2.2.1 arch/i386/config.in 64
B.2.2.2 .config 65
B.2.3 make dep 66
B.2.4 make clean 66
B.2.5 make bzImage 66
B.2.6 make modules 68
B.2.7 make modules_install 68
B.2.8 Rules.make 68
B.3 CONFIGURE PROCEDURE 69
B.3.1 Define the Variable for SCULL Driver 69
B.3.2 Add SCULL Module into Menuconfig 70
B.3.3 Add SCULL Driver into the Source Tree 71
B.3.4 Setting the Makefile of SCULL 71
APPENDIX C. INSTALLATION GUIDE OF THIS IMPLEMENTATION 73
C.1 REVISION HISTORY 73
C.2 INSTALL CROSS COMPILER 73
C.3 GENERATE RAMDISK IMAGE 73
C.4 GENERATE FLASH DISK’S IMAGE (JFFS2 IMAGE) 75
C.5 COMPILE BOOTLOADER 76
C.6 CONFIGURE MTD PARTITION 76
C.7 COMPILE LINUX KERNEL 78
C.8 GENERATE THE 4MB IMAGE FILE FOR AM29LV320DB 79
C.9 DOWNLOAD THE 4MB IMAGE FILE INTO AM29LV320DB 80
C.10 TEST THE FLASH DISK 81
APPENDIX D. USE BUSYBOX TO CREATE ROOT FILE SYSTEM 83
D.1 DOWNLOAD AND COMPILE THE BUSYBOX 83
D.2 CONFIGURE SYSTEM FILES 83
D.3 CREATE THE RAM DISK IMAGE 83
參考文獻 References
[1] “Am29LV320DB Data Sheet”, AMD Technology,
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/23579.pdf
[2] “Application Note S3C2410XX 32-Bit RISC Microprocessor Revision 1,” Samsung Electronics,
http://www.samsung.com/Products/Semiconductor/SystemLSI/MobileSolutions/MobileASSP/MobileComputing/S3C2410X/S3C2410X.htm
[3] “Cross-Referencing Linux”, Linux-Reference Project Team,
http://lxr.linux.no/source/
[4] “Flash Memory Technology”, Integrated Circuit Engineering Corporation,
http://smithsonianchips.si.edu/ice/cd/MEMORY97/SEC10.PDF
[5] “JFFS – Journaling Flash File System,” Axis Communications,
http://developer.axis.com/software/jffs/doc/jffs.shtml
[6] “Memory Technology Device (MTD) Subsystem for L inux”, The Linux Memory Technology Device Project, http://www.linux-mtd.infradead.org/
[7] “S3C2410X01 Linux Kernel Install Guide,” Samsung, SMDK2410 developing CD.
[8] “User’s Manual S3C2410XX 32-Bit RISC Microprocessor Revision 1.2,” Samsung Electronics,
http://www.samsung.com/Products/Semiconductor/SystemLSI/MobileSolutions/MobileASSP/MobileComputing/S3C2410X/S3C2410X.htm
[9] A. Oran and S. Talbott, “Managing Projects with make,” O’reilly, January 1996
[10] A. Rubini, and J. Corbet, “Linux Device Drivers, Second Edition,” O’reilly, June 2001
[11] C. Hollabaugh, “Embedded Linux – Hardware, Software, and Interfacing,” Pearson Education, January 2002
[12] D. Jaggar, “ARM Architecture Reference Manual”, Prentice Hall, July 1996
[13] D. P. Bovet and M. Cesati, “Understanding the Linux Kernel,” O’reilly, January 2001.
[14] D. Woodhouse, “JFFS: The Journaling Flash File System,” Ottawa Linux Symposium 2001
[15] S. Furber, “ARM system-on-chip architecture second edition”, Addison Wesley, 2000
電子全文 Fulltext
本電子全文僅授權使用者為學術研究之目的,進行個人非營利性質之檢索、閱讀、列印。請遵守中華民國著作權法之相關規定,切勿任意重製、散佈、改作、轉貼、播送,以免觸法。
論文使用權限 Thesis access permission:校內校外完全公開 unrestricted
開放時間 Available:
校內 Campus: 已公開 available
校外 Off-campus: 已公開 available


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

QR Code