Forgot your password?
typodupeerror
Programming IT Technology

Linux Kernel 2.4 Or 2.6 In Embedded System? 178

Posted by kdawson
from the comfort-on-the-trailing-edge dept.
snikulin writes "My 6-year-old embedded software happily runs on kernel v2.4 on an XScale CPU. The software gets a bunch (tens of megabytes) of data from an FPGA over a PCI-X bus and pushes it out over GigE to data-processing equipment. The tool chain is based on the somewhat outdated gcc v2.95. Now, for certain technical reasons we want to jump from the ARM-based custom board to an Atom-based COM Express module. This implies that I'll need to re-create a Linux RAM disk from scratch along with the tool chain. The functionality of the software will be essentially the same. My question: is it worth it to jump to kernel 2.6, or better to stick with the old and proven 2.4? What will I gain and what will I lose if I stay at 2.4 (besides the modern gcc compiler and the other related dev tools)?"
This discussion has been archived. No new comments can be posted.

Linux Kernel 2.4 Or 2.6 In Embedded System?

Comments Filter:
  • by dotancohen (1015143) on Sunday January 04, 2009 @09:16AM (#26319497) Homepage

    ...then go with the newer kernel. 2.6 has _lots_ of improvements above 2.4. The security aspects may be of less interest in your application, but the performance probably won't be. I've always believed that it is better to regret having done something than to regret having not done it.

  • Move on (Score:5, Insightful)

    by markus_baertschi (259069) <markus AT markus DOT org> on Sunday January 04, 2009 @09:19AM (#26319505)

    I'd move on. Not for any particular feature, but to stay closer to the mainstream for the next years. The 2.4 kernel, not for any technical reason, becomes increasingly exotic as people move on to 2.6.

    You'll have to maintain your existing 2.4 skills for another decade when all others have moved.

    Markus

  • by Ruie (30480) on Sunday January 04, 2009 @09:19AM (#26319507) Homepage

    My question: is it worth it to jump to kernel 2.6, or better to stick with the old and proven 2.4?

    Old and proven on a different hardware. Chances are your new hardware will have some issues (if only caused by you misunderstanding something) and then it would help to have the latest kernel that more people are using.

    Also, Atom is a newer processor, perhaps with PCI Express in the chipset - does 2.4 support that ?

  • by ta bu shi da yu (687699) on Sunday January 04, 2009 @09:21AM (#26319517) Homepage

    I always hate it when people talk about improved performance in general. I'm curious about what specific features of the 2.6 kernel you feel he would benefit from?

  • iptables and more? (Score:4, Insightful)

    by pipatron (966506) <pipatron@gmail.com> on Sunday January 04, 2009 @09:24AM (#26319543) Homepage

    Well, I don't have that much experience with 2.4, and how much is 'backported' from 2.6, but IIRC you can use better IP filtering tools in 2.6. And are all drivers for various hardware written to work with 2.4 as well?

    It doesn't sound like you use linux hardly for anything else than for using the drivers for the NIC, so if your system works now, then there's probably no explicit reason to change. What I would worry about though, are your future needs. Even if you don't need to upgrade now, it might just be the perfect time to do it.

  • by Anonymous Coward on Sunday January 04, 2009 @09:49AM (#26319633)

    Since first 2.6 release, most of the developer force is gone from 2.4. Although officially they "support" 2.4, expect the support to be practically nonexistent when you bump into problems. No one should have even considered using 2.4 for the last couple years now. It is simply too risky.

  • Re:Why Linux? (Score:3, Insightful)

    by Anonymous Coward on Sunday January 04, 2009 @09:56AM (#26319661)

    Or just simply NetBSD, as it's cross-compilation toolchain will save you tons of headaches when you will have to compile and test your new ramdisk.

    IMHO, build.sh is just the way to go.

  • Re:Move on (Score:5, Insightful)

    by morgan_greywolf (835522) on Sunday January 04, 2009 @10:01AM (#26319687) Homepage Journal

    OTOH, the code is 6 years old, and from what I gather reading the post, it's stable and mature. OTOH, my guess is that if the article poster has written his code in a fairly portable way, it will compile without too much modification on GCC 3.x or 4.x and will run under the newer versions on glibc on a 2.6 kernel.

    On the gripping hand, keep in mind that for embedded applications that memory is usually at a premium and the memory footprint of 2.4 is significantly smaller than the 2.6 kernel. Keep in mind that lots of embedded applications are still using a 2.4 kernel and some embedded applications even continue to use MS-DOS or FreeDOS.

    I guess if I were making this decision, I'd try to compile and run my code on newer Linux distro in a sandbox to see how much work it would take to make it compile and run in the new environment. Then I'd see how much bigger a custom-built 2.6 kernel is than the existing 2.4 kernel, optimizing the kernel configuration for size and memory consumption, of course.

    That work should take no longer than a couple of days.

    If it doesn't work out, you can go back to your existing 2.4 configuration. *shrug*

    What do you have to lose?

  • by SamuelRobinson (323138) on Sunday January 04, 2009 @10:04AM (#26319703) Homepage

    There are some pretty compelling reasons to migrate, but looking at your specific application most of my favorite reasons don't apply. Since you're going to be changing your toolchain somewhat, the 2.6 migration isn't going to be that much more invasive. My reasons for wanting to change have mainly to do with filesystem improvements and USB improvements, which don't seem to have much traction for you. I'm assuming that you did your own hardware drivers for the PCI express data collection, so that shouldn't be a particularly big deal, except for having to redo for new hardware, which you have to do anyway.

    So, like I said, I'd migrate but if you need to continue work with the old device for some reason I could see an argument for a continued freeze. The biggest downside to this is the larger jump you end up doing in another few years when you need to migrate for real functional reasons to some later kernel. It's always seemed easiest to me to embrace the opportunity to migrate if it makes reasonable sense.

  • by Enleth (947766) <enleth@enleth.com> on Sunday January 04, 2009 @10:29AM (#26319827) Homepage

    Much better power management, in many different aspects, which can be important if this particular embedded platform is meant to be battery-powered or used in an unfriendly thermal environment (yes, power efficiency is also a kind of performance metric, just per watt of consumed and emitted power, not per unit of time).

    There's more power management support in the drivers, lots of ACPI fixes and improvements, and, most importantly for a platform like Atom (or any x86-based platform in general, when heat and power are a problem), the tickless idle mode, which enables very real and measurable power saving and reduction of generated heat by letting the processor actually do nothing (technically, drop to C3 and further power states) when, well, doing nothing, instead of processing useless interrupts and idling at the normal working power level.

  • Re:Why Linux? (Score:5, Insightful)

    by DrDitto (962751) on Sunday January 04, 2009 @10:31AM (#26319845)
    2.6 is a lot better from a feature-standpoint, but is much heavier and isn't really suited to embedded systems anymore.

    Lets see-- Android runs Linux 2.6.25. My Linksys NSLU2 is currently running OpenWRT with a Linux 2.6.26 kernel. Both are embedded devices with far less processing capability than an Atom-based device.
  • glibc and embedded (Score:1, Insightful)

    by Anonymous Coward on Sunday January 04, 2009 @11:18AM (#26320085)

    I have done a few embedded systems using the Linux and uClinux Kernel. A couple of things to note:

    Embedded tends to avoid glibc in favor of uClibc (www.uclibc.org). It is not full featured but it is a lot smaller.

    When selecting a version of GCC and kernel, look at who has already has a running system for your board. You probably don't want to go through the effort to get gcc-4.2.x cross compiling and building your system if somebody already has 4.1.x doing the job.

    I would take a look at buildroot [uclibc.org]http://buildroot.uclibc.org/ [uclibc.org] and see what options they have out of the box. As an engineer it is easy to want to pick the newest, most feature full version, least bugs version available and call it the "best". Remember though that one of the features is the cost and time to get it running. Your boss will not be impressed if you spend two weeks getting the newest kernel running on the board because it has fixes to sub-systems you don't use; when you could have used older kernel and had it running in an hour.

    Also, keep in mind with this board, Ram and Flash cost money. If you are building a large number, the smaller kernel and flash disk are better from the cost/unit. If you are building a small number, the cost to cut you image down in size probably is not worth it.

  • Re:Why Linux? (Score:1, Insightful)

    by Nutria (679911) on Sunday January 04, 2009 @11:19AM (#26320091)

    All of these work on FreeBSD 6 or 7

    v6.0 was released 5 YEARS after Linux 2.4.1 was released, so OF COURSE it has more features. Linux 2.6.1 is contemporaneous with FBSD v5.2.

  • Re:Why Linux? (Score:5, Insightful)

    by molarmass192 (608071) on Sunday January 04, 2009 @11:50AM (#26320281) Homepage Journal
    I was thinking the same thing. Yes, 2.6 has a bigger codebase, but if you compile only the modules you need, instead of everything plus the kitchen sink, it's really no bigger in binary form (maybe +5%). In return, I find it to be noticeably more responsive given the same hardware.
  • Re:testing? (Score:5, Insightful)

    by joaommp (685612) on Sunday January 04, 2009 @11:52AM (#26320289) Homepage Journal

    actually, why was this modded flamebait? despite the fact that it doesn't give a direct answer to the question (99.9% of posts don't even give any answer, direct or indirect to the questions), the post actually makes sense and is relevant. With a test plan there is the possibility to find incompatibilities that don't pop out at first sight and that may force the guy to stick to the older kernel and, thus, voiding the 'is it worth it'-question with an 'is it possible'-question.

  • by nchip (28683) on Sunday January 04, 2009 @11:56AM (#26320319) Homepage

    or better to stick with the old and proven 2.4?

    Linux 2.4 might be "proven" on your old Xscale system, but I doubt anyone else has even _tried_ to use Linux 2.4 on something as new as Atom. Linux 2.4 will also lack support for any of the peripherals of your Atom com module.

  • Re:testing? (Score:5, Insightful)

    by DuckDodgers (541817) <keeper_of_the_wolf AT yahoo DOT com> on Sunday January 04, 2009 @01:52PM (#26321223)
    Your solution requires the post submitter to do all of the work to create his solution for both kernels, and then compare them.

    If someone asked whether to build a reasonably complex website in Python or PHP would you recommend that they build both and then performance test them? That's a lot of extra work.

    In both the original post submitter's case and the hypothetical one I suggested, it would be much easier to gather as much information you reasonably can about both solutions and then make an educated guess as to the best option. I'm not sure Slashdot is the best place for his information gathering, but I understand what he is doing.
  • by NekoXP (67564) on Sunday January 04, 2009 @01:57PM (#26321251) Homepage

    Linux kernel preemption is about as far from real-time as you can get. It's not even in the same ballpark.

    RTAI extensions do it right; it's real, real-time, although still not basically only in the parking lot outside the same ballpark. Which is as close as you need to be to HEAR the game anyway.

    I don't think the guy is particularly looking for real-time support here. Pulling data over PCI-X then pushing it over a Gigabit LAN doesn't seem like it needs more than driver support. The Atom will no doubt be faster at it than his previous hardware. I'd say move to 2.6 just so you can run 2.6 and enjoy further development by someone other than yourself. Some parts of 2.6 got relatively less efficient over time (I can't say I particularly see any benefits in real-world use from the "completely fair" schedulers, for example) but in the whole driver support and general stability should be fine.

    I'd stick with a kernel a few revisions back though. Don't jump in to 2.6.28. Try 2.6.25 or 2.6.26.

  • by MShook (526815) on Sunday January 04, 2009 @02:14PM (#26321375)
    Straight from the 2.4 maintainer: can't be better than that!
  • Re:testing? (Score:2, Insightful)

    by Anonymous Coward on Sunday January 04, 2009 @04:11PM (#26322231)

    His solution does not require the post submitter to do any work other than to draw up a test plan.

    Even before doing any coding at all, the test plan itself may reveal whether it's worth it / possible to migrate to 2.6.

  • Re:Why Linux? (Score:2, Insightful)

    by davester666 (731373) on Sunday January 04, 2009 @08:05PM (#26324275) Journal

    I would say this more relevant to desktops and servers, rather than embedded systems (of course, it also depends on the embedded system). Embedded systems typically perform a much more limited range of operations than when used as a desktop or server.

    Again, it depends on the specifics of the hardware and the application running on top of the kernel to decide which kernel is more appropriate to use.

"The only way for a reporter to look at a politician is down." -- H.L. Mencken

Working...