This is a complex topic that involves a lot of low-level understanding of the kernel and C. If I've made any mistakes, feel free to put them here or amend the article.
-Null