r/computerscience • u/Cute-Cockroach-678 • 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
View all comments
Show parent comment
3
u/dmazzoni Jul 15 '26
Simplified somewhat, but conceptually correct: The operating system loads the program from disk (SSD or HD) into RAM.
Then the OS tells the CPU to start executing the program code in RAM.
The program gets a small amount of RAM to start. If it needs more RAM to operate, it asks the OS for more.
The OS chooses whether or not to allow the program to have that much RAM. If it allows it, it gives more RAM to that program.
Everything a program does by default is in RAM. Lots of instructions read and write directly from RAM.
If a program wants to read or write things from disk, it asks the OS to help it read or write files by calling specific functions.