On 7/27/06, Ulises <uarcidiacono@xxxxxxxxx> wrote:
Hi All, I'm making a bar code reader driver. This device will be conected by the serial port. In my init_module() I have: if ((request_region (0x3F8, 1, "BARCODEREADER_NAME") == NULL)) { .. Error handling ... } The problem is that always I get a NULL pointer. I think the problem is because this address is already taken by another device. Please take a look to my cat /proc/ioports: 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : ide0 0300-0301 : MPU401 UART 0376-0376 : ide1 0378-037a : parport0 03c0-03df : vga+ 03f6-03f6 : ide0 *03f8-03ff : serial* 0cf8-0cff : PCI conf1 5080-5093 : sis630_smbus a000-afff : PCI Bus #01 cc00-ccff : 0000:00:01.1 cc00-ccff : sis900 d000-d0ff : 0000:00:01.4 d000-d0ff : Trident Audio d400-d47f : 0000:00:01.6 d800-d8ff : 0000:00:01.6 ff00-ff0f : 0000:00:00.1 ff00-ff07 : ide0 ff08-ff0f : ide1 So, My question is: If I can remove this "serial" driver, Will I have this address free to use it by "my device"?
Yes. Even if you don't free, you still can use the ioports within the kernel. When you use request_region() you are just making sure that only you will use it. Its something like a semaphore. You still can enter the critical section(ie, use the ports), if you don't wish to follow the rules.
In case I can remove the "serial" module, Where can I fin it? I cannot find a module called "serial" doing lsmod. These are all that I
Your system need not have a module named serial. The name 'serial' is what you have given when you had requested the port. The actual driver could be different(like 8250). Also, if the driver is compiled into the kernel, you may have to reconfigure it.
have: $ lsmod | grep seri* cpufreq_userspace 4824 0 cpufreq_conservative 7588 0 serio_raw 7556 0
Thank You, Jinesh. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/