linux-device-driver

Finding device base address to communicate via inb() and outb()

I am trying to communicate with a disk drive using inb(), inw(), outb() and outw() commands so I can find specific information about the drive. However, to use these commands, I need the correct I/O ports for the device. When I have the correct I/O ports, I can find the information I am looking for very easily, however, I do not know a...

Building a Network Appliance Prototype Using a standard PC with Linux and Two NIC's

Hi, I am willing to build a prototype of network appliance. This appliance is suppose to transparently manipulate Ethernet packets. It suppose to have two network interface cards having one card connected to the outside leg (i.e. eth0) and the other to the inside leg (i.e. eth1). In a typical network layout as in the attached image, i...

tasklet advantage in userspace application

Hi, Got some doubts with bottom half.Here, I consider tasklets only. Also , I consider non-preemptible kernel only. Suppose consider a ethernet driver in which rx interrupt processing is doing some 10 functions calls.(bad programming :) ) Now, looking at performance perspective if 9 function calls can be moved to a tasklet and only 1...

learning linux drivers

Hello all I am learning now days programming drivers. I am doing my learning from this book Linux Device Drivers But I am little bit lack of practice. Can you recommend me some simple projects that I can get started with. Or some open source project that newbie can understand what is going on. Additional examples and tutorials w...

How to write a userspace linux block device driver?

Hello, I would like to write a linux block device driver. The driver would not need to access the hardware so it can be in userspace. To start, I have tried to build an example block device driver with this Makefile: obj-m = sbd.o KVERSION = $(shell pwd) PWD = $(shell pwd) all: make -C /lib/modules/$(KVERSION)/build M=$(PWD) modu...

Function name and address missing from Linux System.map

Hello all, I am doing embedded development on an AT91SAM9263 board and running into a strange problem. It is running debian Linux kernel 2.6.18.4 and is cross-compiled with arm-linux-gcc 3.4.6 and uses uClibc-0.9.28 for the C library. I am debugging a kernel device driver and a specific function is not appearing in the System.map file...

ifconfig packet count

Hi, if I type ifconfig i get packet for Tx and RX ... where exactly the piece of code to increment this counter? Is it in the network driver itself? or in the kernel ? If possible please provide lxr link of the counter variable used. Thx ! ...

mounting without -o loop

Hi, I have written a dummy (ram disk) block device driver for linux kernel. When the driver is loaded, I can see it as /dev/mybd. I can successfully transfer data onto it using dd command, compare the copied data successfully. The problem is that when I create ext2/3 filesystem on it, I have to use -o loop option with the mount command...

Changing the Interrupt descriptor Table

I am using Linux 2.6.26 kernel version and I am trying to change the interrupt descriptor table using a kernel module. I am only trying to change the page fault table entry here. So I make a copy of the original IDT and make changes to the page fault table entry only. The objective of the ISR is to print out information of the page fault...

userspace to kernel space and sysfs and how to use sysfs to change one reservered value in igmpv3 pkt.

I have posted query previously and i am repeating same I want to modify igmpv3 (Linux) which is inbuilt in kernel2.6.-- such that it reads a value from a file and appropriately decides reserved(res 1) value inside the igmpv3 paket which is sent by a host. I want to add more to above question by saying that this is more a generic questio...

Why can't I register edge triggered interrupts in Linux 2.6.26?

Howdy All, First time poster, so please excuse any stupidity. I'm working on porting a custom CPLD driver on a linux kernel built for an MPC83xx from 2.6.22 to 2.6.26, and am receiving an unexpected Oops. The driver works fine for the .22 kernel, but the .26 kernel chokes on my call to request_irq. Does anybody know why there was a cha...

When to best implement a I2C driver module in Linux

I am currently dealing with two devices connected to the I2C bus within an embedded system running Linux. I am using an exisiting driver for the first device, a camera. For the second device, I have successfully implemented a userspace program with which I can communicate with the second device. So far, both devices seem to coexist happi...

New to Linux Kernel/Driver development...

Recently, i began developing a driver of an embedded device running linux. Until now i have only read about linux internals. Having no prior experience in driver devlopment, i am finding it a tad difficult to land my first step. I have downloaded the kernel source-code (v2.6.32). I have read (skimped) Linux Device Drivers (3e) I rea...

Is it possible to call a user-space callback function from kernel space in Linux (ioctl)?

Is it possible to expand the ioctl interface in Linux so that the user-space application can send a pointer to a function to the kernel space driver? I'm in particular thinking of ways to handle the stream in user-controllable way but doing it in the kernel. Those operations could be attached to the kernel module but this would make de...

How to register a function in a driver code as its ISR

Following the feedback i got from: http://stackoverflow.com/questions/2683682/new-to-linux-kernel-driver-development/2683819 In linux-kernel (v 2.6.32), I have written a driver (.c file) by comparing it with an existing driver and "borrowing" heavily from its code. The driver is registered fine and init() and probe() are working fine. ...

How can I register a call-back on suspend in a linux driver?

I'm writing a linux driver and I would like to register a callback function to be invoked when the system goes to sleep. What is the api to do this? Thanks. ...

Linux keyboard event capturing /dev/inputX

I was trying to capture keyboard events. e.g. I want to drill down a keylogger from the scratch. After 2 hours of fighting I found the following neel@pc1$ ls -l /dev/input/by-id lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd -> ../event1 lrwxrwxrwx 1 root root 9 2010-05-05 21:33 ...

Depmod - unresolved symbols in rt73 module

I'm trying to install a linux driver for my wireless network card (D-Link DWL-G510) on my Red Hat Linux 7.1 machine with a 2.4.37.9 kernel. I downloaded the serial monkey driver from the sourceforge site and was able to successfully compile the module. However, whenever I do a "make install", the make script executes a "depmod -a" comman...

Can a Linux device driver wait for a DMA to terminate in the device_remove() function?

I've written a Linux device driver for a PCI device. This device performs DMA operations. An issue arise when the program crashes when a DMA operation is running. Indeed, when crashing, the device_remove() function is called by the system (as if close() were called). This function does the cleanup on the memory regions used by the PCI d...

framebuffer not available

I am trying to run an application that uses framebuffer on 2.6.31-14-generic #48-Ubuntu. All need to do is to install a framebuffer device to get rid of the following error. /dev/fb/0: No such file or directory framebuffer not available. FATAL: no framebuffer available I googled through and found some resources indicating to do that...