[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Realtime OS needed



Here's what I know on the subject..

At 11:57 Uhr +0200 08.04.2003, martin f krafft wrote:
Folks,

We are building a robot, and have been advised to use QNX

There has been an article in the german "Linux Magazin" recently (about 2 months ago), where a hexapod has been controlled by a kernel module on a standard linux kernel. The author said it worked well and the only critically long delays were caused by console switches, IIRC.

I know that there are realtime patches for Linux floating around.

There's RTLinux, which is not a patch to linux, but an own kernel that can run linux on top of it. There is a nice HOWTO on linuxdoc.org (or whatever that domain is called now), I've read it once and it seemed not very difficult.

Lastly: does anyone have a good document covering realtime, what
it's needs are, and what it does? I know that realtime means that
processes don't get put in a queue but run immediately. How that
works with a multi-tasking OS is a bit foggy to me. Moreover, what's
the difference between a process on a realtime OS, and one with
nice -20?

A process with nice -20 will still be interrupted regularly by timeslices. What you rather want (if you do it in userspace) is realtime priority for userspace processes, see man 2 sched_setscheduler. But this can only guarantee you that no other userspace process will take you away the cpu, it will not guarantee you short delays. A kernel module is most probably better suited. Lowlatency-/preemptible kernel patches should help for userspace, and I guess also some for kernel space (probably only for "bottom-halve" processing?).

In kernel space, there are interrupts, timers, and tasklets (and kernel threads and maybe more that I don't know about). With interrupts and timers (and tasklets?) you usually have to return quickly from processing (this is the "top(?) halve") and if you need more work to be done, you have to set that up as "bottom halve" which will be called at some point later in time. (The only example I've used timers for can be found at http://pflanze.mine.nu/~chris/linux/sensor/ ). Don't know more about it, better check the "Linux Magazin" article if it is online.

Christian.



Reply to: