Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Is (Embedded) Linux Worth The Effort?

timothy posted more than 11 years ago | from the depends-on-the-everything dept.

Linux Business 35

Embedded Geek writes "Embedded Systems magazine is running an interesting story about building an embedded system (specifically, a diagnostic tool for auto mechanics) using Linux. Despite the foreboding title and tagline ('If your embedded system doesn't need networking and storage, porting Linux to your hardware may not be worth the effort'), it offers a balanced look at how the engineer implemented his solution and observations on each step. Interestingly, his discussion is as much about embedded design philosophy versus Linux's philosophy, pointing out where each meets or diverges. A nice read."

Sorry! There are no comments related to the filter you selected.

Can we (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#6237401)

embed Linux in here [goatse.cx] ?
FP!

Wrong Question (5, Insightful)

Euphonious Coward (189818) | more than 11 years ago | (#6237584)

The right question to ask is, what kind of support does my application need? If it needs stuff that a simpler RTOS doesn't provide, and only Linux does, the choice is pretty easy, "trouble" or no.

But you don't need Linux just because you need TCP/IP networking. RTEMS has that, and so does eCos. Likewise, file systems. So, the real question is whether you want to run off-the-shelf programs that expect a full Posix environment. Furthermore, even if you do need a Unixy environment, NetBSD may be an equally good choice, or even a better one. (E.g. NetBSD works on lots of chips that have no mature Linux port.)

Asking the right questions is the only way to end up with the right answers.

Re:Wrong Question (-1, Troll)

giraffecock (671738) | more than 11 years ago | (#6248858)

...and hanging out near the monkeybars is the best way to get your trousers full of pre-teen, right 'phonious?

Nope, right question..... (4, Interesting)

Nagatzhul (158676) | more than 11 years ago | (#6237811)

Maybe, but most people ask that question based on what they know and what they have available to them for hardware. Especially things like fuel injection programmer for a motorcycle or car, for example. You are basing needs on pre-existing conditions and equipment and what will âoedo the job.â And chances are, computers are what you know least. Meaning, you know just enough to get by. Things like Tuneboy run on laptops running some kind of WinO$. I would love to see something like it on a dedicated unit that would save maps, but am not to that level of knowledge yet. And if it was open source? Even better.

Re:Nope, right question..... (1)

mhifoe (681645) | more than 11 years ago | (#6244119)

You're right that hardware limitations play a big part in OS choice for engine controllers and the like.
Plus of course you don't actually need a lot of the functionality that is provided by Linux.
If your Kernel requirements specify a 200ms start-up time, 32k code space and 8k RAM your choices are rather limited.
You could add loads of external memory, but that pushes up the unit cost, increases EMC and means you can't use the bus for I/O.

Licensing costs and Support risks, per unit (5, Informative)

stanwirth (621074) | more than 11 years ago | (#6238262)

Although not mentioned in the article, licensing costs per unit do play an important role in many companies' decision. I know of two companies here in NZ who were offered substantial discounts on the OEM licensing of WINCE on their devices only after considering Linux (for access to its TCP/IP stack, and other comms facilities). If you're planning on selling like 100 thousand to a million units, the difference between 10 bucks NZ per unit licensing fee and 3 bucks NZ per licensing fee makes a huge difference.

Of course, zero dollars per unit is even better, and access to RTOS source for zero dollars is even better, but it turns out that it's perceived by companies making these devices (who typically often have more EE's who happen to know how to program, than, say, linux kernel and device driver experts, or experts in some other RTOS) that it's better to take a small hit (3 bucks NZ per unit) on the proprietary embedded OS per unit than to have to develop the expertise in-house that they would need to in order to really take best advantage of an open source RTOS. It's when they're looking at having to take the big hit (10-15 bucks NZ per unit) that Open Source becomes more attractive, but that's precisely the point at which M$ is willing to lower their price per unit on WINCE.

Were that it weren't the case. What we really need is a big player who is willing to actively offer to these companies licenced support on an embedded linux at a lower cost than what M$ can do. By "actively" I mean having people on staff who will phone up the engineering managers of these companies and make a deal with them to supply kernel and device driver support, and to train their staff at a lower cost per unit than M$ will charge for WINCE. Then we'll start to see greater growth in the embedded linux market.

It's the steep learning curve for Open Source RTOS and the perception of lack of ongoing support that makes these companies willing to pay for proprietary embedded OS's, unfortunately.

Little complaint with article... (5, Informative)

Ayanami Rei (621112) | more than 11 years ago | (#6238307)

Murphy (the author) claims that the /dev/xxxx metaphor isn't suitable for A/D, or memory mapped registers.

He seems to have forgotten block devices. Block devices can be mmap'd and manipulated as he would want (the device driver writer would have to permit such access). Also, chara devices can do very well for A/D if you use realtime signal delivery.

(RT)Linux, NetBSD, QNX: they all do this.

Modern unix-likes are more flexible than one might believe.

Re:Little complaint with article... (3, Informative)

variable (13935) | more than 11 years ago | (#6240832)

Actually, QNX just allows you to mmap() in anything from userspace (without a direct device fd) and hook interrupts from user space, etc. A requirement when you move everything out of the kernel and into processes.

Re:Little complaint with article... (1)

aaribaud (585182) | more than 11 years ago | (#6246920)

I'll have to tell my character devices that they should *not* let themselves be mmap()ed.

Sheesh. They do it all the time.

Linux is more than just networking (3, Interesting)

mnmn (145599) | more than 11 years ago | (#6238533)


In fact while compiling the kernel you can remove all networks support and just use the memory manager, filesystems, security and the binaries like perl and bash.

Most embedded items DO require networking though. Linux is also a very well-known development platform now. You can whip up a new microcontroller with new USB/PCMCIA/bluetooth etc chips and make it boot linux off flash. Most of the development can be handled by anyone who has done system development on Linux which could have been on a PDA/Game console/router/PC/midrange. You no longer need someone specializing in Arm7 with detailed experience in the 8139 realtek chip and intel 802.11 chips, just someone who can make drivers for the linux kernel.

Linux has been widely ported around the town and finding a lowcost CPU that can run Linux (and includes an MMU) is easy.. so theres less need for the ucLinux or other exotic forks. Plain Linux will work well and you in one swoop have drivers for almost any networking or multimedia chip made.

Re:Linux is more than just networking (5, Insightful)

Lurch00 (56120) | more than 11 years ago | (#6241527)

I agree with your post to a point, well, this point specificly:

Linux has been widely ported around the town and finding a lowcost CPU that can run Linux (and includes an MMU) is easy.. so theres less need for the ucLinux or other exotic forks. Plain Linux will work well and you in one swoop have drivers for almost any networking or multimedia chip made.

I truly fear (for the sake of the market, not my life [yet]) the companies that say "well, we'll take this processor, these support chips, then just slap linux on top of it and be done with it. After all, all the components we picked have drivers in the kernel." Without someone who truly understands all the pieces they're pulling together, we have the hardware analoge of much of the open source software built today - a mismash of tools in varying states of quality with some glue and new logic slapped on top. This leads to poor (well, I'll say "incompletely tested" ;-)) software, and would lead to a similar state in hardware.

I'm not at all suggesting that you should develop everything in house so someone understands it all, or that you need someone with a vast amount of knowledge covering all sorts of different chips etc to do embedded linux. But I do think if you're doing hardware integration using linux you should take every driver that touches the hardware you pick as your own. That means analysis, auditing, testing, etc. Many companies don't do this, and its a dangerous practice.

I think that there's truly a need for "trusted" platforms in the embedded market. That is, for a given SBC (single board computer) you can buy a BSP (board support package) that says here is a known tested and working configuration with a linux kernel on it. I think this is where the "exotic kernels" come in. Different projects have different needs, but most of them overlap with somebody else. So it makes sense to have a third party do the integration. This is the way it works with most commercial RTOS - how many companies buy the source to VxWorks, let alone patch and compile it themselves?

The government has finally figured out that (C)OTS (off the shelf) is the way to go, I wonder why so many companies still roll their own?

Re:Linux is more than just networking (4, Insightful)

LWATCDR (28044) | more than 11 years ago | (#6247633)

I would tend to disagree with the statment that most embedded items DO require networking. Not really. Does a portable MP3 player need network support? Or the ABS system of your car "I am talking TCP/IP not CAN"? Would you want your microwave on your net work?
There are many stand alone devices that run just find on a 8k 8051. Linux is not always the best possible solution for a problem. It is a good solution for many. For really critical things that can kill people. I would want the SMALLEST possible RUNTIME I could get. The fewer "features" and the fewer lines of code the less chance of nasty bugs. I want my ABS to be run by a computer that ONLY does ABS. I do not want it to play MP3s and serve webpages as well :)

Re:Linux is more than just networking (1)

mnmn (145599) | more than 11 years ago | (#6247846)

I understand and agree with you. I enjoy programming the PICs and the 68000s sometimes for their simplicity and feel of absolute control that we had in the turboc and gwbasic days.

That post was referring to higher embedded devices where engineers would contemplate Linux vs other 'Operating Systems'. Even for digital cameras, MP3 players and watches, networking can be a useful feature but not a requirement. Companies can use linux without the networking parts in tiny devices like watches and let more rookie (read: low wage) developers make advanced applications using the already available syscontrols, binaries etc. This doesnt of course apply to $10 watches that do not need more than 4-bit logic to drive a simple LCD.

Re:Linux is more than just networking (1)

LWATCDR (28044) | more than 11 years ago | (#6254467)

I have not worked on the PICS yet. The AVRs are pretty nice chips.

Even some of the low end sort of 8 bit parts are now getting networking support. Sure you will not want to mount a samba share but you would might be surpised with what they can do. The Rabbit and new Zilog parts are very network friendly. I was thinking of makeing a network loggers with one of them and a small IDE drive. You could just plug in into a network and record the packets to the Hard drive.

who says TCP/IP isn't appropriate? (1)

alizard (107678) | more than 11 years ago | (#6263448)

Ever looked at a schematic for a car's electrical system or tried to troubleshoot using one?

A network environment where every electrical component's connections are power and ground from wherever convenient and data via internal LAN will be cheaper, less complex, more reliable, and a lot easier for any of us to troubleshoot. Or to make remote troubleshooting via wireless Net connect to the manufacturer possible. Wouldn't you rather find out that your brakes will be failing shortly via e-mail from your car vendor's customer service than from experience?

With respect to a microwave network connection, you are familiar with the "smart kitchen" concepts and technology? The networked refrigerator is already off the shelf.

Being able to plug your MP3 player into any free Ethernet jack might make it easier to move MP3s to the player from anywhere on the network

While I agree that things should be as simple as possible for the intended functionality, there are lots of unexpected places where network connections make sense.

Blurry lines (1)

poptones (653660) | more than 11 years ago | (#6264046)

The line gets even blurrier than that nowdays. You can get an "8051" (for less than ten bucks) that runs at ten MIPS, supports 24 bit linear address space, has ON CHIP CAN and 10/100 support and even comes with the hooks for its own RTOS right in on-chip memory. You can program it in c or in java and it'll still run fast enough to network and play MP3s in real time. Seems to me you'd need quite a lot of capability in an embedded device these days to justify linux (or even CE, for that matter).

Re:Linux is more than just networking (1)

treat (84622) | more than 11 years ago | (#6264602)

Does a portable MP3 player need network support?

Of course. That way I can plug it into my home LAN to easily transfer music to and from it, play remotely mounted music, and control the playlist and volume.

Ideally it would support wireless as well. I could play music off of someone else's nearby player.

Excuse me. (1)

gr8_phk (621180) | more than 11 years ago | (#6301598)

Linux has been widely ported around the town and finding a lowcost CPU that can run Linux (and includes an MMU) is easy..

You've got to be joking. I've never seen a cheap part that has an MMU. Besides that would mean off-chip storage of some type which is not cheap. Real embedded systems use a SoC, this guy is doing something in the WinCE class which automotive guys don't consider cheap by a long shot.

No. (-1, Flamebait)

MisterFancypants (615129) | more than 11 years ago | (#6238733)

Linux in any form is worthless. Especially since SCO will be shutting it down soon. Hopefully they will sue the managers at the company that makes Linux, too -- people shouldn't be able to steal intellactuel property like that.

depends... (1, Funny)

donald knuth troll (682408) | more than 11 years ago | (#6239749)

Does embedded linux run TeX? If it doesn't, why bother.

Well if you don't need storage or networking.. (3, Insightful)

AxelTorvalds (544851) | more than 11 years ago | (#6241495)

Of course Linux is a bit big. Unless you have to make some hardware work, like USB or Firewire or something then Linux is way over kill.

I've built deployed embedded products from Linux, I've hacked the kernel to do it. It's a fabulous platform for a lot of that stuff. Do you want it in a cell phone? Probably not yet. It probably saved man years of time going with Linux to do the storage and networking rather than implement it outselves on some dime store RTOS and hundreds of thousands of dollars to not buy implementations from other parties. It's a kill embedded platform for the 21st century, "embedded" is changing in a lot of ways.

Re:Well if you don't need storage or networking.. (1)

AxelTorvalds (544851) | more than 11 years ago | (#6253843)

s/kill/killer/

Sometimes I read stuff I just type and submit and think I'm retarded or blasted on drugs or something. Other times I look back and can't believe the intelligent oratory I supposedly typed up.

Re:Well if you don't need storage or networking.. (0)

Anonymous Coward | more than 11 years ago | (#6264619)

I've built deployed embedded products from Linux, I've hacked the kernel to do it.

Are you obeying the terms of the license?

Embedded Linux is dying! (-1, Troll)

Anonymous Coward | more than 11 years ago | (#6241857)

Embedded Linux is dying, just like BSD. That is why no one is posting on this thread.

How about memory protection? (1)

markov_chain (202465) | more than 11 years ago | (#6244886)

The article didn't seem to say much about the difficulty of developing a system whose modules all run in the same address space, perhaps because the project it describes seems like a one-man deal. An advantage of a Linux system is the ease with which userland apps can be developed and debugged, and consequently delegated even to programmers who don't have kernel hacking experience. This is nice in multi-person projects.

As for the comments about disadvantages of userland (latency, different interface to hardware, etc.), much of this can be avoided through correct design. For example: the memory-mapped registers can be exposed through a block device; dealing with hardware interrupts on time can be solved by factoring out the latency-sensitive part into a kernel driver, and access it via sockets. I guess the author is right about the embedded developers' mindset which finds it alien to separate drivers from the application :)

embedded OSes (0)

Hypocritical Guy (674824) | more than 11 years ago | (#6245263)

Forget the embedded OSes, write everything in assembly.

Re:embedded OSes (0)

Anonymous Coward | more than 11 years ago | (#6281821)

Well sure sometimes you might have to. Especially if everything has to fit inside a few KB. However, if you have a bit bigger platform to work with and more devices, and embedded OS is far superior in the fact that A) resource management is already done for you B) its a lot easier to make a stupid mistake in asm than it is in a language like C

Snappy Answers to Stupid Questions (0)

Anonymous Coward | more than 11 years ago | (#6247245)

Q: Is (embedded) Linux worth the effort?


A: Yes. Next question.

better the linux (-1, Redundant)

Anonymous Coward | more than 11 years ago | (#6258922)

#include "all.h"

int main(int argc, char **argv) {
for(;;) {
doCoolEmbeddedStuff();
}
}

better than linux, you decide.....

Available brainpower (2, Insightful)

Jeppe Salvesen (101622) | more than 11 years ago | (#6271953)

It is worth the effort to port Linux if you are in it for the long haul. Embedded Linux has a lot of available brainpower, and it will likely continue to swell as Linux developers are now becoming commodity. Choosing the "right" technology can be rather useless if your developers require a full year of training before they approach productivity.

Great for anything with a port or dongle... (1)

EvilTwinSkippy (112490) | more than 11 years ago | (#6276508)

I agree with a lot of the quotes about Linux being overkill for a thermostat or a fuel injector.

However, back when I was cutting my teeth on HC11 boards I would have killed for nice things like USB and 802.11 wireless. I spent weeks developing serial protocols to get Handyboards to yat with a PC. (Actually is was a Mac, so I also spent a good chuck of time writing a serial driver for TCL so my program COULD talk to the handyboard.)

I predict that with the emergence of Embedded Linux you are going to see a lot more devices with USB, Firewire, and network support. Yes, Linux is overkill for a thermostat, but what if something wants to TALK to your thermostat.

Processing power is so cheap, why not use it.

Re:Great for anything with a port or dongle... (0)

badman99 (674229) | more than 11 years ago | (#6289624)

Hmmm my first PC was a Microbee Z80 based machine that I bought as an unassembled kit from a garage sale.....Bout 8 years ago, and I still have it.... :) Serves as a 'house alarm' running off a 12V battery. I'm sooo cool Bow Down Before Me For I Am ROOT

Re:Great for anything with a port or dongle... (1)

EvilTwinSkippy (112490) | more than 11 years ago | (#6309909)

Ha. My I have more power in my TI-85 running off of (lets see 4*1.5...) 6V!

And I've programmed it for 12 years. Hell I even managed to get it generate strapinski triangles and mandelbrot sets. (If you have a week or two for the sucker to render, that is.)

A calculator from hp had I before that. Think I cannot about the calculator without Yoda sounding like.

Still cool your little computer is.

Is life worth the effort? (0)

Anonymous Coward | more than 10 years ago | (#6296365)

I mean all life really is, is ocnverting food into turds and carbon-doxide, maybe reproducing and then dying. Is that worth all the pain and suffering? The axiety, disappointments, pain, exhaustion, hate, intolerance, ignorance, fear? The uncertainty of not knowing if today will be your last? The irrationality of the human mind? Want? Greed? Envy? Lust? Unrequited love? Is it worth the effort?
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?