Linux
What is the Apache access log : The Apache access log is a file that records detailed information about each request made to an Apache HTTP Server. This log file is useful for monitoring server performance, troubleshooting errors, and identifying potential security issues. The format of the log file is configurable and can include information […]
When I started software development, my biggest concern was the source control system. There needs to be more detailed documentation, and senior developers in your team expect you to know this by default. They take it for granted. I started with VSS, SVN, ClearCase, PVCS, and git. It has been git for a while now […]
Compiling driver: As discussed earlier a Linux loadable kernel module (LKM) is different from other binary executables. Hence, it cannot be compiled the way we compile normal C files. Compiling a Linux module is a separate process. We use the help of kernel Makefile for compilation. The makefile we will have contents as given below. When you […]
In the previous posts we discussed about what are device drivers and how to create one, load them into linux kernel and test them. In this post we will discuss about what to be implemented in a device driver. Core function for device drivers: An important structure in any device driver is the file_operations. It holds the pointers […]
Compile & Boot Linux from source code It becomes absolutely necessary for a Kernel Hacker (Linux) to compile various kernel sources and boot them for either taking traces or testing a modification for a kernel module. Although there are lot of blogs talk about this compile and booting, I found the following resource useful (http://www.wikihow.com/Compile-the-Linux-Kernel). […]
Most of us know about design patterns. But let me give the crux of — what a design pattern is? before getting into the topic. Design Patterns are the set of solution to typical and most commonly occurring problems in designing software program. They are mostly related to object orient design but not restricted to OOD. […]
What is RCU? Read-Copy-Update(RCU) is way of implementing wait-free synchronization between multiple processes/threads (alternative to lock mechanism). It works well in multiple reader and writer scenarios (especially ready heavy scenario). The key idea in RCU is doing a write/update operation in 2 steps namely ‘removal’ and ‘reclaim’.In step 1 (removal step), we have to remove references to […]
Let us try to create a toy system call to do add operation, which takes 2 arguments and return their added value. Following are the steps in adding a new system call to Linux Kernel: Step 1: Unzip and untar the latest Linux kernel source (https://www.kernel.org currently 3.14 is the stable version) into /usr/src/ directory. Step […]
What is a device driver? Device driver is simply a program which executes in kernel mode (unrestricted mode) interacting directly with hardware of the corresponding device. In the previous post we discussed about the different modes (restricted and unrestricted) of operation. They mainly do all the talking/interaction with raw hardware as part OS. Why we need them? […]
As we all know that CPU (micro-processor) executes all the instructions. Most of the modern architectures support at least 2 modes of CPU operation. Even if architecture supports more than 2 modes, they are usually grouped under 2 modes to have compatibility (of OS — across all machines). Mode 1 — Every operation possible is allowed […]