generate a single interrupt on a How to generate a single interrupt on a floppy device?

Jul 28, 2005 0 Replies

Hello,



I want to be able to generate a single interrupt on a device which does not get interrupts very frequently.



A good candidate can be a floppy (bacause cat /proc/interrupts shows me that the number of interrupts does not increase during time).



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.

I of course check if interrups were generated by looking at cat /proc/interrupts. (and look at IRQ 6 of the floppy).



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 operation should I do / which code I should write so that each time I will do it, it will generate an interrupt on the floppy IRQ (6) ?



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



Regards, John



Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required