By using this site, you agree to our Privacy Policy and our Terms of Use. Close
CrazyGPU said:
RAM is not like Cache. A CPU can read from cache and if there is a cache miss it looks for data on ram. But a CPU doesnt reed directly from HDs. Thats why there are memory management units since 1985 on the 80386 chip. These units make the conversion between logical adresses and phisical ram adresses and bring pages from virtual memory (disk) to RAM. Then the CPU can read the data. CPU reads DATA from RAM, not from HDs, so RAM IS NOT CACHE.

Yeah, I understand why you think this way. We usually refers to the CPU cache when we say "cache". And you're right when you say that RAM is not a cache because there are no instructions to READ or WRITE directly to the disk. Conceptually speaking though, it is.

The CPU cache keeps a small portion of data and instructions that were previously on the RAM. In the same way, RAM keeps a small portion of data and instructions that were previously on the HDD. The entire memory hierarchy model on computers is based on this idea. In each level we have a "cache" for the slower memory on the level below.

You can change a instruction like:

MOV $ADDRESS, EAX

to access $ADDRESS on the disk instead of the RAM even if it needs do go trough the memory converter-disk controller.

One of the main reasons you need to work with virtual addresses is because today you have dozens of proccesses using the memory concurrently on your PC. In the ancient machines - and some specific ones today - the memory address used was the real one.

That's what I was talking about. Conceptually speaking, the RAM is like a cache for the disk.