I know that Memory tables are used to keep track of main memory and secondary memory. Also OS needs to maintain some sort of information about each processes in order to fetch the contents from secondary memory but I have few questions in regards to the above:
1) Main memory is limited and CPU can directly access only Main Memory and there can be many many number of processes, so how is it possible that each of the processes information is maintained by the CPU in Main memory. (even though only small part of the Process Image of each process is kept in memory but still there can be so many processes)
2) Also Secondary Memory can be in TBs so how are the addresses accessed as it would definitely require more than 32 bits to represent TBs. Eg. Some data of a Process is at location beginning from 900 GB. How will the PCB of that process tell the CPU that it is at location 900 GB, I mean it has to take more than 32 bits to tell that right and assume the system is 32 bit and how will it be different if the system is 64 bit.
3) Also the secondary memory being in TBs, there has to be some way for the CPU to access any part of the Secondary Memory, how is that done?
4) Also is the case possible where there is no information about the process in Main memory. If that is the case then how would the retrieval of the contents of that data would be carried out. This might not be the case but the thing that forces me to think in this perspective is that the Main memory is only so much and there can be lots and lots of processes, hence the question.
I have tried searching a lot on internet but unable to find answers and if I find something I get more confused. Can anyone please clarify these doubts.
Edit: Take any CPU or any OS, I just want a generalized picture. The specifics may be different in different systems but I believe at some level there will be some commonality.