Questions tagged [userspace]

109 questions
7
votes
1 answer

IRQ Handling from User Space Linux

I'm writting a driver for a synthesized device in an FPGA. The device has several IRQs and have requested them on my driver: irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); rc = request_irq(irq, &Custom_driver_handler,IRQF_TRIGGER_RISING ,…
eps_712
  • 135
  • 1
  • 2
  • 8
7
votes
2 answers

PCIe Driver - How does user space access it?

I am writing a PCIe driver for Linux, currently without DMA, and need to know how to read and write to the PCIe device once it is enabled from user space. In the driver I do the basics in…
user2205930
  • 1,046
  • 12
  • 26
5
votes
1 answer

How to flush a range of address in CPU cache?

I want to test the performance of a userspace program in linux running on x86. To calculate the performance, it is necessary for me to flush specific cache lines to memory (make sure those lines are invalidated and upon the next request there will…
Hoda
  • 63
  • 7
4
votes
1 answer

How stable is TSC (TimeStamp Counter) from user space for Intel x86-64 CPUs in 2020?

Some times I need a proper way to measure performance at nanosecond from my user space application in order to include the syscall delays in my measurement. I read many old (10yo) articles saying it isn't any stable and they are gonna remove it from…
Alexis
  • 2,136
  • 2
  • 19
  • 47
4
votes
1 answer

I can't find the problem in My C program for SAMA5D27 board

I am using sama5d27-som1-ek1 embedded board which i build for it Linux image operating system and a cross compiler with YOCTO project. I wanted to test a C code on my board. This code creates a new userspace LED class device and monitors it. A…
gaston
  • 405
  • 5
  • 22
4
votes
1 answer

Mocking a memory mapped device in C in userspace

I wish to mock a memory mapped device in C in order to do effective unit testing of a device wrapping library (in Linux). Now, I know I can mmap a file descriptor into userspace which could in principle represent a mock of said device. So, AFAICT,…
Henry Gomersall
  • 8,434
  • 3
  • 31
  • 54
4
votes
2 answers

Linux suspend/resume operations' userspace notification

I'm working on an embedded linux platform. When I do "echo "mem" > /sys/power/state", system will suspend. I know that kernel and driver can know that suspend operation's coming. But would it be possible that a user space process or application can…
4
votes
1 answer

ALSA PCM Playback device in Userspace

I'm having a hard time figuring out how to make a Linux PCM playback device which entirely works in user space. When the application calls snd_pcm_open/snd_pcm_readi/writei, I want does calls to end up in a user space driver and the pcm data to be…
niom
  • 41
  • 3
3
votes
1 answer

AES-GCM with the Kernel Crypto API from Userspace

I am trying to use the kernel crypto API to communicate with a hardware accelerator from userspace. I use af_alg for the communication with the kernel. I can use the API for hashing or "normal" symmetric encryption but I can not get it to work with…
td3614
  • 31
  • 3
3
votes
1 answer

Could a custom syscall access another process' memory?

For educational purposes, I've managed to create a custom syscall that just prints a message in the kernel's log. What I was thinking about now is to create a "cross-process memcpy" syscall that receives another process' PID, a memory address of…
mgarciaisaia
  • 14,521
  • 8
  • 57
  • 81
3
votes
1 answer

How to make communication between user space program and Linux kernel module in order to print a message sent from user program to the kernel

I have developed a simple linux kernel module which I will send to it a char message from user space program. This is the module : #include #include #include #include #include…
gaston
  • 405
  • 5
  • 22
3
votes
2 answers

Does the kernel only execute on occurrence of an exception

I'm learning about embedded Linux. I can't seem to find proper answers for my questions below. My understanding is, when user-space applications are executing, if we want to perform IO for example, a system call is made which will cause a SW…
Engineer999
  • 3,683
  • 6
  • 33
  • 71
3
votes
1 answer

Nested EPOLL FD

I find very limited information online about the behaviour of nested FDs. Lets say EPOLL FD1 is shared between EPOLL FD2 and FD3. So what would happen if epoll FD1 get an event Is it going to raise an event to both FD2 and Fd3 if it is added…
3
votes
0 answers

is there a linux kernel module to perform contiguous physical memory allocation?

I have read this. But I am working with PCI UIO, and I therefore need continuous physical memory. I am talking (among other things) virtio, so the presence of an IOMMU won't help here. PCI-VFIO has a much nicer and secured approach, I agree, but the…
user1159290
  • 951
  • 9
  • 27
3
votes
1 answer

Null pointer dereference in User space and kernel space

what will happen if we dereference the null pointer in user space and kernel space? From my understanding the behaviour is based on compiler,architecture,etc. but in general for every user space program allocated with virtual memory and the paging…
freeworld
  • 79
  • 1
  • 8
1
2 3 4 5 6 7 8