What does request_mem_region() actually do and when it is needed?

request_mem_region tells the kernel that your driver is going to use this range of I/O addresses, which will prevent other drivers to make any overlapping call to the same region through request_mem_region. This mechanism does not do any kind of mapping, it’s a pure reservation mechanism, which relies on the fact that all kernel device … Read more

Difference between Kernel Virtual Address and Kernel Logical Address?

The Linux kernel maps most of the virtual address space that belongs to the kernel to perform 1:1 mapping with an offset of the first part of physical memory. (slightly less then for 1Gb for 32bit x86, can be different for other processors or configurations). For example, for kernel code on x86 address 0xc00000001 is … Read more

How to find out which Linux driver is hogging my GPIO

On the Boundary Devices kernel, and maybe others, you can use cat /sys/kernel/debug/gpio to get a list of the mapped gpios, their states, and name given when it was allocated. You can grep the kernel source for the name and find out what module grabbed it. root@nitrogen6x:/opt# cat /sys/kernel/debug/gpio GPIOs 0-31, platform/209c000.gpio, 209c000.gpio: gpio-2 (flexcan-trx-stby … Read more

What is the Linux built-in driver load order?

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 defined in linker script (arch/*/kernel/vmlinux.lds.*). At kernel … Read more

How do I intercept messages from a USB device on Linux?

Actually you missed a buzzword “USB sniffing“. 😉 Here are a few tutorials on USB sniffing on Linux, to get you started. Official Wireshark wiki for USB monitoring biot.com/blog/usb-sniffing-on-linux (InternetArchive) tjworld.net/wiki/Linux/Ubuntu/USBmonitoring Essentially you use the usbmon Linux kernel module to capture the USB-packets and Wireshark as a front-end to display and analyse the captured USB … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)