How the Linux Kernel Detects PCI Devices and Pairs Them with Their Drivers

Have you ever wondered how Linux knows what PCI devices are plugged in? How does Linux know what driver to associate with the device when it detects it? In short, here's what happens: During the kernel's init process (init/main.c), various subsystems are brought up according to their "init levels." Among these early subsystems are the … Continue reading How the Linux Kernel Detects PCI Devices and Pairs Them with Their Drivers

Lessons Learned From an Open Source Capstone Project

The last term of my undergraduate Computer Science degree is almost over. Yay! My software engineering capstone project also comes to an academic close in a matter of days and I wanted to take a moment to reflect on some of the key lessons that I’ve learned from this entire process. For the uninitiated, Computer … Continue reading Lessons Learned From an Open Source Capstone Project

Macromancer’s Spellbook: Using Macros to Stay DRY

It is sometimes hard to see past the thick haze of caution surrounding the use of C Preprocessor macros in your code. Indeed, the dangers of Macromancy are well-stated in many corners of the internet. You would do well to heed them. However, there are times where a judicious use of macros can help reduce duplication in … Continue reading Macromancer’s Spellbook: Using Macros to Stay DRY

How to Implement a Grid Movement Mechanic for Your Tile-based Game

"Hey, you! You're sliding all over the place! STOP! ", you project your thoughts violently at the character sliding around your screen, getting caught on the corner of tiles, other objects, your pride. You stand up out of your computer chair with a sigh, dreaming about the grid movement mechanics in old-school Pokemon and Zelda … Continue reading How to Implement a Grid Movement Mechanic for Your Tile-based Game

Pass by Reference vs Pass by Value in C++

I work in an undergraduate T.A. role for a computer science sequence that teaches students programming concepts and data structures in C++. In each course, students have to take a proficiency demo -- a closed book, closed notes, live coding exam where they must solve a technical interview-flavored question with a given data structure. For … Continue reading Pass by Reference vs Pass by Value in C++