• 沒有找到結果。

單晶片無線多媒體資訊家電之設計與製作---子計畫I:應用於系統單晶片嵌入式LINUX作業系統之實作(II)

N/A
N/A
Protected

Academic year: 2021

Share "單晶片無線多媒體資訊家電之設計與製作---子計畫I:應用於系統單晶片嵌入式LINUX作業系統之實作(II)"

Copied!
6
0
0

加載中.... (立即查看全文)

全文

(1)

行政院國家科學委員會補助專題研究計畫成果報告

※※※※※※※※※※※※※※※※※※※※※※※※※

應 用 於 系 統 單 晶 片 嵌 入 式 L in u x 作 業 系 統 之 實 作 (I I )

An Implementation of Embedded Linux for SOC

(II)

※※※※※※※※※※※※※※※※※※※※※※※※※

計畫類別:□個別型計畫

þ

整合型計畫

計畫編號:NSC 90-2218-E-009-011

執行期間:90 年 8 月 1 日至 91 年 7 月 31 日

計畫主持人: 張瑞川

國立交通大學資訊科學學系

計畫參與人員: 黃昭維

國立交通大學資訊科學學系

林衍良

國立交通大學資訊科學學系

蔡建東

國立交通大學資訊科學學系

宋孟霖

國立交通大學資訊科學學系

莊豐穗

國立交通大學資訊科學學系

本成果報告包括以下應繳交之附件:

赴國外出差或研習心得報告一份

赴大陸地區出差或研習心得報告一份

出席國際學術會議心得報告及發表之論文各一份

國際合作研究計畫國外研究報告書一份

執行單位:國立交通大學資訊科學學系

國 九 十 一 年 五 月 二 十 日

(2)

行政院國家科學委員會專題研究計畫成果報告

應 用 於 系 統 單 晶 片 嵌 入 式 L in u x 作 業 系 統 之 實 作 (I I )

An Implementation of Embedded Linux for SOC (II)

計畫編號:NSC 90-2218-E-009-011

執行期限:90 年 8 月 1 日至 91 年 7 月 31 日

主持人:

張瑞川

國立交通大學資訊科學學系

計畫參與人員:黃昭維、林衍良、蔡建東、宋孟霖、莊豐穗

國立交通大學資訊科學學系

1. Chinese Abstr act

隨著系統單晶片技術的發展,近年來

嵌入式即時作業系統的相關研究受到相

當程度的重視。本計劃將以功能強大,高

穩定度的 Linux 作業系統為基礎,發展適

用於系統單晶片嵌入式 Linux 作業系統。

我們研究及實作以唯讀記憶體為基礎的

Linux 核心,在原地執行功能,即時作業

支援,Flash 檔案系統以及系統單晶片電源

管理等系統功能。我們也將重組 Linux 成

為模組化核心以適應不同系統單晶片之

系統需求。

在 計 劃 的 第 一 年 , 我 們 已 經 修 改

Linux 的初始化,記憶體,及檔案子系統,

並將 Linux 移植到 Evaluation Board 上。

在這一年度(第二年),我們致力於將核

心程式元件化。並且研究加入電源管理及

即時功能於 Linux 上。

關鍵詞: Linux; 嵌入式系統

Abstr act

With the development of System on

Chip (SoC) technology, researches on

embedded, real-time systems has received

lots of attention. Based on the power,

reliability of Linux, the goal of this project

is to develop an Linux system that is suitable

for SoC. We plan to research and implement

a

ROM-based

Linux

kernel,

Execution-In-Place(XIP) function, real-time

support, Flash memory file system, and

power management for SoC. We also plan

to modulize Linux kernel so that it can fit

various reqirements of different SoC.

In the first year of the project, we have

modified the initialization, memory, and file

subsystems of Linux, and port the Linux to

the evaluation board. In this year (i.e. the 2

nd

year), we put focus on partitioning Linux

into components. In addition, we also put

research

efforts

on

adding

power

management and real-time functionality to

Linux.

Keywor ds: Linux; Embedded Systems;

2. 計畫緣由與目的

Linux 是目前世界上最受到重視的作

業系統,其成長率已遠超過 Microsoft 的

Windows 2000 。 更 由 於 Linux 是 Open

Source 政策下的作業系統,透過網際網路

有成千上萬的工程師同時改進其品質及增

強 功 能 , 使 得 其 前 景 大 為 看 好 , 有 與

Microsoft 的 Windows 2000 分庭抗禮的實

力。

然而,在 embedded 應用方面,Linux

僅支援少數以 VME BUS 為基礎的應用系

統,並未有解決方案提供完整的支援。尤

其對系統單晶片嵌入式系統方面的應用更

需重新設計 Linux 核心架構,以適應不同

SoC 所需的作業系統核心 IP。同時即時作

(3)

業支援(real- time system support)對 SoC 嵌

入式系統的應用亦相當重要。目前雖已有

幾所國外大學在研究如何在 Linux 作業系

統上加入即時作業能力,但是其研究並未

完全考量嵌入式系統的需求。

交通大學資訊科學系系統實驗室多年

來 的 研 究 重 點 是 微 核 心 作業 系 統(Micro

Kernel Operating Systems)。此外,我們近

年來也在國科會的支持下製力於元件化及

可擴充式作業系統架構(extensible kernel

architecture)的研究。

在應用程式的開發步驟裡,利用軟體

元件(componentware)幾乎已成為程式設計

不可或缺的一環。使用軟體元件不但可使

程式開發更為間單、軟體產能更為提高,

同時也達成了軟體的再使用性(reuse),例如

微 軟 公 司 的 VBX,OLE,COM,DCOM 及

Active X, Sun Micro 的 Java Bean 等技術,

對應用軟體的開發有關鍵性的影響力。

但是作業系統核心程式架構和發展方

法並沒有太大的進展,相關程式開發和除

錯工具和 20 年前相比仍然沒有太大的改

變。所以作業系統的維護和開發新功能的

成本仍然很高。

所以在系統軟體方面,如何能利用軟

體元件的觀念,以加速即時核心程式的研

發,及降低後續維護成本,是學術界研究

作業系統發展重要的研究方向。

我們在國科會前期計劃支持下探討新

的即時核心程式架構,並製作出完全模組

化的 Lyra 即時作業系統和發展環境,整個

系統包括模組化的核心程式、輸出系統驅

動程式模組、檔案系統、通訊協定程式,

支援 Java API 的 virtual machine,和以瀏覽

器(Browser)為基礎的桌面系統等,如圖一。

C o r e C o r e L y r a O S H A L L y r a O S H A L L i n u x D r i v e r L i b r a r yL i n u x D r i v e r L i b r a r y T C P S t a c k T C P S t a c k R T O S l i k e A P I + B S D S o c k e t A P I R T O S l i k e A P I + B S D S o c k e t A P I L y r a 3 2 W i n L i b L y r a 3 2 W i n L i b L y r a 3 2 A P I L y r a 3 2 A P I L i n u x S V G A l i b L i n u x S V G A l i b E l a n S C 4 1 0 U C E R e f e r e n c e b o a r d / s t r o n g A R M b o a r d P C / E l a n S C 4 1 0 U C E R e f e r e n c e b o a r d / s t r o n g A R M b o a r d M u l t i m e d i a A p p l i c a t i o n s P e r s o n a l I n f o . M a n a g e m e n t A C P I A C P I I n t e r n e t A P O f f i c e O f f i c e A p p l i c a t i o n s F i l e s y s F i l e s y s D e s k T o p S y s t e m M u l t i m e d i a M u l t i m e d i a A p p l i c a t i o n s

圖一

Lyra 即時作業系統雖可做為研究作業

系統架構和效能測試的研究平台,但是受

限人力、物力無法完成完整的 API,以及

沒有完整的程式發展系統,所以無法完全

因應 SoC 各種不同嵌入式應用領域的需

求。本計劃預計以三年的時間,配合總計

劃以及各子計劃 IP 的研發,在保留 Linux

作業系統 API 以支援各項多媒體應用程式

開發的狀況下,重新探討 Linux 核心程式

架構。我們將利用軟體元件(componentware)

的觀念重新設計具即時作業功能及支援嵌

入式作業方式的模組化 Linux 核心程式。

國內外有關本計劃之研究情形:

國內外許多大學和研究機構均以從事

關於即時核心程式及相關發展環境的研

究。在國內探討核心程式架構或實作作業

系統的包括台灣大學、成功大學、交通大

學、中研院資訊所和資訊工業策進會。在

國外從 1994 年開始,關於核心架構的探討

開始受到包括 ACM SIGOPS 及 USENIX 兩

個 Communities 的重視,這其中已經開始

著眼於 Componentized 的作業系統只有法

國 Chorus/ClassiX。而著眼於 Code-reuse

的只有美國猶他大學的 Fluk OSKit 計劃,

他們也只達到使核心程式交易於使用,並

移植了一些共享系統軟體的目的而已,尚

未能夠做到易於維護,修改甚至於開發新

元件。

卡內基美濃大學的 Resource-centric 核

心計劃則探討到即時資源的保留技術但所

使用的微核心架構的 RT-Mach。哈佛大學

的 VINO 核心計劃,則是在核心程式中加

入了 Transaction 的觀念,希望系統服務可

以藉由動態連結技術,加入核心程式中,

而 Transaction 的目的就是確保在外加執行

碼到核心程式中時,系統仍能安全運作。

VINO 的最大困難就是系統效能,在加入了

Transaction 後,核心程式速度大量降低,

而影響到整體效能。

華盛頓大學的 SPIN 核心計劃和 VINO

一樣,希望簡易的核心程式是來自於動態

連結的外加程式執行碼。由於使用者程式

可以輕易外加核心執行碼,核心程式可以

(4)

高度符合使用者程式需求,而整體效能亦

可提升。個人認為這是一個很好的方法,

用來產生一個易於替換,修改的核心程

式,且用於應用程式的軟體元件技術,說

不定可以很簡單的搬到核心程式中。但是

SPIN 並沒有真正區分、制定系統軟體元

件,如何把環環相扣的各系統模組確實模

組化是一個很重要的研究問題。此外,MIT

的 Exokernel 核心計劃,則是將系統軟體模

組便成為應用程式程式庫一部分,目的是

減少系統及使用者程式間的控制變換次

數,以提高效能。在觸及如何提高軟體再

用性,Exokernel 核心的系統架構並沒有解

決任何問題,而諸如 UIUC 大學的 Choice

核心程式計劃,是引進物件導向的技術到

核心程式中。個人認為純物件導向的核心

架構,並不太可行。例如繼承只會增加核

心程式的複雜度,無助於核心程式的模組

化。

許 多 現 有 的 商 用 系 統 如 PSOS+ ,

LynxOS,VTRX,Chorus 等嵌入式作業系

統亦是我們參考研究的對象。但是商用作

業系統的原始程式並不公開,無法掌握其

核心技術。最近亦有國內外的資訊業者,

如 Lineo 及資策會,正在進行將 Linux 改成

嵌入式,但是他們大都僅小幅更改 Boot 部

分而未重新設計 Linux 核心。

3. 結果與討論

本計劃今年完成的研究成果如下:

1.Linux 核心程式元件化

2.Linux 電源管理系統

3.Linux 即時功能

茲將其研究成果分述如下:

3.1 Linux 核心程式元件化

雖然在應用程式的開發步驟裡,利用

軟體元件幾乎已成為程式設計不可或缺的

一環。但核心程式方面,如何能利用軟體

元件的觀念,以加速即時核心程式的研

發,一直是作業系統發展重要的研究方

向。我們利用前幾年開發元件化系統核心

的經驗,將 Linux 原先的各子系統之間的

介面釐清。並進一步將各子系統包成模組

元件。每一元件提供若干服務點(service

points)。 元 件 間 就 經 由 這 些 服 務點來溝

通。到目前為止,我們已經釐清的元件介

面包含:初始化,記憶體管理,檔案系統

管理,及執行緒管理。

1. Linux 電源管理系統

因為嵌入式設備大多用電池當作其電

力來源,所以嵌入式系統設計的一個重要

原則就是要省電。目前很多硬體都有提供

省電的機制,例如:CPU, memory, disk,

monitor 等等。但卻沒有核心程式去很有效

的利用這些硬體特性來讓整個系統的耗電

量降至最低。國內外對於電源管理相關的

研 究 主 要 分 成 兩 部 分 : 動 態 電 源 管 理

(Dynamic Power Management)及動態電壓

調整(Dynamic Voltage Scaling)兩類。前者

是利用硬體的省電模式特性。當系統發現

暫時用不到某硬體時,就將其切換到省電

模式。如此一來就可減少耗電量。後者主

要是探討 CPU 的省電。CPU 提供多種工作

電壓。工作電壓低時雖然效能較差,但由

於電源消耗與電壓平方成正比,所以降低

電壓對於省電很有幫助。在我們的 Linux

系統中,我們以前者為主。因為我們最主

要的介面是 Wireless LAN 的介面,所以我

們與 Wireless LAN MAC 層有一個 Power

Save 介 面 。 藉 由 此 介 面 , 我 們 可 以 使

Wireless LAN 的硬體進入省電模式。同

時,我們也要在系統整合時調整我們使用

CPU 的頻率,藉以讓整個系統可已有較低

的耗電量。

(5)

3.3 Linux 即時功能

由於 Linux 原始的設計是針對一般應

用,所以它並不適合支援即時的應用程

式。於是國外有一些研究就開始改進 Linux

以達到支援即時的應用程式的目的。例

如:KURT, RTLinux, RTAI 及 TimeSys

Linux/RT 等等。在我們的計畫中,我們已

經分析了 RTLinux 的架構及其優點。接著

我們評估 RTLinux 中哪些功能是我們的

Linux 核心程式所需要的,再將這些部分移

植 到 我 們 以 Evaluation board 為 基 礎 的

Linux 上。

在下一年度,我們將把 Wireless LAN

功能加入我們的嵌入式 Linux 核心程式,

並在 SoC 發展環境上做系統整合與測試。

4. 參考文獻

[1] S G. Abraham and S. A. Mahlke, ”Automatic and Efficient Evaluation of Memory Hierarchies for Embedded Systems,” Proc. 32th Annual ACM/IEEE Int’l symposium Microarchitecture, pp. 114-125. 1999.

[2] J. M. Bass, “Proposals Toward an Integrated Design Environment for Complex Embedded Systems,” Proc. Sixth Euromicro Workshop Parallel and Distributed Processing, pp. 273-278, 1998.

[3] D. Beuche et al., ”The PURE Family of Object-Oriented Operating Systems for Deeply Embedded Systems,” Proc. IEEE Object-Oriented Real-time Distributed Computing, pp. 45-53, 1999.

[4] S. H. Bokhari and R. Rehman, “Linux and the Developing World,” IEEE Software, Vol. 16, No. 1, pp. 58-64, Jan.-Feb. 1999.

[5] S. N. Bokhari, “The Linux Operating System,” IEEE Computer, Vol. 28, NO. 8, pp. 74-79, Aug. 1995.

[6] T. Bollinger, “Linux in Practice: an Overview of Applications,” IEEE Software, Vol. 16, No. 1, pp. 72-79, Jan.-Feb.1999.

[7] T. Bollinger and P. H. Beckman, “Linux on the Move,” IEEE Software, Vol. 16, No. 1, pp. 30-35, Jan.-Feb.1999.

[8] I. T. Bowman, R. C. Holt, and N. V. Brewster, “Linux as a Case Study: its Extracted Software Architecture,” Proc. Int’l Conf. Software

Engineering , pp. 555-563, 1999.

[9] CA. G. Dean and J. P. Shen, “Techniques for Software Thread Integration in Real-time Rmbedded Systems”, Proc. IEEE Real-Time Systems Symposium, pp. 322-333, 1998.

[10] Hugo Fierz, “The CIP Method: Component- and Model-based Construction of Embedded Systems,” Proc. 7th ACM SIGSOFT Symposuim on Foundations of Software Engineering, pp. 375-392, 1999.

[11] J. Fleischmann and K. Buchenrieder, “Prototyping Networked Embedded Systems,” IEEE Computer, Vol. 32, No. 2, pp. 116-119, Feb. 1999.

[12] A. M. Fox, J. E. Cooling, and N. S. Colling, “Integrated Design Approach for Real-time Embedded System,” Proc. IEE Software, Vol. 146, No. 2, pp. 75-85, April, 1999.

[13] Robert Geist and James Westall, “Bringing the High End to the Low End: High Performance Device Drivers of the Linux PC,” Proc. 36th Annual Conf. On Southeast Regional Conference, pp. 251-260, 1998.

[14] S. Goel and D. Duchamp, “Linux Device Driver Emulation in Mach,” Proc. Annual USENIX Technical Conference, pp. 65-73, San Diego, California, January 1996.

[15] A. Gokhale and D. C. Schmidt, “Techniques for Optimizing CORBA Middleware for Distributed Embedded Systems,” Proc. IEEE INFOCOM, Vol 2, pp. 513-521, 1999.

[16] D. Grunwald, “Embedded, General-purpose, and High-performance Systems,” ACM Comput. Surv. Vol. 28, No. 4, Dec. 1996.

[17] J. Hallen, A. Hammarqvist, F. Juhlin, and A. Chrigstrom, “Linux at the Workplace,” IEEE Software, Vol. 16, No. 1, pp. 52-57, Jan.-Feb. 1999.

[18] A. Harbert, W. Lively, and S. Sheppard, “A Graphical Specification System for User-Interface Design,” Vol. 74, pp. 12-20. July 1990.

[19] D. Hildebrand, “An Architecture Overview of QNX,” Proc. Usenix Workshop on Micro-Kernels and Other Kernel Architectures, pp. 113-126, 1992.

[20] S. Hustin, M. Potkonjak, Eric Verhulst, and Wayne Wolf, “Real-time Operating Systems for Embedded Computing,” Proc. IEEE/ACM Int’l Conf. on Computer-aided Design, 1998.

[21] D. Jensen, “Adventures in Embedded Development,” IEEE Software, Vol. 116, pp. 116-118, Nov. 1994.

[22] R. Jha et al., “Adaptive Resource Allocation for Embedded Parallel Applications,” Proc. Int’l Conf. High Performance Computing, pp. 425-432, 1996. [23] M. B. Jones, D. Rosu, and Marcel-Catalin Rosu,

“CPU Reservations and Time Constraints: Efficient, Predictable Scheduling of Independent Activities,” Proc. 16th ACM Symposium on

(6)

Operating Systems Principles, Saint-Malo, France, October 1997.

[24] A. Kalavade and P. Moghé, “AsaP--a Framework for Evaluating Run-time Schedulers in Embedded Multimedia End-systems,” Proc. 6th ACM Int’l Conf. Multimedia, pp. 291-296, 1998.

[25] Orran Krieger, “HFS: A Performance-Oriented Flexible File System Based on Building-Block Compositions,” ACM Transactions on Computer Systems, Vol. 15, No. 3, pp. 286-321, August 1997.

[26] G. Lamastra et al., “HARTIK 3.0: a Portable System for Developing Real-time Applications,” Proc. Fourth Int’l Workshop Real-Time Computing Systems and Applications, pp. 43-50, 1997.

[27] David Langan, “EOS: an Object-oriented Operating System for Embedded Real-time Applications,” Proc. ACM Conf. computer science, pp. 60-65, Feb. 1993.

[28] D. Lefkon, B. Payne, “The Practical Engineer. Making Embedded systems Year 2000 Compliant,” IEEE Spectrum, Vol. 356, pp. 74-79, June 1998.

[29] Jason Nieh and Monica S. Lam, “The Design, Implementation and Evaluation of SMART: A Scheduler for Multimedia Applications,” Proc. 16th ACM Symposium on Operating Systems Principles, Saint-Malo, France, October 1997. [30] “Linux Online,” http://www.linux.org/

[31] “Real-Time Linux,”

http://rtlinux.cs.nmt.edu/~rtlinux/homepage_nofra mes.shtml.

[32] “Linux Document Project,”

http://metalab.unc.edu/mdw/index.html

[33] “The ELKS: Embeddable Linux Kernel Subset,” http://www.elks.ecs.soton.ac.uk/

[34] “VIMELinux: Linux for Your Embedded System,” http://www.vmelinux.org/

[35] “Pocket Linux Embedded Box Project,” http://www.cse.unsw.edu.au/~pleb/ “LEM: Linux Embedded,” http://linuxembedded.com/

[36] H. Zeng, X. Fan, C. Ellis, A. Lebeck, and A. Vahdat, “ECOSystem: Managing Energy as a First Class Operating System Resource,” Duke Computer Science technical report CS-2001-01, basis of poster presentation at SOSP 2001.

[37] X. Fan, C. S. Ellis, A. R. Lebeck, “Memory Controller Policies for DRAM Power Management,” in Proceedings of the International Symposium on Low Power Electronics and Design (ISLPED) August, 2001. [38] Alvin R. Lebeck, Xiaobo Fan, Heng Zeng, Carla

S. Ellis, “Power Aware Page Allocation,” in Proceedings of Ninth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS IX), November 2000.

[39] Vahdat, A. R. Lebeck, C. S. Ellis, “Every Joule is Precious: A Case for Revisiting Operating System Design for Energy Efficiency,” in the 9th ACM SIGOPS European Workshop, September 2000. [40] T. Cignetti, K. Komarov, C. S. Ellis, “Energy

Estimation Tools for the Palm,” in ACM MSWiM 2000: Modeling, Analysis and Simulation of Wireless and Mobile Systems, August, 2000. [41] S. Chandra, C. S. Ellis, and A. Vahdat,

“Managing the Storage and Battery Resources in an Image Capture Device (Digital Camera) using Dynamic Transcoding,” in the Third ACM International Workshop on Wireless and Mobile Multimedia (WoWMoM'00), August 11, 2000. [42] Ellis , “The Case for Higher Level Power

Management,” in Proceedings of HotOS, March 1999.

參考文獻

相關文件

6 《中論·觀因緣品》,《佛藏要籍選刊》第 9 冊,上海古籍出版社 1994 年版,第 1

The first row shows the eyespot with white inner ring, black middle ring, and yellow outer ring in Bicyclus anynana.. The second row provides the eyespot with black inner ring

GBytes 1024 MBytes P9-編號 2 資料磁區在 Linux 之作業系統

Robinson Crusoe is an Englishman from the 1) t_______ of York in the seventeenth century, the youngest son of a merchant of German origin. This trip is financially successful,

fostering independent application of reading strategies Strategy 7: Provide opportunities for students to track, reflect on, and share their learning progress (destination). •

- Informants: Principal, Vice-principals, curriculum leaders, English teachers, content subject teachers, students, parents.. - 12 cases could be categorised into 3 types, based

• Examples of items NOT recognised for fee calculation*: staff gathering/ welfare/ meal allowances, expenses related to event celebrations without student participation,

Wang, Solving pseudomonotone variational inequalities and pseudocon- vex optimization problems using the projection neural network, IEEE Transactions on Neural Networks 17