Hello everyone, hello RTL world,
I have a problem with global floating point variables (I think) on my
new machine. It has a Pentium III, 650MHz, 256KB, with 2x128MB SDRAM,
and runs Mandrake 7.1 using the linux-2.2.16-9mdk kernel source that I
recompiled with rt-linux 2.3 pre-release2.
The problem is: I have a very simple code (see below) that generates no
exception (assuming that the rtl debugger is loaded) when my floating
point variable, fp, is declared locally inside my thread. However,
when I want to display fp with xxgdb (v1.12) it returns:
{ No symbol "fp" in current context } ...
Furthermore, when fp is declared as a global variable, inserting the
module does generate the exception 7 (does this correspond to a segmentation
fault??).
The dmesg command returns:
{ Real-Time Linux Debugger Loaded (http://www.fsmlabs.com/)
ret_sched_par = 0
ret_period = 0
ret_fp = 0
rtl_debug: exception 7 in rt_p, thread id 0xcdf4f600; (re)start GDB to debug
ret_create = 0 }
and from xxgdb:
the 1srt time the step command is used, it returns:
{ Can't send signals to this remote system. SIGSEGV not sent. }
if display fp is used it returns:
{ Disabling display 1 to avoid infinite recursion. }
and in the bottom window:
{ fp = Address of symbol "fp" is unknown. }
info stack is:
{ #0 mycode (arg=0x0) at rt_p.c:31
#1 0xd0040073 in ?? ()
#2 0x0 in ?? () }
Any idea about what could be wrong? Could that be a parameter to change
in "make menuconfig" before re-building the kernel?
Thank you for your attention and your awaited ideas.
- Herve
ps: Besides, as absurd as this may sound, my system seemed to be working
fine during the time it was connected to the network in my lab (ie
with more modules loaded by default)...
--
rt_p.c:
#include <linux/module.h>
#include <time.h>
#include <pthread.h>
#include <rtl_debug.h>
double fp;
pthread_t mythread;
void * mycode( void * arg )
{
int ret, i;
struct sched_param sched_par;
hrtime_t now = gethrtime();
/*double fp;*/
sched_par . sched_priority = 1;
ret = pthread_setschedparam( pthread_self(), SCHED_FIFO, &sched_par);
rtl_printf("ret_sched_par = %d\n", ret);
ret = pthread_make_periodic_np( pthread_self(), now + 1000000000,
1000000000 );
rtl_printf("ret_period = %d\n", ret);
ret = pthread_setfp_np( pthread_self(), 1 );
rtl_printf("ret_fp = %d\n", ret);
fp = 0.9;
for( i = 0 ; i < 10 ; i++ )
{
pthread_wait_np();
rtl_printf("i=%d\t", i);
fp = fp + 1.1;
}
return( 0 );
}
int init_module( void )
{
int ret;
ret = pthread_create( &mythread, NULL, mycode, (void *)NULL );
rtl_printf("ret_create = %d\n", ret);
return( 0 );
}
void cleanup_module( void )
{
int ret;
ret = pthread_delete_np( mythread );
rtl_printf("ret_del = % d\n", ret);
}
--
Herve Lacheray, M.Eng. Student
Department of Mechanical Engineering
McMaster University
Hamilton, ON, Canada
-- [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/