All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] "illegal instruction", then "rt_task_start()" error -38 (on a 486/no fpu)
@ 2012-06-04 19:26 Marc Le Douarain
  2012-06-04 19:28 ` Gilles Chanteperdrix
  2012-06-04 19:49 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 12+ messages in thread
From: Marc Le Douarain @ 2012-06-04 19:26 UTC (permalink / raw)
  To: xenomai

Hello,

I've some difficulties to run Xenomai with a little 'hello' example 
(that create/start a task)
on a target 486 processor (without fpu).

I successfully compiled the Linux kernel 2.6.38.8 with 
adeos-ipipe-2.6.38.8-x86-2.11-02.patch (Xenomai version is 2.5.6)
(modify file xenomai-2.5.6/include/asm-x86/calibration.h 
"current_cpu_data"->"cpu_info" were required)

dmesg extract:
[    0.000000] I-pipe 2.11-02: pipeline enabled.
...
[    0.140008] CPU: Cyrix Cx486SLC
...
[    1.440804] Xenomai: hal/i386 started.
[    1.448804] Xenomai: scheduling class idle registered.
[    1.452804] Xenomai: scheduling class rt registered.
[    1.488806] Xenomai: real-time nucleus v2.5.6 (Wormhole Wizards) loaded.
[    1.496807] Xenomai: starting native API services.
[    1.500807] Xenomai: starting POSIX services.
[    1.504807] Xenomai: starting RTDM services.

After compiling user-space Xenomai part with
./configure --disable-x86-sep --disable-x86-tsc / make / sudo make install
and copy /usr/xenomai/lib on the target
I've got "illegal instruction" with my little 'hello test' example that 
create/start a task.

Then I've tried to add flag to set 486 instruction set to gcc...
For that, to compile user-space this time I used :
./configure CFLAGS="-march=i486" LDFLAGS="-march=i486" --disable-x86-sep 
--disable-x86-tsc / make / sudo make install
Now, at rt_task_start, I've got an error code -38 !

Any one have an idea on the trouble ?
(at start thinking on the fpu missing, but seems not to be used !? no 
libm dependance)

Many thanks.



Here my little hello_test example code used :
============================
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>

#include <native/task.h>
#include <native/timer.h>

RT_TASK task_desc;

static void task(void *arg)
{

     RTIME now,previous;

     rt_task_set_periodic( NULL, TM_NOW, 1000000000 );
     previous = rt_timer_read( );

     while( 1 )
     {
         rt_task_wait_period( NULL );
         now = rt_timer_read( );

           printf("Hello world xenomai test! %ld.%06ld ms\n", 
(long)(now-previous)/1000000, (long)(now-previous)%1000000 );
   /* Outch... printf accesses a Linux ressource so we are now
      in secondary mode */
     }
}

void catch_signal( int sig )
{
}

int main (void)
{
     int err;

printf("starting...\n");

   signal( SIGTERM,catch_signal );
   signal( SIGINT,catch_signal );

   /* disable memory swap */
   mlockall( MCL_CURRENT | MCL_FUTURE );

   err = rt_task_create( &task_desc, "demo_task", 0, 99, 0 );
   if (err!=0 )
   {
     printf("rt_task_create error : %d\n",err);
     return 1;
   }

   /* wait for task function termination */
   err = rt_task_start( &task_desc, &task, NULL );
   if (err!=0 )
   {
     printf("rt_task_start error : %d\n",err);
     return 1;
   }

   printf("running!\n");
   pause( );

   rt_task_delete( &task_desc );
   return 0;
}

And the Makefile :
===========
CFLAGS = -march=i486 -O2
LDFLAGS = -march=i486 -O2

CFLAGS += `/usr/xenomai/bin/xeno-config --skin=native --cflags`
LDFLAGS += `/usr/xenomai/bin/xeno-config --skin=native --ldflags`

all:
     gcc hello_test.c $(CFLAGS) $(LDFLAGS) -o hello_test

cflags:
     echo $(CFLAGS)

ldflags:
     echo $(LDFLAGS)





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-07-14 12:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-04 19:26 [Xenomai] "illegal instruction", then "rt_task_start()" error -38 (on a 486/no fpu) Marc Le Douarain
2012-06-04 19:28 ` Gilles Chanteperdrix
2012-06-04 21:13   ` xenophile
2012-06-10 18:44   ` Marc Le Douarain
2012-06-10 20:09     ` Gilles Chanteperdrix
2012-06-10 20:19       ` xenophile
     [not found]       ` <4FD61BF8.9090901@laposte.net>
2012-06-11 17:09         ` Gilles Chanteperdrix
2012-06-17 19:05           ` Marc Le Douarain
2012-06-17 19:19             ` Gilles Chanteperdrix
2012-07-14 12:51               ` Marc Le Douarain
2012-06-10 21:00     ` Gilles Chanteperdrix
2012-06-04 19:49 ` Gilles Chanteperdrix

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.