How are game consoles and other computer devices able to turn themselves off and on again after an update?



How are game consoles and other computer devices able to turn themselves off and on again after an update?

In: Technology

The operating system has different code for restart and shutdown options. As long as a device is receiving electricity, it is never truly “off” and data is retained in the chipset. For a restart option, that data is used to initiate the startup sequence, while a shutdown option does not.

Well, technically the device is never really powered off. The CPU and the power supply are linked by some input/output lines and so there’s some limited control the CPU (via the motherboard) has over the power supply like “go into low power mode” or “go to standby”…. which just keeps the CPU running at slow speed and contents of memory in the RAM and so on.

But in the case of a reboot for say a Windows update.

– computer operating system downloads the update.
– inserts commands into its startup scripts to run the new code instead of the old
– sets a flag at the end of the startup scripts that if it gets to this point it must have worked ok. Otherwise roll back the changes after another reboot.
– tells self to reboot
– CPU pretends like its shutting down, powering off and on again
– follows its startup scripts
– it worked, removes that flag/check

Literally there are commands like “reboot” or “shutdown -R ‘now'” to shutdown or reboot the operating system. These in turn end with commands for the CPU to literally turn itself off and on again.

The simple answer is that power isn’t controlled by a physical ON/OFF switch like electronics had up through the early 2000s. Part of the internal computer ALWAYS has some power as long as it’s plugged in. A part of the console’s program tells the system which parts of the system to power down and back up. It’s all digitally controlled now.

There are a few different shutdowns that happen when you shut down your computer, and a few different levels that a computer can be “off”:

* Physically unpowered: No power cord or no power coming from outlet (sometimes due to a wall switch or a power supply on/off switch). This is the true “off” state.

* Powered but shut down: This draws a tiiiiny bit of power that monitors just the power button, and sends a predefined command (held by a really small memory chip, generally) to turn on the power.

* Operating system not loaded: This is the “boot to bios” option, where you change things like the CPU clock or clockspeed if you’re a power-user. But this is best left alone by 99.9% of users. Generally, if you don’t interrupt the BIOS startup sequence (that is a preprogrammed set of steps) it will find your preferred boot media or go through your boot order to find an operating system on the first available storage device (this is why, in older computers, you’d get a “non-system disk or disk error” message if you tried to boot up with a disk in your floppy or CD drive; the CD and floppy drives were typically first in the boot order, but if there is nothing in them, it moves to the next. That error is saying that there is a disk there, but the BIOS found nothing that looked like it could be loaded into.)

* Operating system loading/”booting from disk”; the BIOS has recognized a storage device with an operating system that it can boot to, and it sends commands to load that OS’s boot instructions into RAM to be executed so that the OS can load and let you use the computer as a consumer.

* “On”: Functional and waiting for you to use it as an end-user.

When you “shut down” it goes through these stages in reverse, stopping at “Powered but shut down”; you have to hit a physical switch for that last bit.

What an operating shutdown does is basically take all of the changes you’ve made to the operating system’s initial state, wipe them (except for new installs that go into the OS’s load instructions now) and pulls all the data for the OS from the “fresh” copy.

But I digress; when you “restart” your computer sends a signal to the bios that says “I’m going to unload myself from memory, and the last thing I’m going to do is send this signal, when I do, run through startup sequence again, kthx.” so it gets into that “Operating system not loaded” state, and then kicks the BIOS into re-loading the OS, without ever going through the last 2 phases where it’s truly without power.