QuickSort: Partition an Array into Sub-array

We already know we have to divide an array into two sub-array for quicksort algorithm. Here I’ll describe how this partitioning actually works. If you want to know about how quicksort works, follow my other post on quicksort working principle. I followed Introduction to Algorithms, 3rd Edition (MIT Press) for writing this tutorial. Continue reading “QuickSort: Partition an Array into Sub-array”

QuickSort Algorithm Working Principle

QuickSort is the most elegant sorting algorithm with an average case time complexity of O(nlogn). The main idea behind quick sort is divide and conquer. I’ll try to explain how this divide and conquer strategy works for quick sort. This writing is a gist from Introduction to Algorithms, 3rd Edition (MIT Press), a cool book for algorithm enthusiasts. Continue reading “QuickSort Algorithm Working Principle”

Configure QEMU Bridge Network in Ubuntu 14.04

This writing will provide an easy to follow, step by step guide to configure a QEMU  Bridge Network in Ubuntu 14.04 host machine. Though I’ve done it in Ubuntu 14.04 machine, I believe it’ll also work on Ubuntu 12.04.

By default, QEMU VM uses user networking which allows the VM to Continue reading “Configure QEMU Bridge Network in Ubuntu 14.04”

Testing Slob Allocator

Linux Kernel hast three memory allocator named SLOB, SLAB and SLUB. SLOB allocator is the memory allocator that is used to allocate small amount of memory for Linux kernel objects. Linux kernel objects are different from user mode objects. So we can’t use a user mode application for testing SLOB allocator. For example, if we modify the algorithm used in SLOB allocator, we have to test it using some kernel module which can make memory request to our new SLOB allocator. Continue reading “Testing Slob Allocator”

Writing Linux Kernel Module

Writing Linux kernel module is a daunting task. This easy to follow, step by step guide will show us all the steps of writing Linux kernel module. Read this writing to learn about what is a kernel module.

This tutorial will be our starting point for writing Linux kernel module. For this one we won’t be using any real hardware. But gradually we’ll learn how to write a device driver for an actual hardware. Our approach will start from learning most basic module to advanced device driver. Continue reading “Writing Linux Kernel Module”

Linux Kernel Module

Kernel module is a piece of program which can be loaded or unloaded in the kernel dynamically. It is used to extend the functionality of the kernel without rebooting the system. When we attach a new hardware in our computer we have to install a device driver for it. Device driver is a kernel module which allows the kernel to communicate with the hardware device. Continue reading “Linux Kernel Module”