Slashdot Mirror


Linux Gains Native RTOS Emulation Layer

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."

12 of 89 comments (clear)

  1. Realtime, VxWorks, Dolla Dolla Bill Yall by Epistax · · Score: 5, Interesting

    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...

    1. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by JohnFluxx · · Score: 4, Informative

      > 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.)

    2. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by pla · · Score: 5, Interesting

      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.

    3. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by Not+Invented+Here · · Score: 5, Informative

      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.

    4. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by Epistax · · Score: 3, Informative

      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.

    5. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by Epistax · · Score: 3, Interesting

      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.

    6. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by joelsherrill · · Score: 5, Informative

      RTEMS is a free, open source alternative to VxWorks that provides POSIX threads in addition to an API we call the "Classic API" that was based upon an old dead proposed VITA standard from pSOS+ folks. RTEMS is single process, multi-threaded in the POSIX sense and has almost every POSIX 1003.1b features that is possible without being able to exec a new process. We use GNU tools and maintain an APT/Yum repository so GNU/Linux users have an easy situation with the tools. Check out some of the places it has been used at http://www.rtems.org/flyers.html and in the Wiki Applications page. You can get predictable tasking and algorithmic behavior while still staying in the free software world.

    7. Re:Realtime, VxWorks, Dolla Dolla Bill Yall by Esben · · 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). In VxWorks you have to give all such tasks priority 255 and use time slicing. Otherwise one task suddenly taking a lot of CPU will starve all tasks with lower priority until it is done.

      Another problem I have seen in VxWorks is the priority inheritance: It doesn't work correctly for nested locks: A low priority task takes a lock A, runs it's own code for and then it calls into say a driver and takes lock B. Now some high-priority task wants to access the same driver and tries to lock B. The first tasks is then boosted in priority and soon finishes the driver call and unlocks B. But it is not unboosted before it release A. That is a huge problem in a RTOS: Suddenly the timing of the high priority task depends on how long a low priority tasks keeps the completely irrelevant lock A. You don't get the decoupling, that the timing of a high priority tasks only depends on the tasks of equal or higher priority, which is so important in a RTOS.

      Basicly, I think core of Linux with PREEMPT_RT is a better (more deterministic) RTOS than VxWorks, but slower (longer maximum latencies for especially interrupts); but all subsystems around the scheduler etc. aren't coded for RT use - i.e. it has non-deterministic code-paths and might even make blocking calls. So an RT application on Linux/PREEMPT_RT can basicly only use basic highres timers, simple serial ports and memory mapped devices. Use of the netstack, disk IO is a no-go. But then again, the same applies to VxWorks...

  2. Re:A quick search reveals by Tony+Hoyle · · Score: 5, Informative

    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...

  3. Re:POS needs realtime? hahahahhaha by richpm · · Score: 5, Insightful

    "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.

  4. Re:A quick search reveals by ozmanjusri · · Score: 4, Insightful
    Thanks for the spam sunshine.

    How 'bout you reformat and reinstall so the rest of us don't pay for your "everything appears fine." system?

    --
    "I've got more toys than Teruhisa Kitahara."
  5. Re:POS needs realtime? hahahahhaha by billcopc · · Score: 5, Informative

    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.

    --
    -Billco, Fnarg.com