Virtual Serial Connection Between Two QEMU VM

If you are a Linux user for your most of the research work and you come upon the task of debugging Windows kernel, but don’t want to switch to a Windows platform for that, QEMU can help you. We can create a virtual serial connection between two QEMU VM. One VM acts as the debugger and the other as debugee, and the virtual connection between them act as the communication channel. Continue reading “Virtual Serial Connection Between Two QEMU VM”

Kernel Debugging Using GDB & QEMU

The effect of a bug in the kernel is catastrophic and may lead to system crash. Kernel debugging is an important step for kernel developers to find out bugs or debugging kernel execution. Many developers use virtual machine while working on kernel level. QEMU is a famous virtualization tool among the kernel developers. In this tutorial we’ll learn kernel debugging using GDB and QEMU. We’ll use QEMU to run our guest kernel(the one to debug) and in the host machine we’ll run GDB which will connect to QEMU. I’ll use 32-bit Ubuntu-12.04 kernel in this tutorial. Continue reading “Kernel Debugging Using GDB & QEMU”

Writing Char Device Driver Part 2

This is the second part of our char device driver development tutorial. In part1, we learnt how to write a simple char device driver that supports read or write functions. We dynamically assigned a major number for our driver and using the assigned major, we manually created a device file in /dev directory. Continue reading “Writing Char Device Driver Part 2”

Writing Char Device Driver Part 1

In this post we’ll take our 1st step of writing a char device driver for Linux. In our previous post, which I would recommend you to read unless you already did, we created a very simple kernel module. Other than dumping some log message, it didn’t do anything fancy. In this post we’ll create a char device driver which creates a device file in /dev directory. We’ll also show how a user space program can read from or write to this device file. And finally we’ll modify it to reverse a string. We’ll name our device driver as “reversedev“. I also assume, by now you know how to compile and install a kernel module and how to test kernel log using dmesg command. If you don’t you definitely need to read this. Continue reading “Writing Char Device Driver Part 1”

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”