eli5: How does the OS upgrade during the upgrade process?

182 views

Like say you upgrade from MacOS 13 to 14. How does the OS still run when files are theoretically being replaced while the OS is still running.

In: 7

7 Answers

Anonymous 0 Comments

It doesn’t. That’s why updates require restarts. The update software runs independently of the OS and modifies the OS files while the OS isn’t running.

Anonymous 0 Comments

[deleted]

Anonymous 0 Comments

Same way you might clean a floor. You clean all the parts that aren’t necessary for you to walk on, then you slowly clean the rest of it until there’s nowhere to stand, at which point you start walking on the cleaned parts instead and clean the remaining bits from there.

The part where the system steps off of the “dirty” part and onto the new, “clean” part is where things can get dangerous, which is why it wrests control from you and begs you to not power down while it does it. The actual “step” is taken when the system powers down and back up again. That’s the system shutting down the last of its old parts and stepping into the new parts.

Anonymous 0 Comments

There is no physical rule, that the files cannot be overwritten while in use. Some OSes (like Windows) might forbid that – but that’s just a design decision. Also, if a file is loaded into RAM – it doesn’t have to match its own copy on the disk anymore. Again, some OSes may enforce that connection – but nothing prevents them from just not doing that.

On Linux, for example, you can delete a file while it is in use – the programs that have the file opened will still have access to it, but the moment the file is closed – it will be deleted for real. You can then create a new file with the same name – new programs will use that new file instead.

On systems that do not allow deletion in use – the system update process might have a right to do it anyway.

Anonymous 0 Comments

The updates aren’t applied until the files in question are closed. If it’s a minor program, it’s no problem to restart the individual program while the machine is running.

Even system services *could* be updated this way, by taking turns restarting system components without taking the entire system offline, but its tricky and often leads to unforeseen consequences if one important system service tries to “talk” to a different system service when one of them has been updated and the other hasn’t.

Because of this, most systems require a reboot before system updates take effect. A separate program loads before the rest of the operating system and does the house-keeping needed to “turn on” the new files that were downloaded, and either delete or back-up the old ones.

Many systems make backups of the previous system files in case you need to go back to the old version.

Anonymous 0 Comments

When you start an application the computer code gets copied from the hard drive into the memory and then can be executed by the processor. If you change the files that stores the computer code then the running process will still use the old code as this is what is copied into memory. It is only when you close the application and open it again that the running code changes. The operating system kernel is exactly the same. All the code is copied into memory and is executed from there. The files on the file system is only there for the next reboot.

Anonymous 0 Comments

Imagine you have a list of all the things you do when you wake up in the morning, but you want to change that list.

So you make a new list, writing down all the things you want to do in your new routine, but you don’t touch or change your old list, in case something goes wrong and your new list doesn’t work with your video card drivers or something.

Then you put a post-it note on your old list that says ‘instead of starting this list, try to use the new list, unless you already tried to use the new list and it did not work. Then throw away this post it note and start the old list.’