Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Linux Gains Native RTOS Emulation Layer

Posted by ScuttleMonkey on Sat Mar 22, 2008 06:32 AM
from the still-waiting-on-the-developer's-flyback-time dept.
nerdyH writes to tell us that the Xenomai/SOLO project is attempting to deliver VxWorks and other RTOS emulation for any Linux kernel. "Some weeks ago, I started laying the groundwork for porting the Xenomai emulators natively over the PREEMPT_RT kernel. Unlike the co-kernel based Xenomai version, SOLO does not require any kernel support from additional modules or patches. It is fully based on the standard POSIX library, and runs as a regular process controlled by a single image Linux kernel. As a first step, a VxWorks emulator has just been rebuilt over this new framework."
+ -
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • The benchmarks that are really expected by real time in my area are things like consistency. For example if we set a task/thread to execute every 125 milliseconds, the closer it hits the mark the better. Time lag in either direction puts that OS in the "No" category. Another important asset of an RTOS is well defined task preemption: No task gets preempted by one with worse priority. Time slicing might be enabled so that a task gets preempted by one of the same priority, and better priority tasks always preempt if they are ready to go. Also if a high priority task is waiting on a resource owned by a low priority task, that low priority task gets an elevated priority equal to the high priority task. As a last ditch effort to provide mutual exclusion / data protection, threads/tasks need to be able to disable system interrupts. Remember kids, in the RTOS world one task can take down the whole system.

    VxWorks is the only OS I've played with so far that allows this, but I'm VERY curious to see what people can inject into the Linux kernel. VxWorks is.. shall we say... NOT CHEAP. And inter-version migration is a pain... and god help you if you aren't using off the shelf hardware...
    • by JohnFluxx (413620) on Saturday March 22 2008, @07:02AM (#22828416)
      > Another important asset of an RTOS is well defined task preemption: No task gets preempted by one with worse priority. Time slicing might be enabled so that a task gets preempted by one of the same priority, and better priority tasks always preempt if they are ready to go.

      Any normal distro Linux kernel can do this particular part. Just set the scheduler to round robin. (You can do this in KDE4 btw. Press ctrl-esc to bring up the task manager, right click a process, change priority, and chose round robin.)
    • by pla (258480) on Saturday March 22 2008, @08:00AM (#22828664) Journal
      VxWorks is.. shall we say... NOT CHEAP.

      Have you ever actually had to code for Vx?

      You couldn't pay me enough (literally - I've turned down jobs that wanted me to work with it... I should probably take it off my resume) to deal with that POS (by which I don't mean "Point Of Sale") on a regular basis.

      Actually, in fairness, as an OS, it doesn't suck too much. But the build tools... Let's just say WindRiver clearly subscribes to the "firmware should hurt" coding paradigm. The IDE made OutLook look stable and friendly, the command line build tools simply didn't work (literally - WR couldn't even have tested them, because they failed phenomenally even on a clean install and a "hello world" module), the revision control had no objection to overwriting parent revisions without forcing a new fork... Ugh. I'll probably have nightmares tonight just from thinking about it.

      Oddly enough, it surprises me to see it still talked about. When I suffered with it nearly a decade ago, it looked like a near-certainty that Linux would tap that last nail in its coffin. How ironic, that Linux should now give it new life via emulation.
      • Oh yes I've coded for it. I'm on my second BSP and my third kernel. It's not as bad as it used to be in some respects. The Eclipse is the IDE now. The documentation is still horrendous though. WindRiver is working hard on their own RTOS Linux solution. I don't know if they are planning on eventually digging a hole and throwing VxWorks in it, or just trying to combat the free RTOS Linux market with something they can sell to managers.
        • Re: (Score:3, Informative)

          I have asked Wind River representatives whether their Linux product is meant to replace VxWorks and they emphatically said no. (If that means anything.)
      • You couldn't pay me enough (literally - I've turned down jobs that wanted me to work with it... I should probably take it off my resume) to deal with that POS (by which I don't mean "Point Of Sale") on a regular basis.

        Really? I guess vxWorks is an acquired taste then, because I'd be extremely happy to be given the opportunity to use vxWorks again.

        I would have liked to have my own copy, but since a single licence for vxWorks costs more then I can reasonably afford (well, it used to, I can't find the price no
        • Really? I guess vxWorks is an acquired taste then, because I'd be extremely happy to be given the opportunity to use vxWorks again.

          The last time I had to use it --- which, admittedly, was a while ago --- we had a requirement to do asynchronous I/O. VxWorks didn't support that, so we had to emulate it by using a pool of helper tasks each of which ran a blocking I/O operation. Unfortunately we had a further requirement that asynchronous I/O operations had to be cancellable, and the only way we could find of

      • How ironic, that Linux should now give it new life via emulation.

        Uh, no. Linux is going to give it a new lease on death this way. How many Windows users have been able to jump ship since Wine has actually become useful? If this delivers it will provide an upgrade path away from vxworks that allows a company to spend their time working on a port while using Linux as an interim band-aid.

      • They use Eclipse as their IDE now, so it's much better.

        They certainly much better than LynxOS (who also uses Eclipse as their IDE - but their plugin as not as well integrated by far)
        • by richpm (950690) on Saturday March 22 2008, @09:30AM (#22829086)
          "Why not just get a faster computer," Power consumption? Heat? Noise levels? Size? "... because if they had a clue, they would leverage Eclipse ..." I guess they've got a clue then, they've been shipping an Eclipse based IDE for 2+ years now and Wind River are /very/ active in the development of CDT. In fact the CDT project lead works for them now. Admittedly they do some stuff in a slightly non-standard way (e.g. not the way vanilla CDT does it) but that's with good reason and allows them a far more flexible build system than the standard CDT project model allows.
        • by billcopc (196330) <vrillco@yahoo.com> on Saturday March 22 2008, @10:03AM (#22829240) Homepage
          I don't think you should be speaking against RTOS without any actual RTOS experience. It just makes everyone else assume you're an ass.

          These things typically run on embedded devices, not a friggin' Dell midtower. They do one job and they do it with exacting accuracy, on minified motherboards and fanless CPUs, hooked up to custom-built controllers and monitoring equipment.

          RTOS tasks are typically things we used to do in solid state with simple feedback logic, but the RTOS allows it to be done in software at a lower cost, plus allowing easy updates or adjustments without a complete redesign.
        • Re: (Score:2, Interesting)

          by Anonymous Coward

          A RTOS isn't about speed, it is about predictability. It is about guaranteed response.

          There are some things that a 200MHz machine with the right software can do quicker and more accurately than a 4GHz machine with a standard OS.

          What it comes down to is they built an expensive mansion, but built it on sand. Doesn't matter how expensive or big the house is, if it is built on a poor foundation, the house will be unstable.

          I have seen process control applications where an 8MHz 8086 was fine. No OS, just ap

        • If you are so smart, tell me how to put a cheap 2GHz PC in a 15x10x8cm controller compartment of a robot I'm making. And power it from a 13.8V gel-lead-acid battery that needs every bit of spare power for the main motor. The specification says nothing about having a needless, integrated air heater in the controller, but any CPU that draws more than 200mA and requires more than one voltage with DC-DC convertion efficiency less than 90% is way too much.

          And there are defnitely more things that really need accu
          • Honestly though, it sounds to me like CPLD's or FPGAs may be the proper solution. They are real-time by definition, running what amounts to a large number of processes in true parallel. An FPGA with a built in RISC microprocessor honestly sounds like it would be an easier and cheaper system to develop on than many RTOS's. Obviously one implements the real-time components in the FPGA, but runs the parts that are easier to code for a traditional processor on the embedded processor. That honestly sounds like a
    • by Not Invented Here (30411) on Saturday March 22 2008, @08:06AM (#22828682)
      The problem with VxWorks is that the scheduling accuracy is its only positive feature. Device drivers are rare and expensive, probably because it doesn't have a sensible hardware abstraction layer like Linux, Windows (NT family), and QNX. If you want to use the MMU on the processor you get charged again, and you get even more incompatibilities. The documentation doesn't go into much depth, and Google isn't very helpful, as hardly anybody talks about it on the Internet.

      Have you tried QNX or RTEMS? I don't have any data on their scheduling accuracy, but they claim to support the same real-time features. I've also found the QNX documentation much easier to follow, and I managed to turn out a BSP and a custom device driver within a week of first receiving the software.
      • Re: (Score:3, Insightful)

        I haven't had any experience with other systems yet really. VxWorks did add an abstraction layer for hardware drivers called "VxBus". So far the only advantage I've found is that.. Okay well I haven't found one but I did eventually get it to work. The advantage is they didn't break everything when they introduced it.

        I don't understand why WindRiver hates documentation to much. They actually have a policy of not sending hard copies of their manuals anymore. Their man pages are kind of half-assed. I us
    • Re: (Score:3, Insightful)

      VxWorks is the only OS I've played with so far that allows this (...)

      May be you need to play more :-) . LynxOS [wikipedia.org] is a full-fledged POSIX RTOS, with memory protection, far better than VxWorks if disk and network is involved (I was developing toll systems real time applications for 4 years). I hope someday Linux reach RTOS habilities without having to use "cokernels", as although I'm pretty happy with current kernel preemptiveness, I would love to get true RTOS Linux (echo 1 > /proc/rtos).

    • Re: (Score:3, Interesting)

      VxWorks is the only OS I've played with so far that allows this

      and god help you if you aren't using off the shelf hardware

      Well, and what does happen if you do use off-the-shelf hardware? I am not exactly "well educated" in this area, but I am not quite sure whether the current typical OTS hardware is suitable for RTOS at all. Well, maybe some soft real time apps may run just fine...but I once spoke after-hours with Vojtech Pavlik (of the linux-joystick-drivers-and-other-input-devices fame) and he introduc

      • Well, you can change to see if there is processor time being stolen from the OS by toggling a pin on a fast cycle and watching it with an oscilloscope, or perhaps polling the internal pentium timer. Someone before me had checked with our specific setup to see if this was happening (specifically we were concerned if USB hookups caused the BIOS to inject work) but nothing was detected. We use custom PC boards that could have had it disabled at the BIOS level, but I'm just not sure,

        Off-the-shelf is where BSP's and drivers come in. The BSP (board support package) needs to be configured for the specific board. WindRiver provides a kajillion default packages, and if you use a off-the-shelf-board, the BSP and driver set should require little or no modification at all so you can just go straight to customizing your OS. The more customized your board is, the more you might have to do, such as writing VME, clock, PCI, or Ethernet drivers, do custom memory management, etc. I guess it's not fair to peg this complication on WindRiver. I haven't tried a Linux kernel on a custom board, but just as much configuring must go on at some point.
    • Re: (Score:3, Informative)

      Linux with PREEMPT_RT is as predictable (but not as fast) as VxWorks in the mentioned categories, you just have to make sure that all the RT tasks have SCHED_FIFO or SCHED_RR to behave correctly. VxWorks doesn't have (or at least didn't in version 5.4-5.5 which I used to code for) SCHED_OTHER. And that is a huge drawback for VxWorks because very often you have a lot of application threads running with no hard deadlines and might fluctuate a lot in how much CPU they use (webserver and other user interfaces).
      • Otherwise one task suddenly taking a lot of CPU will starve all tasks with lower priority until it is done.

        I recently worked on a mobile phone platform (not based on VxWorks) which had a mechanism for sending messages to specific threads. There was a system wide 150-slot message queue. There was a background thread that ran at low priority that was supposed to do non-real-time things like UI work. This thread was a message receiver. The system did not support timeslicing.

        Can you see the problem yet?

        If

      • Good points. If you're doing an embedded hard real time system, you might need the small size and timing repeatability of VXworks. If not, you don't need VXworks at all. It's much easier to write to a POSIX interface. There's not much software for VXworks you'd want to port to Linux. So a VXworks wrapper for Linux doesn't meet any widespread need. Maybe someone needed it for a specific porting job, so it was worth doing once.

        I'd still like to see a real message passing system, like the one from QNX,

        • fwiw, I ported some QNX code to Linux a few years back, and wrote my own version of MsgSend()/MsgRecv() in a single .c file using UNIX-domain sockets. it's extremely simple, as long as you adopt the same limitations on portability (ie. writing raw C structs to the wire), lack of network support, and concurrency as the QNX message-passing has.

          QNX message-passing is nothing that can't be easily rewritten.
      • IIRC, QNX is intel-only. At my company we like to use whatever chip is the best deal for the power we need. In 10 or so years, we've gone through 68030, 68040, 68060(?), PowerPC, and various Intel boards - all using VxWorks.
        • Re: (Score:2, Informative)

          QNX used to be intel-only, but has been ported over to other chipsets. I know I've used it on an arm and some ppc before.
  • Why would you ever need to emulate an RTOS in linux? Linux does not do what ThreadX, VxWorks, INTEGRITY, uVelocity, or any of the sort do- imagine you're an embedded device manufacturer and suddenly you need to bump your device up from 64k chip of ram to 8mb. This is completely retarded. In the embedded world, true RTOS are used for things that can never fail, lag, or be insecure in any way. Linux is generally used to fill in a cheap userland. Like on Sony TV's, the RTOS junk is handled by uVelocity, but th
    • Why would you ever need to emulate an RTOS in linux?

      RTFA.

      imagine you're an embedded device manufacturer and suddenly you need to bump your device up from 64k chip of ram to 8mb.

      Imagine you've already got the 8 megs, and you still want things to happen in realtime. Oh, and you want to actually have drivers.

      Suddenly, things like VxWorks are going to cost you in licensing fees and development time, in return for... what, exactly?

      • Linux is not realtime. "Realtime linux" is a non-linux realtime OS with a non-realtime linux compatibility layer... emulating a REAL RTOS?... Why would you emulate a realtime system in a non-realtime system? Doesn't that defeat the purpose of a realtime OS?

        Do you have any idea why people use realtime systems?

        With VxWorks you pay license fees... FOR A REALTIME SYSTEM. You're also able to do a lot more with a lot less resources. In the embedded world, less is more! You save millions cutting kb's (or mb's) of
        • Do you have any idea why people use realtime systems?

          Yeah, pretty much.

          Software costs are just miniscule compared with the cost of making a bulky device with hardware that outclasses its functionality.

          ...aaaand it looks like you didn't read my post. Try again.

        • "Realtime linux" is a non-linux realtime OS with a non-realtime linux compatibility layer... emulating a REAL RTOS?...

          That was true in the past, but it is no longer true. The algorithms of the latest approaches to real-time Linux, when working together, actually do provide deterministic, hard real-time responses if the real-time parts of your application are coded appropriately. (By this, I mean that you don't expect a deterministic response when trying to use a service which isn't, such as a filesystem

    • Re: (Score:2, Informative)

      by Anonymous Coward
      don't click that link, mod parent down.
          • After reading the comments further down the thread (lol) I take back the part about the generally harmless.
            But there is some educational use for those links. Keep them coming, I say.
            • Part of net culture? Harmless? Assuming you don't have your tongue firmly planted in your cheek, I respectfully have to take issue with your statements. Having said that, let me stipulate that my response probably does not apply to the typical /. reader.

              Sorry, did I say 'typical'? I'd better be more careful....

              Much like graffiti spray painted on the side of a building or vehicle, these things should be removed as quickly as possible. Deny the perp his/her "moment of glory". It serves no purpose and in other
              • Much like graffiti spray painted on the side of a building or vehicle...

                Some of the graffiti I've seen is preferable to the mass of advertising billboards around the city which assail my eyes... I'd rather see goatse painted on a wall than another fucking soft drink advert - at least it would bring a smile to my face... ...that's not to say I think most graffiti is attractive - most of it is garbage (daubing your name on a wall has no meaning when no one has any idea who the fuck you are) but I don't think

    • by Tony Hoyle (11698) <tmh@nodomain.org> on Saturday March 22 2008, @07:06AM (#22828426) Homepage
      FFS don't click that link - it's some sort of browser spawner/malware/virus.

      I had to power cycle my machine to shut it down as it managed to completely saturate the machine.
      As far as I can tell it:

      1. Tried to log me onto a gay porn site
      2. Tried to open up IRC and do something (failed, luckily, since osx won't let such things happen automatically.. my screen just filled boxes asking if I wanted to start colloquy)
      3. Tried to run a .exe - luckily on my mac that did nothing.. that's the virus payload I guess

      I reckon if you clicked that button on a windows machine you'd be crying right now - and your passwords would be all over IRC too...

      • I clicked on it (I'm using firefox3 nightly on WinXP and was curious :-) ). It did start to do some crazy stuff on the system. I unplugged it. So far on reboot everything appears fine.
      • No problem here except for the "interesting" background pic.
        Firefox + Adblock + Noscript + Privoxy :)
        • Re: (Score:3, Informative)

          No, it's Lord Haw Haw's Yahoo link that's attacking windows machines.
          But then, who in is right mind would admit on /. to running such a thing :)
          • But then, who in is right mind would admit on /. to running such a thing :)

            Just use the classic defence "I was reading /. from work" ;)
            • Re: (Score:3, Insightful)

              Hehe, I see it the other way around.
              I don't like having to fend off thousands of malwares with an OS that implemented networking as an afterthought.
        • Re: (Score:2, Informative)

          by Anonymous Coward
          What's worse, the link (that Slashdot shows as a Yahoo link) is actually an only slightly obfuscated Nimp link.

          Aside, I find it amazing that a 4 letter TLD is allowed to be used this way as long as it has. Nimp isn't just a shock site, it's got to break enough criminal laws to put it's owners and people that link to it in jail.
        • You can disable certain Javascript functions in Firefox, such as the ability to move or resize windows. Options>Content>Javascript Advanced
        • Meh... I tried it in Opera just to see what would happen. It opens a flickering pop-up (singular -- not multiple) and manages to play the "I'm looking at gay porno" through the speakers. All that was necessary to fix it was a "close window" gesture.
      • And we're to trust an Anonymous Coward who says that malware (regardless of whether it's a hijack or an executable) from another Anonymous Coward is safe?! I don't fu*king think so!
        • well, the html code is fairly clean, but since it loads a couple swf files, and avi, and numerous websites and irc, as well as im clients, there is the possibility that the swf file or avi are malformed to contain an exploit, or the websites could have exploit code on them, while connecting to im and irc can expose your ip address to hackers, and since aim and irc often have gaping security holes, that could be the vector of attack.

          I'm basing this on the guy who pasted the web page code, after a reset.

          it wo