Linux Kernel Development using KVM

I am back to doing some kernel hacking. I am building my kernel as I write this post. Every time I try to build a kernel, I have to setup the whole environment again which requires a bunch of google searches and skimming a bunch of tutorials. I am writing this post to consolidate all of that so that the next time I pick this up, I don’t have to search everywhere. [Read More]

Better Search in Vim

I find that I searching in Vim is broken. For example, when searching for a variable in my code, I often have no context where the next variable is. Sure, I can use n to go to the next match but I dont’t get an overall picture of how and where that variable is being used in my file. Also, I cannot easily jump from one position to another without cycling through all of them. [Read More]

Limiting I/O bandwidth on docker

When you create a docker container, by default, I/O on it is unlimited. For my project I needed to create docker containers with limited I/O bandwidth but docker does not provide I/O limits out of the box like cpu (--cpuset and --cpu-shares) or memory (--memory) limits. However, the kernel provides blkio cgroup subsytem which can be used to limit I/O on a block device. I created this script which limits I/O bandwidth on containers. [Read More]

Creating an LXC container from a tarball

I recently wanted to create LXC containers on multiple hosts using a standard rootfs. My idea was to install all my apps on one container, tar it up and use it everywhere. As I was working on implementing this, I found that LXC does not provide an option to create a container using a tarball as the rootfs. After a bit of googling I found this script from saltstack which lets you create a container from a tarball. [Read More]

Adressing in Real Mode in x86

I am planning to write a bunch of posts about memory and x86 architecture and virtualization. This is the first post among hopefully many which will deep dive into the x86 architecture. In this post I will cover about the real mode which is the default mode that x86 runs in when it boots up. This was the default mode before intel introduced paging in the 80286. In real mode, all registers are 16 bits and the processor can adress upto 20-bits of address space giving \( 2^{20} -1 \approx 1M \) addressable bytes. [Read More]