Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 11-17-2010, 03:26 PM   #16
LQ Newbie
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0

A few days later,

same story ;-) Like Craftonix I have run following code as module:

#include <linux/module.h>
#include <linux/interrupt.h>
#include <asm/io.h>

#define BASEPORT 0x378
static unsigned long devid;
int cntr;

static irqreturn_t handler(int irq, void *data)
	printk("parint: >>> Interrupt PARALLEL PORT INT %d HANDLED\n", cntr);
	return IRQ_HANDLED;

int xinit_module(void)
	int ret;
	ret = request_irq(7, handler,  SA_INTERRUPT   , "parallelport", (void *)&devid);
	if (ret)	{ printk ("parint: error requesting irq 7: returned %d\n", ret); }
	outb_p(0x10, BASEPORT + 2); 

	printk("parint: Generating Interrupt now on all output pins (intr/ACK = pin 10)\n");
	//generate interrupt
	outb_p(0, BASEPORT);
	outb_p(255, BASEPORT);
	outb_p(0, BASEPORT);
	printk("parint: Interrupt generated. You should see the handler-message\n");
	return 0;

void xcleanup_module(void)
	free_irq(7, (void *)&devid);

Everything seems to work fine at the beginning, including all module startup messages in dmesg. But if I try to run the handler, nothing hapens. To do so I have connected pin 10 and 9 from lpt.

In /proc/interrupt i can see that "parallelport" is bind to irq 7.

It would be very nice if someone can help.


insmod, interrupt, irq, parallel, port, rmmod

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel port problem in 9.3 jolphil SUSE / openSUSE 2 12-06-2005 05:28 PM
Parallel port problem longnam Linux - Hardware 1 03-31-2005 04:13 AM
parallel port handler interrupt tincho Programming 1 10-01-2003 05:34 PM
Serial Port Driver- Interrupt Invoking Problem sinux Linux - Software 0 03-07-2003 03:47 PM
Parallel port interrupt trondsol Programming 6 05-16-2002 08:15 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration