From: John Que <qwejohn@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: generate a single How to generate a single interrupt on a floppy device
Date: Thu, 28 Jul 2005 08:44:34 -0400 [thread overview]
Message-ID: <ada605fb05072805446987d757@mail.gmail.com> (raw)
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
reply other threads:[~2005-07-28 12:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ada605fb05072805446987d757@mail.gmail.com \
--to=qwejohn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox