Understanding Linux Kernel Version Numbering

The main Linux kernel versions comes from the Linux Torvald who is author of Linux kernel, from his git at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ , we can clone this kernel as, First 5 lines from the top level Makefile in Linux kernel contains information/variables about the Linux kernel versions. VERSION = 4PATCHLEVEL = 9SUBLEVEL = 45EXTRAVERSION =NAME = … Read more

How to recreate dts file from a running Android device ?

As we have seen in “How to cross compile static dtc for ARM” we are able to get the DTC cross compiled statically which we will push to the embedded target which exposes the device tree from proc file system. Using this statically compiled dtc, we will reverse engineer to create human readable DTS file … Read more

How to recreate dts file from live Embedded device ?

Sometimes it happens that you don’t have source code of the device on which you are working but want to know some kernel configurations or peripheral mappings etc in those case’s Linux kernel provides good insight through /proc filesystem. In this post also, we will try to showcase how you can regenerate dts file from … Read more

How to cross compile static dtc for ARM ?

As we seen in our previous post, “How to Compile and Install device-tree-compiler (DTC) On Ubuntu”, we could compile DTC ( Device Tree Compiler ) for Host machine i.e. Ubuntu In this post, we will describe what changes are required to get the DTC compiled to execute on embedded targets such as ARM. Since executing … Read more

What is the difference between setup_irq and request_irq in Linux kernel interrupts ?

Timers are setup very early, before the request_irq() infrastructure has been initialised. Hence, setup_irq is used to initialises timer irqs, while normal drivers should use request_irq. setup_irq is defined in kernel/irq/manage.c as, whereas, request_irq is defined in include/linux/interrupt.h as request_threaded_irq is defined in kernel/irq/manage.c as,

How to resolve error : dtc: command not found

When trying to compile uboot on Ubuntu, we seen the following error, From the error it looks like we are unable to find “dtc” command, which actually is a “device tree compiler” So, we need to install it on ubuntu as, Now, lets verify that dtc is now installed,

C program to read information from sysfs file in Linux

In this post, we will write a simple C program which can read any sysfs file from Linux and display the output to console. Above makefile is using GCC so it can be compiled for Desktop / Laptop but if you want to cross compile for some embedded target like ARM boards, you can export … Read more

Debug levels for Linux kernel PrintK

If you have already tried to write the first kernel module from port “Writing first Linux kernel Module and understanding Kernel module compilation, loading and unloading” , you might have seen that in Linux kernel we used “printk” whereas we use “printf” into the application programs. Application printf example, Whereas, same code if we want … Read more

Send and receive data from user space and kernel using Netlink sockets

As mentioned in Linux kernel souce code net/netlink/af_netlink.c, netlink is a Kernel-user communication protocol which allows user to send and receive data to Linux kernel using sockets as we do for other socket communication. Netlink is used to transfer information between the kernel and userspace processes. It consists of a standard sockets-based interface for user … Read more