I need my driver to return phys_addr_t type value through an ioctl call. I need to return this value through a struct which is passed through arg. The question is what type do I use in this struct? For example, say the following struct is passed through an arg virt_to_phys returns a phys_addr_t, however this type doesn’t seem to exist
Tag: linux-device-driver
meaning of p in %pa[p] in the printk formats
The question is with regard to the printk formats. The documentation that I’m reading is located here Here is an excerpt that I’m asking about: What does [p] in %pa[p] stand for? What does it mean? Answer The p in [p] stands for phys_addr_t when used in %pap. This is analogous to the d in %pad stands for dma_addr_t, as
What kind of api does a sata hard drive expose?
I understand that the linux kernel uses a driver to communicate with the hard disk device and that there is firmware code on the device to service the driver’s requests. My questions are: what kind of functionality (i.e. api) does the firmware expose? For example, does it only expose an address space that the kernel manages, or is there some
Docker container: lsmod not found
How can I get lsmod and modprobe installed in Ubuntu 14 that is running on Docker? I need to install a device driver in the container, but first I need these commands. (The docker image is originally from docker hub, from a tomcat:7 image). Answer Based on comment from @lan-Abbott. Problem is solved.
sysfs_create_group(): Where to call?
currently i write an driver module which offers some entries in the sysfs. I read a lot through the driver source tree and the internet. I found two approches where the sysfs_create_group() is called: a) most commonly: In the probe() function of the Driver. Like adviced here How to attach file operations to sysfs attribute in platform driver? Random Thing
Are sysfs binary attributes allowed to return more than one page of data?
I’m writing a linux device driver that, among other things, exposes a readonly binary attribute in sysfs, the interface for which is When I try to cat or hexdump the file, after the first 4096 bytes, my driver will be given a zero-sized read (It is passed 0 for size). Why is this happening, and how should my driver respond
Linux DMA: Using the DMAengine for scatter-gather transactions
I try to use the DMAengine API from a custom kernel driver to perform a scatter-gather operation. I have a contiguous memory region as source and I want to copy its data in several distributed buffers through a scatterlist structure. The DMA controller is the PL330 one that supports the DMAengine API (see PL330 DMA controller). My test code is
How to make LKM multi-process safe?
I make simple LKM (Linux kernel module) to interact my MPI application (multi process per one compute node) at user level with kernel level information. I need to extract some data from kernel to the user level application at runtime. My MPI application uses few processes run on the same compute node simultaneously. My LKM provides two files in /proc.
Can bash be used to communicate directly with hardware?
I am interested in writing my own tool in bash to act in place of my current network controller (wpa_supplicant) if possible. For example if I want to issue commands in order to begin a wps authentication session with a router’s external registrar, is it possible, without using any pre-built tools, to communicate with the kernel to directly access the
Module not found when I do a modprobe
I am trying to install this module: https://github.com/mkottman/acpi_call I did a make, make install. I then saw acpi_call.ko is in /lib/modules/4.3.3-5-default/extra/. When I do a modprobe acpi_call I get modprobe: FATAL: Module acpi_call not found in directory /lib/modules/4.3.3-5-default Tried putting acpi_call.ko in /lib/modules/4.3.3-5-default but got the same result. I would like to make it persistent so that when I reboot,