Hi guys,

I'm having trouble with FP inside of an RT process and would really
appreciate some help.

I'm trying to get floating point operations to work inside of an
RT-Linux process but my system crashes consistently whenever I do any of
the following :

- call the function pthread_setfp_np
- declare a floating point variable such as float or double inside an RT
process
- perform an FP operation

I have compiled the kernel with floating point emulation, included
'no387' in my /etc/lilo.conf, and have also tried setting my CPU type to
386 but the system still crahses with the message:

"math_emulate: 0010:c4019dc9
Kernel Panic: Math emulation needed in kernel"

Does this mean the compilation option for floating point emulation
hasn't worked or is there something else I need to do before making a
floating point calculation in an RT process ?

I'm using 2.2.13-RTL2.0 on a Pentium Pro 200 machine and have included a
small program below that is one example that will cause the kernel
panic.  The program runs fine without the call to pthread_setfp_np.  

#include <rtl.h>
#include <time.h>
#include <pthread.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <math.h>
#include <asm/io.h>

pthread_t thread;

void *start_routine(void *arg)
{  
        while (1) {
                pthread_wait_np();
                rtl_printf("Hello Matt \n");
        }
        return 0;
}

int init_module(void) {
        hrtime_t now = gethrtime() ;
        pthread_create(&thread, NULL, start_routine, 0) ;
        pthread_setfp_np(thread,1) ;
        return pthread_make_periodic_np(thread, now, 500000000) ; 
}

void cleanup_module(void) {
        pthread_delete_np (thread);
}



-- 
Matt Garratt 
Research Engineer 
Centre for Visual Sciences 
Australian National University 
http://cvs.anu.edu.au/CVS.html 
PO BOX 475 
Canberra ACT 2601 
Australia 
Ph: 61 2 6249 5145 
Fax: 61 2 6249 3808
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to