Restarting your Mac is a common task. It’s a solution for a host of problems, resetting your system and solving many problems effectively. Even though macOS doesn’t require nearly as many restarts as its companion Windows, troubleshooting and hardware installation still often requires a restart, alongside regular “maintenance” restarts once a month or so. What happens when you restart your Mac, and why is it so effective as a troubleshooting step? It’s actually a fairly simple power-control process involving some pretty basic commands.
What happens when you restart your Mac?
In the abstract, a reboot is indicated by a power state flag set by your computer at the end of the shutdown process. This flag tells the motherboard, or Logic Board in Apple parlance, to reset the attached components using the correct reset commands. Then, it follow the normal startup (AKA “bootstrap”) process.
This reset command is nothing more than a certain value at a certain register address which the motherboard checks before moving to its “off” state. If the reboot flag is present, the computer starts the boot process as soon as the shutdown process is finished. If the flag isn’t present, the computer moves into the “soft off” state, waiting for you to come back and press the power button again.
The reboot process is only slightly different from the shutdown process. The computer “knows” to reboot thanks to the ACPI reset command, but that’s only set after the computer has completed the shutdown process. All components get reset as part of the shutdown process, so the only difference between shutdown and reboot is that the computer restarts as soon as it can.
The shutdown process is pretty simple itself. When you select “shutdown” from the Apple menu, the computer quits all apps, does a little housekeeping, unmounts the filesystem and turns off peripheral devices.
What are power states?
Much of your Mac’s shutdown and restart processes are controlled by ACPI power states. Power states come in a couple flavors and are controlled by the motherboard or Logic power. These power states comes from ACPI, or Advanced Configuration and Power Interface, which controls power management in your Mac. This controls how power is distributed to different devices, including things like the memory (RAM), storage devices, USB peripherals and more. There are a couple important power states that help us understand how the computer operates.
- G0: Powered on and working; this is your Mac’s “awake” and operational status. Every connected component is fully powered up.
- G1: Sleeping, which contains several sub-states as listed below.
- S1: RAM and CPU power stays on, but the CPU isn’t processing instructions. CPU instructions are preserved. Peripheral devices, like USB hard drives or web cameras, are powered off.
- S2: CPU is powered off, wiping the CPU cache. RAM power is maintained. This preserves the contents of memory while reducing power consumption of the device. In practice it’s not much more different than the state below, and infrequently used.
- S3: Everything except RAM and peripherals that can wake the computer, like the keyboard, is powered off. This is your computer’s “sleep” state. This is triggered from the Apple menu or happens automatically on a timer after a period of inactivity.
- S4: RAM contents are written to disk and everything powers off. If you shut your Mac’s lid and the battery dies, it goes into this state, writing RAM contents to memory if it can. The only difference between this and G2 is the resume process: you won’t need to boot your Mac to return from this power state.
- G2: “Soft off.” This state is the Mac’s off state. Power is cut to everything except devices that listen for power on, like the power button on your Mac. Some keyboards also include a power-on button, so that will stay active in this state.
- G3: Mechanically off. The Mac cannot be started again until it’s put back into G2, or “soft off.” Macs don’t typically have access to this state directly, but it’s akin to mechanically separating your computer from power by a surge protector switch.
Why does rebooting fix so many problems?
Rebooting is a key troubleshooting step because it fixes a huge variety of problems. But how?
When you restart your Mac, all of the computer’s logic is reset. This means that the CPU, memory, controllers and peripherals all receive their reset commands and return to their boot-up states. By wiping away anything that was happening previously, this reset can often fix problems by resetting things to their “new” state. Of course, this doesn’t mean the problem won’t reoccur. But this fresh start often removes the offending gremlin, at least temporarily.
You might also like some of the following: