Results 1 to 1 of 1
I got a new problem with the following interrupt handler code with respect to
serial port 1. I have a cable connecting two serial ports of two computers
with linux ...
- 10-20-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 1
problems in coding an serial port interrupt handler for linux !!
I got a new problem with the following interrupt handler code with respect to
serial port 1. I have a cable connecting two serial ports of two computers
with linux on them. On one computer there is minicom installed and on another
I have compiled and successfully insmoded the below shown module. But when I
type on minicom, it doesnt show anything (by the command 'dmesg') on the
other computer where my module is loaded !
Kindly help !!
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <asm/io.h>
#define PORT 0x3F8
irq_handler_t isrSerialPort (int irq, void *dev_id, struct pt_regs *regs)
{
* * * * * * * * printk ("\nThank god !\n");
* * * * * * * * return (irq_handler_t) IRQ_HANDLED;
}
int init_module ()
{
* * * * * * * * outb (0x01, PORT + 1);
* * * * * * * * outb (0x83, PORT + 3);
* * * * * * * * // Set Baud rate - Divisor Latch Low Byte
* * * * * * * * outb (0x0C, PORT + 0);
* * * * * * * * // Set Baud rate - Divisor Latch High Byte
* * * * * * * * outb (0x00, PORT + 1); *
* * * * * * * * // number of bytes to read
* * * * * * * *outb (0x07, PORT + 2);
* * * * * * * *outb (0x03, PORT + 3);
* * * * * * * * int h = request_irq (4, (irq_handler_t) isrSerialPort,
SA_SHIRQ, "God", (void *) (isrSerialPort));
* * * * * * * * // Interrupt when data received
* * * * * * * * outb (0x01, PORT + 1);
* * * * * * * *
* * * * * * * * return h;
}
MODULE_LICENSE ("GPL");


Reply With Quote
