xv6, Deep Dive — Part 1

Balemarthy Vamsi Krishna
2 min readMar 21, 2023

--

Photo from Canva Pro

Ever since I graduated from bare metal programming and learned the presence of operating systems, especially GNU/Linux I became quite interested in understanding it.

But I was very limited those times in terms my resources and understanding. Formally not learning computer science related subjects somehow made me fear the subject Operating Systems. The courses I took those days on GNU/Linux did not really help me. One good thing that it did was to make to feel comfortable with the usage of shell.

I also understood that there is something called as shell scripting, system calls, processes. It gave little foothold and then I slowly started reading about operating systems. After 3 months of effort, I had decent understanding of the concepts of OS. But my initial itch of knowing what is behind did not die. As they say, old habits die hard. Why this itch has developed has only one reason. Until that time, I was doing bare-metal programming and there was no abstraction.

Universe responded to my desire, and I came to know about this wonderful, well written and freely available Unix like operating system, xv6.

I downloaded the documents that pertain to it and got them printed. The aspect of having the source code available as document was a great experience. Along with that the xv6 manual was so well written that I can see that the theory I read from the textbook appearing before me.

It was exactly at that time one of my friends also showed interest in doing a deep dive using GNU/Linux code. After much deliberation, arguments and mutual agreement we both decided to perform the deep dive of xv6, understand the things at simpler level and then graduate to an advanced code base like GNU/Linux.

My series of articles are the outcomes of those discussions and fruitful brainstorming sessions.

This is the format I would be mostly following from the subsequent writeup -

  1. A very brief introduction to one of operating systems concepts or aspect.
  2. Source code of the same that is present in xv6.
  3. Elaborate explanation of that source code as next pieces.

Since a particular topic/code can be either big or small, the number of posts that sufficiently covers a topic can span more than one article.

Here is the list of links that will follow.

xv6 github source link:

GitHub — mit-pdos/xv6-public: xv6 OS

MIT links about xv6:

Xv6, a simple Unix-like teaching operating system (mit.edu)

6.1810 / Fall 2022 (mit.edu)

The documentation of the source code that I actually I have is bit old. Nevertheless, I noticed that not much at the basic level has changed between the code link below and my document.

Let us meet again, all 3 of us. You the reader, me and xv6 code.

Till then “auf wiedersehen”

--

--

Balemarthy Vamsi Krishna

Early career embedded software mentor. Talks and writes about interviews, resume building, technical branding, growth and hike