System Programming
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 […]
MIPS R2000 is a RISC processor. Its ISA has fixed-width 32 bit instructions and fall into one of the following three categories: R-type, I-type, and J-type All the Instructions — can also be grouped under following functional groups. Arithmetic Instructions: +, -, *, / operations on std data-structures (short, int, long, float) Logical Instructions: AND, OR, […]
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. […]
OS development over time We all know that kernel is the core part of any OS. It is the set of code running in privileged mode (kernel mode or Ring3 security level). Operating Systems can be classified based on the architecture of their kernel as below: Monolithic kernel OS This is the old style of […]
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 […]
Everyone of us are familiar with RAM (Random Access Memory), this post is an attempt to explore the different types of RAM and how they store the data. We typically have 2 types of RAM SRAM (Static RAM) DRAM (Dynamic RAM) SDRAM (Synchronous DRAM) — is simply DRAM, which is synchronized with System Bus (newer […]
OOPS — Abstraction One of the core concept in object oriented paradigm is ‘Abstraction’. As most of us know Abstraction is nothing but hiding complete technical details (how its implemented or working) from the user (client code using the system/object/module) and exposing only necessary details for interacting with system/object/module. Static Function & Variables I guess […]
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 […]
System calls are used by user programs in order get service from the operating system. Some of the popular system calls are we normally use are open, read, write, close, wait, exec, fork, exit, and kill. There are usually 100’s of system call available in OS. For example, Linux has 300+ system calls. Why we […]