How to Compile Linux Kernel Module

Linux has a build infrastructure called “kbuild” to build in-tree and out-of-tree kernel modules. Here I’ll focus on external or out-of-tree kernel module compilation. Linux “kbuild” infrastructure is fairly complicated, better not to go into that. Here we’ll see how to create a Makefile to compile one or more source files into an external kernel … Continue reading “How to Compile Linux Kernel Module”

Linux Kernel Programming Basics, Create Loadable Kernel Module

What is Linux Kernel? Kernel is the core and central part of the Linux Operating system. It is responsible for the most critical functions of the operating system like process scheduling, memory management, file system management, device handling, networking, interrupt handing etc. It runs on a restricted part of the physical memory, known as Kernel … Continue reading “Linux Kernel Programming Basics, Create Loadable Kernel Module”

Why Function Pointers are Used in C

During program execution, we know that variables are stored in the physical memory (RAM) in the process’ address space. One variable can be stored in multiple bytes. The address of the first byte is called the pointer of the variable. This pointer can be assigned to another (pointer type) variable. The original variable can be … Continue reading “Why Function Pointers are Used in C”

Where to Use Call by Reference in C

If you compare two parameter passing mechanisms, Call by Value and Call by Reference, in C programming language, Call by Value is much simpler in syntax and easy to understand. Then why should we use Call by Reference? Here we will try figure out what we can do with Call by Reference but can not do … Continue reading “Where to Use Call by Reference in C”

How Call by Value and Call by Reference Work in C

We can not imagine C programming without function calls. When we call function, we pass information from the caller function to the called function by passing one or more parameters. When it comes to the parameter passing to a C function, there are two mechanisms, Call by Value and Call by Reference. You might already … Continue reading “How Call by Value and Call by Reference Work in C”