Come fa il computer a sapere quando non è stato chiuso correttamente?

Sommario:

Come fa il computer a sapere quando non è stato chiuso correttamente?
Come fa il computer a sapere quando non è stato chiuso correttamente?

Video: Come fa il computer a sapere quando non è stato chiuso correttamente?

Video: Come fa il computer a sapere quando non è stato chiuso correttamente?
Video: Cos'è un File System? - YouTube 2024, Aprile
Anonim
Quando si avvia il computer dopo uno spegnimento / arresto anomalo del sistema, di solito suggerisce azioni come l'avvio in modalità provvisoria e l'esecuzione di un controllo del disco. Come fa il computer a sapere che si è schiantato?
Quando si avvia il computer dopo uno spegnimento / arresto anomalo del sistema, di solito suggerisce azioni come l'avvio in modalità provvisoria e l'esecuzione di un controllo del disco. Come fa il computer a sapere che si è schiantato?

La sessione di domande e risposte di oggi ci viene fornita per gentile concessione di SuperUser, una suddivisione di Stack Exchange, un raggruppamento di domande e risposte di community drive.

La domanda

Lettore SuperUser FrozenKing vuole sapere come il suo computer sa quando si è arrestato in modo anomalo o altrimenti ha avuto uno spegnimento improprio. Lui scrive:

Actually, this question struck me because of power cuts in my house. When there is a power cut, there is a sudden loss of power from the computer.

How does the computer know that the shutdown was not properly done?

È una domanda interessante; i sistemi operativi chiaramente moderni sono ben consapevoli che qualcosa è andato storto, ma con quale meccanismo vengono messi a conoscenza?

Le risposte

Il collaboratore di SuperUser David Schwartz offre una risposta generale e una panoramica dei diversi sistemi operativi:

For non-Windows based PCs, the detection is usually done on a per-filesystem basis. When a filesystem is mounted in read/write mode, an entry is written to the filesystem marking it dirty. When the filesystem is unmounted, an entry is written marking it clean. On startup, the operating system checks if its core filesystems are marked dirty, and if so it knows there wasn’t a clean shutdown - at least of those filesystems.

Un altro contributore, ChrisF risponde in modo più specifico per il sistema operativo Windows:

Windows also uses the Dirty Bit method to detect whether the PC was shut down properly:
Windows also uses the Dirty Bit method to detect whether the PC was shut down properly:

When powered off as normal, the bit is switched off. However, in case of power outage or improper (forced) shutdown, the bit will still be on the next time the PC is started.

This means that Windows can suggest remedial action – such as booting into Safe Mode.

In addition a Windows based PC will write an entry into event log detailing when and why (if known) it was shut down. It also writes an event when the PC starts up.

Hai qualcosa da aggiungere alla spiegazione? Sound off nei commenti. Vuoi leggere più risposte dagli altri utenti di Stack Exchange esperti di tecnologia? Controlla la discussione completa qui.

Consigliato: