Mohsen's Avatar

Learning Operating System

My journey learning about operating systems following the book Operating Systems Three Easy Pieces


Let's Go!

June 26, 2026

Computer Science is a wide and expansive field, and frankly, I don’t know which nook I want to fit myself in yet. In this light, I want to dip my toes into many different fields and explore my interests.

So, over the summer, I’ve decided to study operating systems! This is a course I want to take, but it isn’t in the track I’m on at university.

what I’ll do:

If any other undergrads want to join me, I’ld be delighted to have an accountability buddy and someone to talk to!

Welcome to the Kernel!

May 29, 2026

When first imagining learning operating systems, I invisioned something a bit close to Linux administration. I was wrong.

Reading the first few chapters of the book, it exclusively discusses kernal level concepts such as process scheduling and virtualization. This is an unfamiliar spot for me definitely.

I’m not taken aback though; I’m still interested in the topic. It’s like the content made by the core dumped YouTube channel which I highly recommend. The info provided by their videos was very helpful while reading the book and eased my understanding.

How fast is a system call?

May 29, 2026

The first homework I encountered in the book was measuring the time taken by a system call, and it was an adventure. You can see the code for that here.

This is an experiment, so it helps to think like a scientist here.

The syscall I chose was getpid because there is no I/O associated with it. To measure the time, I initially used gettimeofday which I later replaced with a RDTSC x86 assembly instruction to minimise overhead. The limitations of this setup are explained better in the files of the folder shared above.

I measured 2µs, which is an order of magnitude more than the expected. I believe this is the side affect of CPU scheduling: my C program is not the only one running on my system, hence the actual time spent executing the syscall is not the same as the time taken for its completion. I was measuring the latter.

To get more accurate results, I might have to configure a system (not my desktop) to run my test program exclusively until completion. This means getpid would be the only thing that runs once it is called until it is finshed (more or less).

I enjoyed going on this scientific side quest. Trying to figure out the speed of a syscall was an approachable way to apply the scientific method, which is fun.