linux-device-driver

PCI driver 'Oops: Kernel access of bad area' error

若如初见. 提交于 2020-01-24 19:30:38
问题 I wanted to write a simple PCI express driver for Xilinx FPGA. But I am not able to request memory region for PCI. Question is: How to claim that I/O memory area for custom driver. I want to write 3. byte of that area using driver. Below are the details. What am I missing ? Thanks 1-) I am getting this error: [ 4.345350] Unable to handle kernel paging request for data at address 0x00000005 [ 4.353978] Faulting instruction address: 0x80000000002c9370 [ 4.358337] Oops: Kernel access of bad area

LINUX KERNEL driver hangs/freeze after handling mapped register

隐身守侯 提交于 2020-01-23 18:37:25
问题 I'm completely new developing in LINUX kernel, and I'm having some problems in a new LINUX driver I'm developing. After I map NXP PWM registers using ioremap()/ioremap_nocache() and then I try to write to the register mappend my system hags/freeze. Could you please help me understanding what it is happening? My Driver is this: #include <linux/device.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/kthread.h> // for threads #include <linux/fs.h>

Get process list from kernel space in Linux

混江龙づ霸主 提交于 2020-01-23 02:01:48
问题 How can I get list of all pairs process_name -> process_pid (user space and kernel space) from kernel module? 回答1: In your kernel module, you can do something like this: rcu_read_lock(); for_each_process(g) { printk("%s --> %d\n", g->comm, task_tgid_vnr(g)); } rcu_read_unlock(); 来源: https://stackoverflow.com/questions/13340672/get-process-list-from-kernel-space-in-linux

Missing flow control data (0x13) from reading device data stream

青春壹個敷衍的年華 提交于 2020-01-14 03:40:08
问题 I have written a Linux app to read & write binary data to a remote device over a USB port that is emulating a serial port. When I read data from the device, I have a USB sniffer that shows a binary data stream like this (0x01, 0x0A......0x13), but when my program reads the bytes, the 0x13 is not in the byte stream - this is the XOFF char, but I am not using XON/XOFF flow control (I think). Tried both open read and write, as well as fopen fread and fwrite in binary mode, same result. Any ideas

create device mapper target

主宰稳场 提交于 2020-01-12 05:40:06
问题 I am trying to implement device mapper target by referring to the already existing ones dm-linear, dm-snapshot, dm-cache etc. In my implementation, I need to perform a read/modify/write operation on a certain sector range. Since the device mapper directly talks to the block layer, I am not sure what data structures/functions to use to read the sectors in the memory, modify the buffer and write it back to another sector range. At the application level, we have syscalls and below we have vfs

Difference between dts and ACPI

时光毁灭记忆、已成空白 提交于 2020-01-12 05:17:45
问题 We can declare platform device information in dts file, rather than hard coding every data into operating system. Taking "arm" architecture as example. it supports dts and we will take dts from arch/arm/boot/dts/xx.dts. Convert this xx.dts into xx.dtb and loaded with kernel Image. I recently came across ACPI, when i came across x86 architecture, from the documents, what i understood is ACPI is similar to device tree. We can declare platform device information information in ACPI tables, my

Learning Kernel Programming [closed]

本秂侑毒 提交于 2020-01-10 06:14:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to learn lLinux Kernel programming. What would be the starting points for that? What could be some of the simpler problems to target? 回答1: Try to get hold of Robert Love's book on Linux Kernel Programming. Its very concise and easy to follow. After that or along with that, you may want to take a look at

What is the Linux built-in driver load order?

自作多情 提交于 2020-01-09 13:18:07
问题 How can we customize the built-in driver load order (to make some built-in driver module load first, and the dependent module load later)? 回答1: Built-in drivers wont be loaded , hence built-in. Their initialization functions are called and the drivers are activated when kernel sets up itself. These init functions are called in init/main.c::do_initcalls() . All init calls are classified in levels, which are defined in initcall_levels and include/linux/init.h These levels are actuall symbols

What is the Linux built-in driver load order?

て烟熏妆下的殇ゞ 提交于 2020-01-09 13:16:55
问题 How can we customize the built-in driver load order (to make some built-in driver module load first, and the dependent module load later)? 回答1: Built-in drivers wont be loaded , hence built-in. Their initialization functions are called and the drivers are activated when kernel sets up itself. These init functions are called in init/main.c::do_initcalls() . All init calls are classified in levels, which are defined in initcall_levels and include/linux/init.h These levels are actuall symbols

What is the Linux built-in driver load order?

懵懂的女人 提交于 2020-01-09 13:15:45
问题 How can we customize the built-in driver load order (to make some built-in driver module load first, and the dependent module load later)? 回答1: Built-in drivers wont be loaded , hence built-in. Their initialization functions are called and the drivers are activated when kernel sets up itself. These init functions are called in init/main.c::do_initcalls() . All init calls are classified in levels, which are defined in initcall_levels and include/linux/init.h These levels are actuall symbols