0

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.

4

1 回答 1

1

太字节?没问题。

您总是可以用较短的整数构造较长的整数。文件系统经常使用比 CPU 中指针大小更长的索引、大小和计数。这就是您可以拥有和寻址比 CPU 地址空间大小更多的存储空间的方式。

而且您不需要将磁盘中的所有内容加载到 RAM 中,您可以加载足够多的小块以适合 CPU 的地址空间。

文件系统允许您一次读取包含一个或多个文件和目录的数据块,这些块的大小通常为千字节,而不是兆字节或千兆字节,更不用说兆兆字节了。

因此,更长的索引/大小/计数 + 小块。这就是访问更多磁盘数据所需的全部内容,而不是加载到 RAM 中的数据。

于 2013-03-29T13:52:41.350 回答