[EMAIL PROTECTED] wrote:
>
> Dear all:
> I have installed rtlinux v1.1 on a pentium 133 computer.
> But the periodic process always block after the first two cycles.
> Please help me!
>
> the following code is very simple:
> --------------------------------------------
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/version.h>
> #include <rtl_sched.h>
> #include <asm/rt_time.h>
> #include <rtl_fifo.h>
> #include <linux/cons.h>
>
> RT_TASK mytask;
>
> void
> fun (int t)
> {
>
> conpr (" r \n");
> rt_task_wait ();
> }
>
> int
> init_module (void)
> {
>
> rt_task_init (&mytask, fun, 1, 3000, 5);
> rt_task_make_periodic (&mytask, rt_get_time () + 10000, 100000);
> printk ("RT-TASK-STARTED\n");
> return 0;
>
> }
>
> void
> cleanup_module (void)
> {
> rt_task_delete (&mytask);
> rtf_destroy (1);
> printk ("RT-TASK removed from the kernel\n");
> }
OK so try this
you should have put the task in a loop
The myint stuff will show you the cycle count.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <rtl_sched.h>
#include <asm/rt_time.h>
#include <rtl_fifo.h>
#include <linux/cons.h>
RT_TASK mytask;
static int myint = 0;
void
fun (int t)
{
while(1) {
conpr (" r \n"); */
myint ++;
rt_task_wait ();
}
}
int
init_module (void)
{
rt_task_init (&mytask, fun, 1, 3000, 5);
rt_task_make_periodic (&mytask, rt_get_time () + 10000, 100000);
printk ("RT-TASK-STARTED\n");
return 0;
}
void
cleanup_module (void)
{
rt_task_delete (&mytask);
printk(" my int = %d \n",myint);
/* rtf_destroy (1); */
printk ("RT-TASK removed from the kernel\n");
}
regards
Phil Wilshire
--- [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/