[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] RTL V3 - how to



Hi Nathan,

I've tried out pre6e and found that the rtlsigtimer_app in the
regression directory will crash my computer when calling
rtlinux_sigprocmask.  When these calls are removed, the test will work. 
It looks like there a minor problem with the logic for testing the
results.  I changed it to:


/* check that the timers went off the right number of times */
if ((*marker_ptr != 8) || (*marker2_ptr != 16))
{
	....
}

(ditto for the single periodic timer test)

The results showed that each periodic task would run just once
(*marker2_ptr was 1).

I found the same with a test program I was using.  It worked okay under
pre6d.

Any ideas?  Need more info?

cheers,
stuart warren

This is some code that runs correctly under pre6d but only increments to
1 under pre6e... (ie the same behaviour as the modified regression
program)
----------------------------------------------------------
#include <sys/ioctl.h>
#include <linux/isdn.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

/* 3.0pre6d uses rtl_signal.h */
//#include <rtl_signal.h>
/* 3.0pre6e uses rtlinux_signal.h */
#include <rtlinux_signal.h>

/* comment out for 3.0pre6e */
//#define RTLINUX_SIGTIMER0			RTL_SIGTIMER0
//#define RTLINUX_SA_RESETHAND	RTL_SA_RESETHAND	
//#define RTLINUX_SIG_IGN				RTL_SIG_IGN				

int Send_Data;

void transmission_handler(int unused)
{
	if(Send_Data < 10000) /* arbitrary */
		Send_Data++;
}

int main()
{
	struct rtlinux_sigaction sig;
	
	Send_Data = 0;
	
	sig.sa_flags = RTLINUX_SA_RESETHAND;
	sig.sa_period = NSECS_PER_SEC/4;
	sig.sa_handler = transmission_handler;

	if (rtlinux_sigaction(RTLINUX_SIGTIMER0, &sig, NULL)) {
		printf("Coundn't get timer\n");
		perror("rtlinux_sigaction");
		return -1;
	}

	printf("\n");
	
	while(1) {
		printf("Send_Data = %d\n", Send_Data);
		usleep(20000);
	}
	
	sig.sa_handler = RTLINUX_SIG_IGN;
	rtlinux_sigaction(RTLINUX_SIGTIMER0, &sig, NULL);
	return EXIT_SUCCESS;
}

----------------------------------------------------------


Nathan Simons wrote:
> 
> On Wed, Aug 02, 2000 at 08:53:59AM +1000, Stuart Warren wrote:
> > Now that I've woken up...
> >
> > For 6e, instead of removing the librtl* files in /usr/lib, it's probably
> > better to change the makefile so it generates librtl.a and librtlpSOS.a
> > instead of librtlinux*.  Also, I modified the make install rule so that
> > depmod included the path to /sbin/ ditto for the other modutils in
> > ./scripts/insrtl.
> 
>         Nope, my bad.  i forgot to change the install rule in the toplevel
> Makefile.  We decided to make the prefix for the libraries "librtlinux" to
> keep things consistent (rtlinux_sigaction() is in librtlinux.a, with
> rtlinux_signal.h being the include file).
> 
> --
> Nathan Paul Simons, Programmer for FSMLabs
> http://www.fsmlabs.com/
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/