All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Kim Chuan Lim <lim.kim.chuan@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] binding without root access..
Date: Tue, 11 Jul 2006 19:50:48 +0200	[thread overview]
Message-ID: <44B3E4F8.5040008@domain.hid> (raw)
In-Reply-To: <e325d110607111035g238d240fo862ce480eb6f3cff@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

Kim Chuan Lim wrote:
> Hi Jan,
> 
> I try to run some old example from http://www.captain.at/xenomai.php
> I am getting feddup with some examples which keep on hanging my system.
> I thought maybe if i run the old examples with normal user mode, i
> will not crash the system.

Every program with RT power can hang your system: in an endless loop
with raise priority. That's why it's not that simple to allow non-root
RT access.

> 
> Between, the examples program in testsuits are too much complicated
> for beginner like me.
> Is there any up to date and easy understandable examples?

What about ksrc/skins/native/snippets/? They may not run but they can
give some ideas. Here is one of the simplest that does run (my classic
version):

#include <signal.h>
#include <sys/mman.h>
#include <native/task.h>

void demo(void *arg)
{
    rt_task_set_periodic(NULL, TM_NOW, 200000);
    while (1) {
        rt_task_wait_period(NULL);
        /* real-time jobs */
    }
}

void catch_signal(int sig) { }

int main(int argc, char* argv[])
{
    RT_TASK demo_task;

    signal(SIGINT, catch_signal);
    mlockall(MCL_CURRENT|MCL_FUTURE);
    rt_task_create(&demo_task, "mydemo", 0, 99, 0);
    rt_task_start(&demo_task, &demo, NULL);
    pause();
    rt_task_delete(&demo_task);
    return 0;
}

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2006-07-11 17:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-11 16:05 [Xenomai-help] binding without root access Kim Chuan Lim
2006-07-11 17:05 ` Jan Kiszka
2006-07-11 17:35   ` Kim Chuan Lim
2006-07-11 17:50     ` Jan Kiszka [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-11 18:05 Hannes Mayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44B3E4F8.5040008@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=lim.kim.chuan@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.