linux-device-driver

Linux Device Drivers 3Ed File IO & How to Influence Scheduling with Explanatory UML Diagrams

落爺英雄遲暮 提交于 2019-12-24 05:11:39
问题 I've used UMLet to draw some UML diagrams describing various entity relationships for each of the chapters of Linux Device Drivers 3Ed (LDD3), by Corbet, Rubini, Kroah-Hartman. The latest version of the diagrams can be found here: Linux Device Drivers 3Ed UML Diagrams I would like to ask help understanding a scheduling problem which is supported by documentation in the Non-Blocking File IO Sequence Diagram(s) at the above link, and in LDD3 on P156-158, and in particular this code snippet from

unevictable page

柔情痞子 提交于 2019-12-24 03:51:27
问题 I getting a kernel crash as below. Here I can observe large memory is present in unevictablle page. I wish to know when exactly memory is added to unevictable page list. Also, from the below message I can understand only 1724kB is available in the system. is it correct? kswapd0: page allocation failure. order:0, mode:0xd0 [<c002aed4>] (unwind_backtrace+0x0/0xdc) from [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) from [<c008416c>] (cache

unevictable page

旧城冷巷雨未停 提交于 2019-12-24 03:51:12
问题 I getting a kernel crash as below. Here I can observe large memory is present in unevictablle page. I wish to know when exactly memory is added to unevictable page list. Also, from the below message I can understand only 1724kB is available in the system. is it correct? kswapd0: page allocation failure. order:0, mode:0xd0 [<c002aed4>] (unwind_backtrace+0x0/0xdc) from [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) from [<c008416c>] (cache

Accessing IRQ description array within a module and displaying action names

家住魔仙堡 提交于 2019-12-24 03:21:57
问题 I am programming a kernel module in C which is struggling to access IRQ description array elements and to display all action names of these elements. At the beginning, I thought that this irq_desc array is sonething like a macro but after compiling i understood it is not. Then I used for_each_irq_desc(irq, desc) function. but this time it returned a warning: WARNING: "irq_to_desc" [/home/samet/Masaüstü/Assignment3/Ass-1.ko] undefined! and after this warning, i tried to insmod the module into

Writing a device driver for Platform Bus in Embedded Systems?

送分小仙女□ 提交于 2019-12-24 02:09:28
问题 I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver. drivers/net/ethernet/smsc/smsc911x.c static struct platform_driver smc911x_driver = { .probe = smc911x_drv_probe, .remove = smc911x_drv_remove, .suspend = smc911x_drv_suspend, .resume = smc911x_drv_resume, .driver = { .name = CARDNAME, .owner = THIS_MODULE, }, }; Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are

Writing a device driver for Platform Bus in Embedded Systems?

こ雲淡風輕ζ 提交于 2019-12-24 02:08:56
问题 I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver. drivers/net/ethernet/smsc/smsc911x.c static struct platform_driver smc911x_driver = { .probe = smc911x_drv_probe, .remove = smc911x_drv_remove, .suspend = smc911x_drv_suspend, .resume = smc911x_drv_resume, .driver = { .name = CARDNAME, .owner = THIS_MODULE, }, }; Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are

Intel Processor : “If CPUID.06H:EAX.[7] = 1” Meaning?

冷暖自知 提交于 2019-12-24 01:26:06
问题 What does the below comment mean in Intel Processor data sheet? How can I check that in my driver's code in Linux? If CPUID.06H:EAX.[7] = 1 I come across this type of statements in the SW developer's manual for Intel Processors in the comments column in register description table.. Ref: https://software.intel.com/sites/default/files/managed/22/0d/335592-sdm-vol-4.pdf Please help me to understand the processor descriptions. Thanks. 回答1: CPUID.06H:EAX.[7] enables the discovery of the HWP

Link between low level drivers and tty drivers

二次信任 提交于 2019-12-23 15:19:37
问题 I was writing a console driver for linux and I came across the tty interface that I need to set up for this driver. I got confused as to how tty drivers are bound with low-level drivers. Many times the root file system already contains a lot of tty devices. I am wondering how low-level devices can bind to one of the existing tty nodes on the root file system. For example, /dev/tty7 : Node on the root file system. How does a low-level device driver connect with this node? Or should that low

Which is the cleaner way to get a pointer to a struct device in linux?

亡梦爱人 提交于 2019-12-23 12:38:09
问题 i'd need to obtain a pointer to a particular device registered in linux. Briefly, this device represents a mii_bus object. The problem is that this device seems doesn't belong to a bus (its dev->bus is NULL ) so i can't use for example the function bus_for_each_dev . The device is however registered by the Open Firmware layer and i can see the relative of_device (which is the parent of the device i'm interested in) in /sys/bus/of_platform . My device is also registered in a class so i can

How existing kernel driver should be initialized as PCI memory-mapped?

做~自己de王妃 提交于 2019-12-23 06:04:30
问题 Existing kernel drivers such as xilinx have specific way to be registered (as tty device), if they are mapped directly to cpu memory map as done here with device tree: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842249/Uartlite+Driver But in other cases, there is a PCIe device (like FPGA which has the xilinx uart IPs) which is connected to and the cpu. How should we make the uart get registered when using PCIe device ? The device tree I try to register into PCIe is uartlite driver