public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* generate a single How to generate a single interrupt on a floppy device
@ 2005-07-28 12:44 John Que
  0 siblings, 0 replies; only message in thread
From: John Que @ 2005-07-28 12:44 UTC (permalink / raw)
  To: linux-kernel

Hello,

I want ,for tracing and debugging purposes, to be able to generate a single 
interrupt on a device which (unlike the timer or ide devices, for example) does 
not get interrupts very frequently.

Looking at the output of /proc/interrupts (and look at IRQ 6 of the
floppy) shows
that the floppy device interrupt counter is not incremented during time if you
are not constatntly working with it.

So a good candidate for generating a single interrupt can be a floppy.

Is there a way to generate a single interrupt on a floppy device?

I had tried the following:

I mount the floppy;
I see that during the time, sometimes after running ls on a floppy
2 interrupts are generated; and sometimes after ls on a floppy
no interrupts are generated. The same is with
creating a file/reading a file: sometimes there
are interrupts and sometimes there are no interrupts.


So I wrote the following little program:

#define BUFFER_SIZE 2048

char buffer[BUFFER_SIZE] __attribute__((aligned(4096)));

int main()
        {

        int fd;
        int bytes_read;
        int i;
        fd = open("/dev/fd0",O_DIRECT);

        void* data;

        if (fd < 0 )
          printf("could not open device\n");

       else

        printf("device opened\n");

                {
                bytes_read = read(fd,buffer,512);

                //fseek(fd,SEEK_CUR,1);
                printf("bytes_read = %d\n",bytes_read);
                }

        close(fd);
        }

Each time I ran it I got course :
device opened
bytes_read = 512

But running this program again and again ***DOES NOT*** increase the
number of interrupt on the floppy device IRQ (6).

Any ideas?

Which user space code I should write / Which operation should I do so that each
time I will do it,(again and again) it will generate an interrupt on the 
floppy IRQ (6) ?

(BTW I build this program by  gcc -D_GNU_SOURCE floppy.c)

Regards,
John

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-28 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 12:44 generate a single How to generate a single interrupt on a floppy device John Que

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox