linux-device-driver

Why does module failed to load? (/dev/scull0 : no such device or address)

99封情书 提交于 2020-06-08 19:50:25
问题 From my previous question: How to build external modules in ubuntu? I thought I cannot load module due to loading out-of-tree or tainting kernel , but to my scull_init_module (source below) I have added printk so I know I get loaded from kern log. But I did not (no output in the log -- the log is the same as from the link). uname -a == 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux (no use of ubuntu - as from the link). scull_init_module : #ifndef scull_major #define

What is the need of having both System.map file and /proc/kallsyms?

僤鯓⒐⒋嵵緔 提交于 2020-05-10 10:27:12
问题 I just want to know the difference between System.map file and /proc/kallsyms . I am using Linux 3.16 generic kernel. I know that both are the kernel symbol table.. When I did a compare on this files, both are having the same content. So what is the need of having both? 回答1: /proc/kallsysms have symbols of dynamically loaded modules as well static code and system.map is symbol tables of only static code. You can not be really sure if system.map will be available on your system. When kernel

how sys_open works?

孤街醉人 提交于 2020-05-08 17:55:19
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

how sys_open works?

允我心安 提交于 2020-05-08 17:49:59
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

how sys_open works?

偶尔善良 提交于 2020-05-08 17:49:06
问题 I have write a simple char device driver (mydev) with "open" file operation in it. In user space application I open this driver node. using open("/dev/mydev", O_RDONLY); The open() system call internally calls the sys_open(). I just want to know the follow of how sys_open() function call my driver's open file operation. How VFS handles this, which function it internally calls. 回答1: I found the answer in Understanding Linux Kernel book, at section 12.5.1 Steps are, Invokes getname( ) to read

Which processor would execute hardware interrupt in a muticore system

こ雲淡風輕ζ 提交于 2020-03-18 09:13:45
问题 In general hardware interrupts need to be processed immediately, at least so as to acknowledge it and do some first level of processing. As I understand this is not scheduled activity. Please correct me. So the question is how to choose a processor that would actually execute this hardware interrupt handler? One can answer this for Linux and/or BSD systems 回答1: In general, this depends on the functionality offered by multi-core processor and OS. While using multi-core processors, you might

running multiple instances of a same interrupt parallely on an SMP system

不羁岁月 提交于 2020-03-06 06:58:06
问题 Is it possible to run multiple instances of a same interrupt simultaneously on a multi processor system in linux? If not possible, why do we need to synchronize between interrupt handlers using spin locks? Thanks Venkatesh 回答1: On a SMP architecture Advanced Programmable Interrupt Controller( APIC ) is used to route the interrupts from peripherals to the CPU's. the APIC, based on 1. the routing table (where interrupt affinity is set to a particular processor), 2. priority of the interrupt, 3.

how to bind thermal sensor with cooling device using lookup table in code

我只是一个虾纸丫 提交于 2020-03-05 04:34:26
问题 i want to bind thermal sensor with cooling device ( fan ) using lookup table. I know how to do it using DTs ( device tree) but never worked using lookup table in code for same. I need help on how to do same on code using lookup table what we use to do using device tree. for example thermal-zones { cpu_thermal: cpu-thermal { polling-delay-passive = <250>; /* milliseconds */ polling-delay = <1000>; /* milliseconds */ thermal-sensors = <&bandgap0>; trips { cpu_alert0: cpu-alert0 { temperature =

how to bind thermal sensor with cooling device using lookup table in code

99封情书 提交于 2020-03-05 04:34:14
问题 i want to bind thermal sensor with cooling device ( fan ) using lookup table. I know how to do it using DTs ( device tree) but never worked using lookup table in code for same. I need help on how to do same on code using lookup table what we use to do using device tree. for example thermal-zones { cpu_thermal: cpu-thermal { polling-delay-passive = <250>; /* milliseconds */ polling-delay = <1000>; /* milliseconds */ thermal-sensors = <&bandgap0>; trips { cpu_alert0: cpu-alert0 { temperature =

gcc — __attribute__((interrupt( irq )))

元气小坏坏 提交于 2020-02-29 00:04:44
问题 i started with device driver for arm ... there i saw for each handler mention --- __attribute__((interrupt( irq ))) -.I am confused how this attribute will place a call to our driver routine ..?? IRQ of arm have following Vector address--- 0x00000018 (or 0xFFFF0018) As there can be many interrupt handler on same line. Suppose if we have 4 device driver each with its own IRQ to be reistered. Means some startup code will be provided by the GCC compiler for the IRQ handler & compiler will place