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
5
votes
3 answers

Paged pool memory or Nonpaged pool memory ?? (windows driver development)

I am newbie in windows driver development. I just want to know , a global variable in a driver will use paged pool memory or non paged pool memory ? Thanks and Regards Navaneeth
Navaneeth
  • 607
  • 2
  • 9
  • 19
5
votes
1 answer

What is the proper way to acknowledge an ATA/IDE interrupt?

I am currently working on a hobby OS, specifically the ATA driver. I am having some issues with PIO data-in commands with interrupts. I am trying to execute the READ MULTIPLE command to read multiple sectors from the drive, block by block, with an…
Mr. Shickadance
  • 5,283
  • 9
  • 45
  • 61
5
votes
1 answer

What is the relationship between device drivers and a filesystem

Background Hello. I am trying to wrap my head around the relationship between a filesystem (ext2/3 etc), device drivers and device files. I'll lay out my understanding of each term and then my questions. Device Driver As far as I understand, the…
Yarden
  • 496
  • 1
  • 5
  • 16
5
votes
2 answers

Why does Windows return ERROR_ACCESS_DENIED when I try to open a delete pended file

When we open a delete pended file, the Windows subsystem returns ERROR_ACCESS_DENIED even though they have the ERROR_DELETE_PENDING status. HANDLE h = CreateFile(L"C:\\test.txt", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, 0,…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
5
votes
1 answer

Linker errors in building Vivek's Virtual Camera on Windows 10?

I am trying to build Vivek's Virtual Camera on Windows 10. For that I need to have Win7Samples/multimedia/directshow/baseclasses I have downloaded baseclasses and built it using Visual Studio 2019. Now I am ready to build Virtual camera filter. I…
Alok
  • 7,734
  • 8
  • 55
  • 100
5
votes
2 answers

R graphics: output to several file formats

In a number of scripts I first develop a graph on screen, and then need to save it as several file formats with particular height/width/resolution. Using png(), pdf(), svg(), ... to open a device, and then dev.off() to close it, I'm forced to put…
user101089
  • 3,756
  • 1
  • 26
  • 53
5
votes
3 answers

Writing device driver?

I wonder if I understand correctly... Say, if I want to control how my mouse work, i.e Left Button open window, Right Button send keystroke 'A' etc. But I am not talking about writting something like follows in an application: void…
King
  • 183
  • 1
  • 3
  • 13
5
votes
3 answers

Get Rotation Speed of Disk Sample Code

Im not really good at VC++ but does anyone have a sample code to get the rotation speed of disk in a computer. I have been working on detecting SSD drives and one solution from researching all day was to get the rotation speed and since SSD have 0…
patlimosnero
  • 963
  • 4
  • 13
  • 22
5
votes
4 answers

When do you use container_of macro?

I know what the macro does. In many kernel level codes, it is often used to traverse linked-list. I want to find other useful cases. When do you use container_of or CONTAINING_RECORD macro? When is the macro extremely useful?
Benjamin
  • 10,085
  • 19
  • 80
  • 130
5
votes
2 answers

USB blocking using minifilter driver (passThrough)

I am writing a mini-filter code for USB (Flash Drives) for blocking i.e (Access Denied).So, could someone help me out, how to detect or block USB or what methods to use in passThrough WDK sample code for USB detection and USB blocking? I am trying…
suraj_fale
  • 978
  • 2
  • 21
  • 53
5
votes
1 answer

How to know if a device has been explicitly been disabled by user?

Using device manager a user can explicitly enable/disable a device, as can be seen in the following image. For a given device I want to know if it's currently in a user disabled/enabled state. I have tried the following…
Sahil Singh
  • 3,352
  • 39
  • 62
5
votes
1 answer

SEL4 User-space drivers Example

I am trying to write sample usb driver for sel4 in userspace. can anybody have an idea about sel4 user-space driver please share with me... If anyone have example code for sel4 user-space driver(sample drivers) please share with me...
Ashokkumar
  • 115
  • 1
  • 3
  • 8
5
votes
0 answers

Are driver probe and remove methods in linux kernel executed in parallel for multiple devices?

Can someone please shed some light on driver .probe and .remove methods serialization? For example if there are 10 PCIe cards attached to a server and there is a common driver to detect(probe) these 10 devices, then how is the probe function…
Capricorn
  • 701
  • 1
  • 10
  • 20
5
votes
1 answer

Can a sysfs attribute take a non numeric value in Linux Device Driver?

I am developing a Linux device driver where I have to pass a string of characters to it using sysfs interface. Can the sysfs attributes accept the data in a string form (something like echo "somedata" > sysfs_interface )? I have implemented it…
Raulp
  • 7,758
  • 20
  • 93
  • 155
5
votes
1 answer

gpiod_* vs gpio_* methods in the Linux Kernel

Which of the GPIO APIs in Linux device driver programming is preferable and in what conditions: gpio_set_value() or gpiod_set_value()? One takes the GPIO desc as the object while other takes the GPIO parsed from the device tree.
Raulp
  • 7,758
  • 20
  • 93
  • 155