Logical And Physical Addresses in Operating System

 So, we must be aware about addresses, right? An address is just a way to remember where something resides. Just like we have our addresses, and if we want to visit our friend's house then we need to know their house address, just like that, in a pc also every little piece of information has an address associated to it. 

Now, who requires these addresses? The Operating System, bcz that's the one who deals with the process management stuff and also deals the memory management part, as it is the Operating System, it manages the operating of the Computer. Now... if we would notice then while programming we come across the pointers stuff, we know that pointers store the address of other variables so we can access those variables and that kind of stuff, now the thing is that, the address that we come across while programming is not the real addresses, they are the virtual addresses. Yes, you read that correctly, hasn't this happened with you, that you accessed some restricted part of memory and thought you are too smart that you accessed memory which doesn't belong to you, then remember that the people who designed the working of a computer were maybe little smarter than you :) They took care of this, bcz the address you are seeing is not the real address, it's just a Virtual Address or it is also known as the Logical Address.

Now, that we have taken a basic overview of this Logical Address stuff, let's come to some imp points to remember about it:-

1) A Logical Address is generated by the CPU. 

2) Users can view it.

3) Users can also change the Logical Address.

4) It doesn't exist physically, and so it is also known as the Virtual Address.

5) This address is used by the MMU(Memory Management Unit) to get the Physical                 Address, corresponding to the specific Logical Address.

Now, that we have covered the Logical Address it will be quite easy to understand the concept of Physical Address. The Physical Address unlike the Logical Address cannot be changed by the User, also they cannot be viewed by the User, and the User also cannot directly access the Physical Addresses. The user can only access the Physical Address by the help of the Logical Address that is mapped to it by the MMU, so we can access the Physical Address indirectly using the Logical Address. Basically the user is not given the authority to directly touch the Physical Addresses and rather than that, the user can indirectly access the Logical Addresses of any process or anything that is stored in Memory.

I studied this Concept I think two days ago, and I have decided that whichever topic I will be studying, I will give a description of it or try to explain it in a clear way after 2 days.

It's 11:16 p.m. while I am posting this, I have finished most of the work for the day, I had a Python Practical Today, which went just like I had expected it to be, although some of the questions were bit unexpected, but I had covered them so it wasn't a big deal for me, overall it was a fruitful day, and after this I have an OS gfg article to cover and then I have decided to watch a movie, most probably "Fall". 

Mostly, nowadays I will be covering OS stuff because I have just finished a playlist of OS and I am trying to deep dive into this topic and explore more stuffs in this particular domain so that I can get a perfect view of the Topics, I mean I should see the Physical Address and not the Logical Address... :)

Peace!

Comments

Popular Posts