[Rtai] Behavior in the kernel space - rtai 3.3
Suessmilch Bernd
Bernd.Suessmilch at swarovski.com
Wed May 21 15:13:12 CEST 2008
> -----Original Message-----
> From: rtai-bounces at rtai.org [mailto:rtai-bounces at rtai.org]On Behalf Of
> Djamel Louar
> Sent: Mittwoch, 21. Mai 2008 14:24
> To: rtai at rtai.org
> Subject: [Rtai] Behavior in the kernel space - rtai 3.3
>
>
>
> Hi all,
>
> I used an ancient program which works with rtai 24 (two years
> ago) with
> a more recent version : rtai 3.3.
> This is a very basic program for beginners.
> It's seem a different behavior of the execution between the
> version 24
> of rtai and the 3.3ver.
> In fact with rtai 3.3, i can stop the program before its end and i
> don't think that it is correct for real time systems.
Compared to RTAI-24, RTAI-3.3 has an improved signal handling. In 3.3
signals are proper delivered even to RT-tasks. Due to this improved signal
handling you can interrupt or terminate RT-tasks the same way as ordinary Linux
tasks.
If you don't want a signal to affect your RT-task you have to provide a proper
setting of the task's signal mask.
> Moroever, i remember that with rtai 24, the system "freezes"
> during an
> execution of an RTAI application in the kernel space.
Even with RTAI-24 the system only freezes, when your RT-task consumes
too much CPU time.
Best regards,
Bernd
>
> So i think that i do a mistake, could someone tell me where
> i'm wrong ?
>
> Thanks Djamel.
>
> My code: task.c
>
> #include <linux/module.h>
> #include <rtai.h>
> #include <rtai_sched.h>
> #define NUMERO 1
> #define PRIORITE 1
> #define STACK_SIZE 2000
> #define PERIODE 1000000000 // 1 s
> #define TICK_PERIOD 1000000 // 1 ms
> #define N_BOUCLE 10
>
> static RT_TASK hello_world;
> int ierr=0;
> RTIME now;
>
> static void fun(long arg)
> {
> int boucle = N_BOUCLE ;
> while(boucle--){
> rt_task_wait_period();
> }
> }
> int init_module(void)
> {
> rt_task_init(&hello_world, fun, 0, 4000, 0, 0, 0);
> rt_set_oneshot_mode();
> start_rt_timer(nano2count(1000));
> now=rt_get_time()+TICK_PERIOD;
> rt_task_make_periodic(&hello_world,now,nano2count(PERIODE));
> return 0;
> }
> void cleanup_module(void) {
> rt_task_delete(&hello_world);
> stop_rt_timer();
> }
>
> Makefiles:
> GNUmakefile:
> ----------------------------------------------------------------
> prefix := $(shell rtai-config --prefix)
> ifeq ($(prefix),)
> $(error Please add <rtai-install>/bin to your PATH variable)
> endif
> CC = $(shell rtai-config --cc)
> ifneq ($(findstring 2.6.,$(shell rtai-config --linux-version
> 2>/dev/null)),)
> LINUX_DIR = $(shell rtai-config --linux-dir)
> all:
> $(MAKE) -C $(LINUX_DIR) CC=$(CC) SUBDIRS=$$PWD V=$(V) modules
> clean:
> $(RM) $(LINUX_DIR)/.tmp_versions/*_rt.mod *.o *.ko *.mod.c .*.cmd
> else
> MODULE_CFLAGS = $(shell rtai-config --module-cflags)
> all: task_rt.o
> task_rt.o: task.c
> $(CC) $(MODULE_CFLAGS) -c $<
> clean:
> rm -f *.o
> endif
> .PHONY: clean
> --------------------------------------------------------------
> -------------
> makefile:
>
> EXTRA_CFLAGS += $(shell rtai-config --module-cxxflags)
> obj-m += task_rt.o
> task_rt-objs := task.o
> --------------------------------------------------------------
> -------------------
> _______________________________________________
> Rtai mailing list
> Rtai at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>
More information about the Rtai
mailing list