LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-14-2003, 04:19 PM   #1
hguts
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 */
udelay(5);
}

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
CPU0
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
captainstorm
Member
 
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...
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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