Questions tagged [linux-device-driver]

Device drivers take on a special role in the Linux kernel. They are distinct programmatically abstracted “black boxes” that make a particular piece of hardware respond to a well-defined internal programming interface; they hide completely the details of how the device works.

User activities are performed by means of a set of standardized calls that are independent of the specific driver. Mapping those calls to device-specific operations that act on real hardware is the role of the device driver. This programming interface is such that drivers can be built separately from the rest of the kernel and “plugged in” at runtime when needed. This modularity makes Linux device drivers easy to write, to the point that there are now thousands of them available.

There are a number of reasons to be interested in the writing of Linux device drivers.

  • The rate at which new hardware becomes available (and obsolete!) alone guarantees that driver writers will be busy for the foreseeable future.

  • Individuals may need to know about drivers in order to gain access to a particular device that is of interest to them.

  • Hardware vendors, by making a Linux device driver available for their products, can add the large and growing Linux user-base to their potential markets.

The open-source nature of the Linux system means that if the driver writer wishes, the source to a driver can be quickly disseminated to millions of users.

Source -

  1. Linux Device Drivers 3rd edition

  2. Linux module programming guide

4991 questions
2
votes
3 answers

How can I reference non-exported Linux kernel functions from a kernel module?

I have been using this process check-pointing project from Berkeley labs (namely, BLCR). And I noticed that they have been referencing some functions in the kernel that were not exported nor they were declared in any of the header files. Their code…
feeling_lonely
  • 6,665
  • 4
  • 27
  • 53
2
votes
2 answers

Integrating WiFi Dongle with Beaglebone Black- Issue

I am working on beaglebone black trying to integrate TP link TL-WN721N Wifi dongle which uses atheros driver. I am using linux 3.2 kernel with ti-sitara rootfs The problem is when is type the command wpa_supplicant -Dwext -i wlan0 -c…
Sorcrer
  • 1,634
  • 1
  • 14
  • 27
2
votes
1 answer

kernel module name with _ and -?

Why do I have this names in my redhat 5 server? [root@sanserver ~]# lsmod | grep multipath dm_multipath 58969 2 dm_round_robin scsi_dh 42561 1 dm_multipath **#Module name with _** dm_mod 103569 28…
c4f4t0r
  • 1,563
  • 15
  • 24
2
votes
0 answers

Reading PCI MSICAP register

I am trying to enable multiple MSI on my PCI card where in before enabling the same i read pci_config_space() MSICAP + 2h: MC – Message Signaled Interrupt Message Control. The way i am doing is as follows u16 val; int pos =…
pkumarn
  • 1,383
  • 4
  • 22
  • 29
2
votes
0 answers

Understanding webcam 's Linux device drivers

As far as I know, device driver is a part of SW that is able to communicate with a particular type of device that is attached to a computer. In case of a USB webcam, the responsible driver is UVC that supports any UVC compliant device. This means…
dempap
  • 352
  • 1
  • 9
  • 21
2
votes
0 answers

getting started with linux kernel programming

I am from embedded systems development.I have decent knowledge about c , c++ and micro-controllers. But I want to pursue my career in Linux kernel programming. For this I also have some decent knowledge of operating systems concepts and Linux…
2
votes
1 answer

Replacing deprecated "dev_attrs" attribute with "dev_groups"

I'm trying to compile a Linux device driver (kernel module), however the module was last updated in April 2013 and of course it doesn't compile anymore on a recent (3.13) kernel, here's the error : als_sys.c:99:2: error: unknown field ‘dev_attrs’…
user2629998
2
votes
1 answer

Run-time address space randomization effect on System.map

System.map file in Linux is generatied after OS is built. I am wondering whether using a "run-time" address randomization technique would make the addresses within system.map invalid.
2
votes
0 answers

How Can I simulate Packet Drop at QoS (Traffic control)

I wanted to simulate a situation where ping/icmp packet following through egress path should be dropped due to Linux QoS and these dropped packet should be captured by VLAN stats under ifconfig command. I would want to trace down the code where…
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
2
votes
0 answers

How to poll a file in Linux kernel space?

I opened a device file in Linux kernel space using struct file *filp->f_op->open. Now I want to poll the opened device file before doing a read using struct file *filp->f_op->read or I want to read the device file once the data has arrived. When I…
kar
  • 2,505
  • 9
  • 30
  • 32
2
votes
1 answer

Linux device driver basics

what is the difference between a device and a driver and how they are related ? plz explain me in context of below diagram
Sagar Patni
  • 312
  • 2
  • 11
2
votes
1 answer

My first linux driver, its for a gpio button, a little confused on interrupts

So this is a power button, I need it to turn the power off or go to sleep depending on how long you hold it. That's the simple part. I've never written a driver from scratch, but have tweaked a few. I'm realizing there is a bunch of small things…
Kevin
  • 320
  • 5
  • 17
2
votes
1 answer

What are the various files created when compiling linux device driver?

I have very basic question. When we create a driver using makefile, we see a number of files created as Module.symvers .mod.c built-in.o .mod.o .o modules.order .ko So far I'm only interested in *.ko file and not concerned with any other file.…
Kumar Gaurav
  • 1,287
  • 3
  • 19
  • 47
2
votes
1 answer

USB user Space device driver for a custom device

What is a "USB user Space device driver for a custom device?"
sagar reddy
  • 97
  • 2
  • 8
2
votes
1 answer

Unable to understand ftrace output

I am trying to trace kernel using ftrace. I want to trace what are the functions called in kernel. I am able to capture the function trace from /sys/kernel/debug/tracing/trace. But unable to understand. The most of the trace having below calls only.…
Chinna
  • 3,930
  • 4
  • 25
  • 55