Questions tagged [device-driver]

A device driver is a specialized software component (usually considered "system software") which allows a system to interact with a particular type or class of hardware device, such as a keyboard, serial port, disk drive, video display, memory controller, or other peripheral.

A device driver performs translation between logical operations from the operating system or application and physical actions of a hardware device. If the hardware device supports interrupts, the device driver fields and processes its interrupts, possibly arranging for the requesting application to sleep as appropriate.

Device drivers developed since the 1980s are usually written in a high level language, most often C. They usually execute in the most trusted CPU context of the operating system (variously called "kernel mode", "ring 0", "executive mode", etc.) and so have significant restrictions on what actions they can perform. In particular, they usually lack access to a runtime library; often they cannot perform floating point operations within interrupt context.

A Virtual Device Driver is a special flavor where the driver emulates a hardware device, particularly in virtualization environments. There is also the which play a special role in the Linux kernel.

1100 questions
10
votes
3 answers

Getting device/driver information related to a COM port?

I have a Serial-to-USB device with a similarly named device driver in the Windows device manager. The devices do not always grab the same COM port on system boot, so my program needs to identify it on start up. I've tried using RXTX to enumerate the…
Rob
  • 5,223
  • 5
  • 41
  • 62
10
votes
7 answers

USB for embedded devices - designing a device driver/protocol stack

I have been tasked to write a device driver for an embedded device which will communicate with the micro controller via the SPI interface. Eventually, the USB interface will be used to download updated code externally and used during the…
lordhog
  • 3,427
  • 5
  • 32
  • 43
10
votes
1 answer

how to create a C++ device driver class

I know C very well, not C++ - and want to create a hardware driver in C++. I need some pointers. In C, I would create a structure, with function pointers and populate the func-pointers accordingly, ether at run time, or by compile time…
user3696153
  • 568
  • 5
  • 15
10
votes
3 answers

How to implement mouse drivers Linux USB mouse driver?

I need to control mouse pointer of my computer screen using an external device.I just know i have to write a device driver for that device. It's a usb device. Can anyone tell me how should i approach this problem ? What are the modules and…
geek_guy
  • 607
  • 1
  • 5
  • 17
10
votes
3 answers

How to register this tablet to Ubuntu udev list?

I've got a cheap android tablet and I need to use it to test apps on it. I am using Ubuntu so I first have to add the device to udev list. I connected the tablet, but adb does not see it $ adb devices List of devices attached $ The I tried…
sandalone
  • 41,141
  • 63
  • 222
  • 338
9
votes
1 answer

Connection between mmap user call to mmap kernel call

I am trying to understand how mmap works. User level call of mmap looks like below. void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); but kernel level mmap for a particular device driver looks like: int…
vindyz
  • 1,079
  • 2
  • 11
  • 23
9
votes
5 answers

How to pass a union as a parameter to a function

This code is for a driver for a DAC chip. I have a bitfield below which represents a 24-bit register. So what I need to do, is populate the bitfield and write it out over SPI to the chip. typedef struct { uint8_t rdwr_u8: 1; …
phil05
  • 101
  • 1
  • 2
  • 4
9
votes
3 answers

Google Nexus 5 is not being detected by computer/doesn't appear in device manager

I have connected my mobile to my laptop via a USB cable, have turned on developer mode, debugging mode, MTP, and installed the google driver via the Eclipse "extras" folder in the SDK Manager. I have unplugged and replugged the device into every USB…
user3658385
  • 101
  • 1
  • 1
  • 6
9
votes
2 answers

is memory allocated by kmalloc() ever automatically freed?

I'm writing a device driver that, among other things, allocates a block of memory with kmalloc. This memory is freed when the user program closes the file. In one of my experiments, the user program crashed without closing the file. Would…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
8
votes
1 answer

Replace Windows USB Class Driver with a custom driver?

I wonder if anyone can help at all, a bit of a specialist problem this. I have an application that needs to read and analyse a number of USB devices (not simultaneously, they are each run in seperate tests and could in theory be run on different…
Richard Baxter
  • 1,317
  • 1
  • 15
  • 24
8
votes
1 answer

PyCUDA: Querying Device Status (Memory specifically)

PyCUDA's documentation mentions Driver Interface calls in passing, but I'm a bit think and can't see how to get information such as 'SHARED_SIZE_BYTES' out of my code. Can anyone point me to any examples of querying the device in this way? Is it…
Bolster
  • 7,460
  • 13
  • 61
  • 96
8
votes
1 answer

USB Debugging in Windows 10 to tablet?

I am developing an application windows 10 on a stationary PC. I also have a tablet windows 10 that once connected to the PC via USB not see debugging ( How to make it accessible?
AlexeySRG
  • 791
  • 2
  • 7
  • 12
8
votes
4 answers

Curiosity beyond abstractions: how is bytecode executed? how do device drivers work?

Everything I've seen on *nix has been a set of abstractions off hardware, but I'm curious as to how the hardware works. I've programmed in assembly, but that's still only a set of abstractions. How does a processor understand assembly opcodes (as…
Yktula
  • 14,179
  • 14
  • 48
  • 71
8
votes
1 answer

How Devfs and dev file system differ

I read about devfs(known as device file system ) to facilitate device driver programming as mentioned in linux device drivers text . How different is devfs from /dev directory in linux.Are they both same ?, i'm quite confused .
Santhosh Pai
  • 2,535
  • 8
  • 28
  • 49
8
votes
7 answers

How to share register and bit field definitions between a device driver and the FPGA it controls

Are there any good, existing software tools available to assist in generating C header files with appropriate #defines for register offsets as well as bit definitions from VHDL? If any such tools do exist, what restrictions to they place on the…
Tim Kryger
  • 11,166
  • 4
  • 52
  • 41
1 2
3
73 74