119 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
4
votes
0
answers
163
views
Problem after creating signal handler with 'sigaction' in a standalone multi-thread executable. SIGSEGV from KERNEL when receives the handled signal
I am trying to make a standalone (without libc) mutlithreading executable in linux, which can be handled with signals and unix-domain socket, but I have troubles setting up the signal handler.
This is ...
0
votes
1
answer
171
views
Linux CUSE: How to implement blocking or non-blocking operation
I'm interested in implementing a userspace char device in Linux using CUSE.
In a Linux kernel driver for char devices, the kernel driver .read function is supposed to implement either blocking or non-...
0
votes
1
answer
64
views
X,y coordinates in the drawing area are shifted when other widgets are shown
Please see the attached screenshots to realize the problem. I packed a GTK drawing area with other widgets. When these widgets are shown the coordinates in the drawing area are shifted and so the ...
1
vote
1
answer
153
views
x86-64 User Mode access to higher half addresses
I've been studying how paging and access controls work on x86-64 and I’m trying to understand the interaction between the USER flag used for page entries and memory access from user-mode processes.
As ...
0
votes
0
answers
51
views
Check arguments in the write system call from userspace to kernel space
I am trying to write a procfs entry from the user space side.
From the kernel side iam using struct file_operations in that .write member which will point to a write funtion in kernel space. The ...
0
votes
0
answers
105
views
Allocating Kernel Space Memory for a PCI Device and Mapping to User Space Using UIO
I’m working on a project where I need to allocate memory from kernel space (DMA) for a specific PCI device. The goal is to allocate this memory in user space using ioctl calls(just like doing regular ...
1
vote
0
answers
95
views
struct filename, difference between fields `name` and `uptr`
I'm working on a Linux kernel (v5.15) module and I need to create a wrapper for the _do_filp_open to checks the file path opened. I'm using the kprobe mechanism to intercept the call and to define a ...
1
vote
0
answers
184
views
Identical C code using identical user-space bluetooth library works fine on one Ubuntu 22.04 laptop and fails on another
I have a custom library that is based off of cwiid user-space library for Nintendo Wiimote connectivity. You can find it at https://github.com/pd-l2ork/cwiid.
Assuming you have your development ...
1
vote
2
answers
254
views
fgets that doesn't stop at spaces or linebreaks
I'm writing a user space program and I want to send a text file content to the kernel module. The text file isnt to long so instead of sending line by line I rather send all the text in one string.
...
0
votes
1
answer
506
views
How to implement syscall in XV6
I have this assignment:
Implement a syscall that returns information about the current process (e.g. its process ID
and state). Think about who is responsible for allocating the memory that contains ...
1
vote
1
answer
932
views
Using I2C or SPI device via Linux Userspace I/O driver?
Is Linux Userspace I/O driver can support to use for a I2C or SPI device?
For example in case of use in an SoC like an i.MX or Zynq, is it possible to use UIO for I2C or SPI? Can be probed an I2C or ...
0
votes
0
answers
589
views
I2C device drivers in userspace : mutex on ioctl and smbus address
While reading the linux kernel documentation on I2C device drivers from user space, I noticed that ioctl() is used to "put the address on the bus".
So a typical workflow as described is:
...
0
votes
1
answer
145
views
Userspace use Generic Netlink Library pass NLA_NESTED data to kernel error
How to fill NLA_NESTED data in the Userspace Generic Netlink Library data and send to the kernel? please help me
This is my code :
void *msg_h = genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, m_id, 0, 0,
...
1
vote
0
answers
111
views
How to detect if `struct page` is backed by a file on a filesystem in Linux?
I am writing a Linux device module that need to occasionally pin userspace memory pages. Some of these pages may be backed by a file placed on a filesystem. That happens if a userspace program which ...
3
votes
2
answers
611
views
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&...