In this post, I am going to talk about logical and physical addressing of main memory (DRAM) in computer systems. Logical addresses are also known as virtual addresses. In fact, I would refer to them logical aka virtual aka unreal addresses. Yes, as the name suggests, logical addresses are unreal addresses. These are not the... Continue Reading →
Difference between Page table and Inverted Page table
A page table is maintained by the operating system on a per process basis. Every process has its own page table, and that is why we do not need to store any process identifier(s) in the page table. Page table maps a given logical/virtual page number to actual physical frame/page address. The logical address for a... Continue Reading →
Paging v/s Swapping
Swapping is the procedure of copying out the entire process(its address space) from main memory to some sort of secondary storage(typically hard disk or tape storage). Usually this is done as a result of CPU scheduling. Operating System typically maintains a read-to-run queue of processes. The queue comprises of information about processes that are ready... Continue Reading →
Traditional Unix Inode Block Map
I had written this answer for a number of related questions on Quora. I think the topic is worth a small article. An inode for a file maintains the complete information about physical layout of file data. This information is stored in the form of a multi-level block map. Taking the example of a Unix... Continue Reading →
Call Stack Internals (Part 1)
In this post, I will be discussing the internal working of a function call stack. The content will be divided into multiple posts for better understanding. Major focus will be on the following: Creation of stack frames, Saving/restoring registers to/from the stack. Saving function local variables, arguments, and return address on the stack. Usage and... Continue Reading →
How does the free() function work?
[Sharing my answer to the above question on quora] Assuming the reader is interested in knowing the internal details of free(), I would like to explain in one of the ways I implemented it. Overall, a free() function releases a chunk of dynamically allocated memory from the heap region of the process address space. It... Continue Reading →