What does a hard drive actually do?

The hard drive actually has
3 main functions in a computer

The purpose of the hard drive is to hold for long term storage both the software that runs your computer, called the Operating System, and the software that allows you to do stuff with your computer are called Applications. Windows is an operating system, MS Word is an application.

When your computer boots up, it looks in a a specific place on the hard drive, called the boot sector, to find out what kind of computer it is. It then reads the code in the bootstrap and boots into Windows, Unix, Mac OS, OS2, Linux, FreeBSD, BEOS, or whatever operating system is loaded.

So the first function of the hard drive is to store the actual code that runs the computer’s functions.

The second function of the hard drive is to store Applications and their associated files until the User needs to use them. The information on your hard drive is not DOING anything, it just sits there.

When you open an application, the computer goes to where the application is stored on the hard drive and moves the required code into your computer’s memory. Before you open Word, it is just sitting on the hard drive, inactive. When you open Word, it is loaded into memory and you can actually do something with it..The information in Memory is where the actual doing takes place.

There is one more function of a hard drive, and that is to house the swap file, also called virtual memory. While you are using the computer, part of the hard drive is used to move stuff in and out of memory in order to allow the computer into use more memory than it actually has.

To do this, the operating system moves inactive code from true memory to the swap file. As an example, If you are writing a document in Word, most of the code for Word will be active in memory. But if you stop using Word and open PhotoShop to fix a picture you are going to use in the document, the operating system, (Windows) will put most of the code for Word into the swap file and load the code for PhotoShop into memory. When you finish in PhotoShop and switch back to Word, the operating system swaps (hence the name) the code in virtual memory (Word) on the hard drive with the code in true memory (PhotoShop)

SO, the hard drive serves 3 functions, it contains the boot sector, stores all the software and data that the computer has, and speeds up the computer by housing the swap file.