How initrd is mounted by Linux kernel ?

Lets first try to understand what are the ways to mount the root file system, Altough the documentation from Documentation/early-userspace/README inside kernel source code is bit outdated, it is still has valid information as below, The kernel has currently 3 ways to mount the root filesystem: a) all required device and filesystem drivers compiled into … Read more

Kernel startup entry point / how Linux kernel boots ?

We will consider our hardware platform as ARM, so the kernel startup entry point code is at arch/arm/kernel/head.S This is normally called from the decompressor code. The requirementsare: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,r1 = machine nr, r2 = atags or dtb pointer. This code is mostly position … Read more

Understanding Linux Device Tree Syntax (DTS)

DTB = Devicetree blob. Compact binary representation of the devicetree.DTC = Devicetree compiler. An open source tool used to create DTB files from DTS files.DTS = Devicetree syntax. A textual representation of a devicetree consumed by the DTC. See Appendix A Devicetree Source Format (version 1) A boot program (bootloader) loads a devicetree into a … Read more

How to Join Linux kernel mailing lists (LKML) ?

LKML https://lkml.org/ is an unofficial Linux Kernel Mailing List archive. This mailing list is a rather high-volume list, where (technical) discussions on the design of, and bugs in the Linux kernel take place. You can read more information about it at http://vger.kernel.org/lkml/ How to join Linux kernel mailing lists ? Linux kernel has different mailing … Read more

How to Compile and Install device-tree-compiler (DTC) On Ubuntu ?

If you want to install device-tree-compiler i.e. dtc command on Ubuntu, use following command, This command will install two command “dtc” and “dtdiff” of which dtc is a device tree compiler whereas dtdiff helps to take diff between two device tree source files. The source code of DTC is available at https://git.kernel.org/pub/scm/utils/dtc/dtc.git . You can … Read more

How to compile DTS to DTB from Linux kernel and manually ?

Lets say, you have been trying to compile Linux kernel source code for Raspberry Pi following steps from “Cross Compilation and Booting of Linux kernel for Raspberry Pi3 – Manual Compilation” although most of the steps remains same in general for other ARM architectures as well , so just replace Raspberry Pi name with your … Read more

What is Linux Out-Of-Memory OOM Killer ?

Major distribution kernels set the default value of /proc/sys/vm/overcommit_memory to zero, which means that processes can request more memory than is currently free in the system. This is done based on the heuristics that allocated memory is not used immediately, and that processes, over their lifetime, also do not use all of the memory they … Read more

How to avoid a process from being killed in case of Out of Memory ?

In our previous post, we understood “What is Out of Memory Killer ?” In this post, we tries to demonstrate how we can avoid certain process being got killed in case of OOM killer is activated due to low memory situations. How to Control which process to avoid getting Killed ? Users and system administrators … Read more

insmod: ERROR: could not insert module hello.ko

We tried to write a simple class driver framework which will create a directory in /sys/class, we were able to compile the code but got the following error while trying to install the driver as, Solution : The function __class_create is exported only for GPL modules (exported with EXPORT_SYMBOL_GPL). So, you need to use a … Read more