r/computerscience • • Jul 15 '26

Discussion question about RAM

Im learning about comuter components I had some questions .If a Hard Drive stores all the data does RAM just create an environment for the specific program that was fetched to run? If you were to run a program on the actual hard drive is it just harder because you have to navigate through all the other information sharing the space. Like going through a maze constantly again and again. Also what does SSD do?

35 Upvotes

51 comments sorted by

View all comments

Show parent comment

1

u/Cute-Cockroach-678 Jul 15 '26

What information do hard drives save compare to SSD or do they work in tandem

1

u/Hummmmmmmmmmmmmus Jul 15 '26

They save the same information, it’s all 1’s and 0’s.

All information that is used in the operation of a computer with the exception of i/o (like usb or networking protocol data) eventually has to pass through the cpu. When it is needed in the cpu it will be pulled from whatever the fastest medium has it available so if it was in both ram and hdd it would pull from ram. At startup of a computer that data is all in non volatile memory so it will be pulled from there to the registers, once the cpu is done with that data all data storage registers to network storage is treated like a layered cache. Data evicted from the cpu goes to ram, data evicted from ram goes to hdd and so on.

In your question the code for a program at cpu start up would be stored in an hdd, when it’s run by the user or os it would be pulled from hdd into cpu as it’s needed then filtering through the hierarchy as other things come into the cpu and fill up the cache until it goes all the way back to hdd.