Is (Embedded) Linux Worth The Effort?
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."
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.
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.
"All I want is a warm bed and a kind word and unlimited power." - Ashleigh Brilliant
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.
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.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
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.
"Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
Does embedded linux run TeX? If it doesn't, why bother.
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.
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
Tsunami -- You can't bring a good wave down!
Forget the embedded OSes, write everything in assembly.
If you liked licking my balls, add me to your foes list!
A: Yes. Next question.
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.
Tech Public Policy stuff
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).
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.
Stop the brainwash
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.
"Learning is not compulsory... neither is survival."
--Dr.W.Edwards Deming
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?
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.