Dear Friends,

*******************************************
Environment:
RT-Linux - Version 3.1
Linux - 2.4.18 with RT patch from contribution

*******************************************
Hardware
K6 - 500 MHz
64 MB SDRAM
20GB HAR DISK
*******************************************

I  have a problem serving interrupts via RT-Linux version 3.1 on kernel
2.4.18 .

I tested a small driver to acquire data from the parallel Port Every Byte
comes in with one interrrupt, which is fired by the /ACK-Line.

I found out that, if  I execute a simple command like "cat
rtlinux-3.1.tar.gz"  cause
something wrong. Some time the interrupts are not all correctly served. Why
?

How is this possible?

Please help me to come out of this.

Best Regards,


Matteo

#include <rtl.h>
#include <rtl_sync.h>
#include <time.h>
#include <pthread.h>
#include <asm/io.h>
#include <linux/kd.h>
pthread_t thread;

unsigned int intr_handler(unsigned int irq, struct pt_regs *regs)
{
    outb(0, 0x378);
    rtl_hard_enable_irq(7);
    return 0;
}

void * start_routine(void *arg)
{
    struct sched_param p;
    p.sched_priority = 1;
    pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);
    pthread_make_periodic_np (pthread_self(), gethrtime(), 50000); //ns
    while (1)
    {
        outb(3, 0x378);
 pthread_wait_np();
    }
    return 0;
}

int init_module(void)
{
    int status;
    rtl_irqstate_t f;
    rtl_no_interrupts(f);
    status = rtl_request_irq(7, intr_handler); // if IRQ-Handler is OK
    rtl_printf("rtl_request_irq: %d\n", status); // this will output 0
    // on your console.
    /* enbable parallel port interrupt */
    outb_p(inb_p(0x37A) | 0x10, 0x37A);
    outb_p(inb_p(0x21) & (~0x80), 0x21);
    outb_p(0x20, 0x20);
    rtl_hard_enable_irq(7);
    rtl_restore_interrupts(f);
    outb(0, 0x378); //set LPT-outputs to 0
    return pthread_create (&thread, NULL, start_routine, 0);
}

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






-- [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/

Reply via email to