Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-14-2003, 04:19 PM   #1
LQ Newbie
Registered: Jul 2003
Location: Canada
Distribution: RedHat
Posts: 2

Rep: Reputation: 0
Question Unable to hit my serial port interrupt routine

Hi there;

Im trying to write a program to intercept the PPS signal from my Motorola GPS
receiver (Oncore).
This the initialisation of my module

int __init hguts_init(void)
int result;

result = check_region(COM1_BASE,8);
if (result<0) printk("<1>short: can't get I/O address \n");
else request_region(COM1_BASE, 8,"hgserial");

result = register_chrdev(254, "hgserial", &hgserial_fops);
if (result < 0) {
printk(KERN_WARNING "hgserial: can t get major %d\n",254);
return result;
result = request_irq(IRQ_COM1, myserial_interrupt, SA_INTERRUPT, "myserial", NULL);

if (result) {
printk("<1>hgserial: can t get assigned irq %i\n", 3*2);
} else {
outb(0x00,COM1_BASE+1); /*Disable Interrupt on COM1*/
outb(0x08,COM1_BASE+3); /* Tur non DLAB */
outb(0x00,COM1_BASE); /*Set baud rate I tried differnet */
outb(0x0C,COM1_BASE+1); /* baud rate*/
outb(0x00,COM1_BASE+3); /* Turn off DLAB */
outb(0x01,COM1_BASE+1); /* Set up the interrupt register */

return 0;

And this is my handler routine (Nothins special)

void myserial_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("<1> Im the intr \n");

After I will load the module I could reserve the IRQ 4
[root@bedoule ntp-4.1.80-rc1]# cat /proc/interrupts
0: 1065580 XT-PIC timer
1: 22469 XT-PIC keyboard
2: 0 XT-PIC cascade
4: 129 XT-PIC myserial
9: 0 XT-PIC usb-uhci
11: 8832 XT-PIC eth0
12: 142647 XT-PIC PS/2 Mouse
14: 68778 XT-PIC ide0
15: 132412 XT-PIC ide1
NMI: 0
ERR: 0

Please If you have any idea, Im stuck and I have to fix this probleme ASAP.

Last edited by hguts; 07-14-2003 at 04:28 PM.
Old 07-15-2003, 07:45 AM   #2
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Rep: Reputation: 31
You could use interrupt under gcc? Oh, I don't know but I have read some documents telling that gcc does not have the interrupt process ability.

From your code I think you first open the serialport, then request the interrupt, if successful, do some control, like baud rate by modifying some registers.

But I have no idea on "request_irq" this function...


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
Interrupt routine... Elric of Grans Programming 2 07-05-2005 07:11 PM
Serial Port Driver- Interrupt Invoking Problem sinux Linux - Software 0 03-07-2003 03:47 PM
IRQ4 - Serial Port Interrupt not invoked. sinux Linux - General 1 03-06-2003 04:23 PM
Unable to hit IRQ4 Serial Port Interrupt sinux Linux - Distributions 1 03-06-2003 03:46 PM
Unable to HIT IRQ4 , Serial Port Driver sinux Linux - Software 0 03-06-2003 03:41 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:19 PM.

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