eli5: What actually happens when you “restart” a machine – does it switch off? If so how does it start itself again?

203 views

[ad_1]

eli5: What actually happens when you “restart” a machine – does it switch off? If so how does it start itself again?

In: Technology
[ad_2]

Yes, it cycles off and back on, and just like a computer. The power button isn’t like a light switch, it has a circuit it connects to that’s on full-time waiting for a power button signal to turn other stuff on. That same circuit can be made to handle turning off and then making its own start signal without a button press

It doesn’t turn off usually. Basically the OS tells the various hardware components to reset themselves which causes them to go back to the same state they are in when the machine first turned on and then start processing from the beginning again. One could think of it like wiping the memory and starting fresh.

Think of a computer as someone working in an office at their desk.

Let’s imagine that this person is extremely forgetful, and needs to follow some set steps in order to start their day. Imagine these steps are on a card they have in their pocket. In a computer these steps are called a basic input output system or BIOS and are stored on a very small chip on your motherboard. Whenever the computer starts up, it runs this program. The program may do things like run basic tests, and discover what storage is attached to the computer, and try to hunt down your operating system (e.g. Microsoft Windows or Mac OS or Linux).

Imagine that in order to work with any information, our office worker needs to locate and make a copy of it, bring the copy to their desk, maybe make changes, and then file away their results **so they don’t get thrown away at the end of the day**. In a computer, this desk is a type of storage called random access memory. It’s where the computer needs to copy data before it can be worked with. Note that random access memory needs constant power, or it’ll be cleared.

Think of shutting down the computer as ending the office worker’s work day early: Literally asking the worker to file away what it can, and then asking them to go home while their desk is cleared. In a computer, shutting the computer down signals all programs that the random access memory’s power will be cut soon, and then asks the computer to cut its own power. Usually there’s enough time for programs to quickly copy what they were doing to other types of storage, but there are ways you can shut it down that don’t afford it enough time. For example, if you literally pull the plug, data that was only in random access memory will be lost.

Restarting a computer just turns it off and turns it back on. In the office worker analogy, it’s like being asked to leave and go home, then being called back in.

The circuit that remembers to switch it back on doesn’t get switched off.

In something like a computer, there’s a little circuit which controls the power to the rest of the computer. When you press the button, it turns on the rest of the computer. When it gets a “turn off” signal, it turns off the rest of the computer. When it gets a “restart” signal, it turns off the rest of the computer, then turns it back on.

When you hard-turn-off the computer by holding down the power button, this is the same circuit that counts how long you hold down the button, and then turns off the rest of the computer.