Since around 2003, growth in CPU clock speeds has stagnated. The speeds have remained roughly between 3GHz and 4GHz over the past 17 years. In decades leading up to 2003, however, the CPU clock speeds had almost been doubling every two years. The main reason for the slowdown is that too much heat would be More
System call table is an array of function pointers. It is defined in kernel space as variable sys_call_table and it contains pointers to functions which implement system calls. Index of each function pointer in the array is the system call number for that syscall. These are denoted by NR_* macros in header files, such as More
Kernel symbols are names of functions and variables. Global symbols are those which are available outside the file they are declared in. Global symbols in the Linux kernel currently running on a system are available through `/proc/kallsyms` file. This includes symbols defined inside kernel modules currently loaded. Global symbols are of two types: those explicitly More
In higher level languages like Java and C#, one can recover from unexpected bahaviour using try/catch like language constructs. Things are different inside Linux kernel. The code is considered trusted and reliable. Faults and exceptions have severe penalities. For example, division by zero will likely cause a kernel oops and the whole system to hang. So how would you run some code which you know…
VT-x is name of CPU virtualisation technology by Intel. KVM is component of Linux kernel which makes use of VT-x. And QEMU is a user-space application which allows users to create virtual machines. QEMU makes use of KVM to achieve efficient virtualisation. In this article we will talk about how these three technologies work together. More
When we switch on a computer, it goes through a series of steps before it is able to load the operating system. In this post we will see how a typical x86 processor boots. This is a very complex and involved process. We will only present a basic overall structure. Also what path is actually More
Typically, sockets are classified along two orthogonal dimensions: domain and type. This is reflected in the system call used to create a socket int socket(int domain, int type, int protocol) In typical IPC, protocol is usually zero. Domain: Domain means two things: range of communication (e.g. on same host or between two remote hosts) address More
Our last post left the story of paging in Linux on x86 incomplete. Today we will cover that. This is a vast topic whose tentacles go far and wide into almost all aspects of the kernel. So we will cover only some interesting highlights. Our focus is on x86 without Physical Address Extension (PAE) enabled. More
In our last post we covered how x86 logical address is translated into linear address. In this one we will look at translation from linear to physical. We will use the terms virtual address and linear address interchangeably. A piece of hardware called paging unit is responsible for converting virtual addresses to physical. However, the More
Background: Address space segmentation basically means dividing all possible virtual addresses into groups segments and applying some properties on those segments, e.g. privilege level required to access them. Segmentation applies to virtual addresses so it comes into play before virtual-to-physical address translation takes place. In x86, segmentation is a relic from past. 286 More