上周,Green Hills Software(GHS)就嵌入式Linux撰寫了一則措辭嚴厲的觀點,下面就是它的開場白:“Embedded Linux是迄今為止夸大其詞的嵌入式操作系統(tǒng)。它吹噓為廉價、高質量、高生產(chǎn)率、可靠、應用范圍廣以及得到很好的支持,可是,恰好相反...”
Green Hills接著恭賀Linux供應商承認這種操作系統(tǒng)是“一片混沌”(要謝謝風河!)且是“無底洞!”(也感謝你,MontaVista!)然而,贊揚是短暫的,據(jù)GHS透露,這種憤世嫉俗的工作方式會讓你驚恐,以至于無法利用Linux自己編寫操作系統(tǒng),而終變?yōu)轱L河或MontaVista的客戶。
那是有些強硬的談論,但是,GHS并不是中立的觀察家。這家公司銷售自己的操作系統(tǒng),因此,它堅持由宣講對Linux的恐懼、不確定性以及疑慮而獲益。的確,我所交談過的每一家供應商均在Linux上采取顯然有利于自己的立場。下面是我聽到的若干例子:
Wind River, MontaVista:免費的Linux是一場災難。然而,我們才提供“真正”的Linux,否則的話,你將在鍵盤面前不知所措!
QNX: Linux是一場災難。然而,我們的類似Linux的RTOS確實偉大的!
Microsoft: 暈!你為什么會看上Linux?如果采用WinCE,生活會更輕松!
Mentor Graphics: Linux?WinCE?你簡直在開玩笑!你可以從像Nucleus那樣輕量的RTOS中獲得你想要的一切。
有一件事情是肯定的:沒有人說Linux存在真正的缺點。然而,哪一家供應商說的是真相呢?或者說,他們希望促銷才撒謊的嗎?
實際上,每一個觀點均包含合理的成分。每一個項目均具有的要求,因此,不同的項目會尋求不同的操作系統(tǒng)。下面我(無黨派人士)列出了當評價嵌入式Linux時你應該提出的問題:
你需要全功能的操作系統(tǒng)嗎?嵌入式Linux很大,通常代碼長度超過2MB。當然,你可以通過裁減像網(wǎng)絡堆棧以及文件系統(tǒng)這樣的功能而壓縮操作系統(tǒng),但是,這些功能正是你要采用Linux的主要原因。如果你不需要這些功能,你采用精干的RTOS。
你能夠獲得針對特定應用功能的操作系統(tǒng)嗎?WinCE就提供無數(shù)的版本,包括專門為汽車應用而設計的版本。(QNX也一樣)。Nucleus提供針對便攜式媒體播放機的公用的特殊功能。不一而足。
許可的模式是什么?Linux General Public License(Linux通用公共許可)存在其缺陷。如果你想修改內(nèi)核要怎么做?然而,不要指望把你亂砍之后的內(nèi)核與其它人分享?如果未經(jīng)授權的代碼溜進內(nèi)核之中會怎樣?所有者是否應該決定控訴?對于生命期長的產(chǎn)品,如汽車和網(wǎng)絡基礎設施來說,像這些問題就是主要的問題。我們當中其他人常常忽視法律問題并且在下一個產(chǎn)品版本中簡單地升級內(nèi)核。Linux會做出響應并足夠可靠嗎?我了解你在想什么:嵌入式Linux是專門為解決這些問題而設計的嗎?是的,但是,嵌入式Linux無法匹配像INTEGRITY這樣的操作系統(tǒng)。
你愿意現(xiàn)在付費或是以后付費?自己編寫Linux操作系統(tǒng)是免版稅的,但是,你必須做出重大的工程投資以及構建它并讓它跑起來。相比之下,商用的Linux軟件包(或競爭操作系統(tǒng))能夠讓你以小的前期投資成本進入市場。
你要付運多少產(chǎn)品?如果你的批量小,讓你的操作系統(tǒng)團隊急急忙忙自己開發(fā)操作系統(tǒng)的做法就沒有意義。
你的上市時間如何?如果你趕著上市,那么,自己編寫操作系統(tǒng)的方法也沒有什么意義。
對你的特殊的處理器、電路板或參考設計提供技術支持嗎?提供技術支持的操作系統(tǒng)將給予你的NRE以及短的上市時間。
你需要對接你的現(xiàn)有代碼嗎?大多數(shù)項目均是在現(xiàn)有的代碼上構建的。如果在對接代碼上浪費太長時間,你就會喪失轉換操作系統(tǒng)所獲得的好處。(你實際上可以跳過這個問題,但是,會增加系統(tǒng)的另一層復雜性。)
你的工具鏈支持操作系統(tǒng)嗎?如果不是,你就要轉換。這就增加了學習曲線并讓設計團隊不穩(wěn)定。如果你愿意轉換工具鏈,要尋找如MIPS的Linux熱點分析儀這樣的具有操作系統(tǒng)的功能。不論你對嵌入式Linux做出什么決定,但是,公司的MUTLI IDE自從2001年起就支持嵌入式Linux。要自問:如果GHS真的認為嵌入式Linux是一場災難,為什么這家公司為它提供支持呢?
查看英文原文:
Commentary: What's the deal with embedded Linux?
Last week Green Hills Software wrote a scathing opinion piece on embedded Linux. Here's the opening:
"Embedded Linux is the most hyped embedded operating system ever. It is promoted as inexpensive, high quality, high productivity, reliable, widely available, and well supported. It is none of these things..."
Ouch! Green Hills goes on to congratulate Linux vendors for admitting that the OS is "CHAOS" (thanks, Wind River!) and "a money pit" (you too, MontaVista!). But the praise is short-lived: According to GHS, this is a cynical ploy to scare you away from do-it-yourself Linux and turn you into a Wind River or MontaVista licensee.
That's some tough talk, but Green Hills Software is hardly a neutral observer. The company sells its own operating systems, so it stands to benefit by sowing fear, uncertainty and doubt (FUD) about Linux. Indeed, every vendor I have spoken to has taken a distinctly self-interested position on Linux. Here's a sampling of the claims I've heard:
MIPS: Do-it-yourself Linux works great! Just go to LinuxMIPS and download! Our Linux support makes us a winner!
Wind River, MontaVista: Free Linux is a disaster. Buy "real" Linux from us or you will end up crying over your keyboard!
QNX: Linux is a disaster. But our Linux-like RTOS is great!
Microsoft: Geez, why are you even looking at Linux? Life is much easier with WinCE.
Mentor Graphics: Linux? WinCE? You have to be kidding. You can get everything you want from a light-weight RTOS like Nucleus.
One thing is for sure: There is no shortage of opinions on Linux. But which vendor is telling the truth? Or are they are lying in hopes of building sales?
The reality is that each viewpoint contains elements of truth. Every project has unique requirements, so different projects call for different operating systems. Here is my (non-partisan) list of questions you should ask yourself when evaluating embedded Linux:
Do you need a full-featured OS? Embedded Linux is big; typical builds exceed 2 MB. Sure, you can shrink the OS by stripping out things like networking stacks and file systems, but these features are the main reason to use Linux. If you don't need these features, you are better off with a lightweight RTOS.
Can you get an OS with application-specific features? WinCE comes in numerous flavors, including versions designed specifically for automotive applications. (The same is true of QNX.) Nucleus has. community special features for portable media players. And so on.
What is the licensing model? The Linux General Public License has its drawbacks. What if you want to modify the kernel, but don't want share your hacks with the rest of the world? What if unauthorized code sneaks into the kernel, and the owner decides to sue? Questions like these are mainly issues for products with long life spans, like cars and network infrastructure. The rest of us can often ignore the legal issues and simply update the kernel in the next product rev.
Is Linux responsive and reliable enough? I know what you're thinking: Isn't embedded Linux specifically designed to address these points? Yes, but embedded Linux can't match OSs like INTEGRITY.
Do you want to pay now or later? Do-it-yourself Linux is royalty-free, but you have to make a major engineering investment to get it up and running. In contrast, a commercial Linux package (or a competing OS) can get you to market with minimal up-front cost.
How many units will you ship? If your volumes are low, it doesn't make sense to have your own OS team-so skip the do-it-yourself approach.
What is your time to market? The do-it-yourself approach doesn't make sense if you're in a hurry.
Is there support for your specific processor, board, or reference design? The OS with the best support will give you the lowest NRE and shortest time to market.
Will you have to port your existing code? Most projects are built on existing code. Waste too much time porting the code, and you lose the benefits of switching OSs. (You can sidestep this issue with virtualization, but that adds another layer of complexity to the system.)
Does your tool chain support the OS? If not, you will have to switch. This adds to the learning curve and makes the design team cranky. If you are willing to switch tool chains, look for OS-aware features like MIPS' Linux hot-spot analyzer.
Whatever you decide about embedded Linux, it's a good idea to take vendor claims with a grain of salt. For example, Green Hills talks tough about Linux, but the company's MUTLI IDE has supported embedded Linux since 2001. Ask yourself: if GHS really thinks embedded Linux is a disaster, why does the company support it?