Kā dators zina, kad tas nav pienācīgi izslēgts?

Satura rādītājs:

Kā dators zina, kad tas nav pienācīgi izslēgts?
Kā dators zina, kad tas nav pienācīgi izslēgts?

Video: Kā dators zina, kad tas nav pienācīgi izslēgts?

Video: Kā dators zina, kad tas nav pienācīgi izslēgts?
Video: File System Concept - YouTube 2024, Aprīlis
Anonim
Kad startējat datoru pēc nepareizas izslēgšanas / sistēmas avārijas, parasti tā tiek ieteikta tādām darbībām kā sāknēšana drošajā režīmā un diska pārbaudes veikšana. Kā dators zina, ka tas ir crashed?
Kad startējat datoru pēc nepareizas izslēgšanas / sistēmas avārijas, parasti tā tiek ieteikta tādām darbībām kā sāknēšana drošajā režīmā un diska pārbaudes veikšana. Kā dators zina, ka tas ir crashed?

Šodienas jautājumu un atbilžu sesija mums priecājas par SuperUser - Stack Exchange dalību, Q & A tīmekļa vietņu kopienas diskusiju grupu.

Jautājums

SuperUser lasītājs FrozenKing vēlas zināt, kā viņa dators zina, kad tas ir nokritis vai citādi bijis nepareizs slēgums. Viņš raksta:

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?

Tas ir interesants jautājums; skaidri modernas operētājsistēmas labi apzinās, ka kaut kas noticis nepareizi, bet ar kādiem mehānismiem viņi ir informēti?

Atbildes

SuperUser atbalstītājs David Schwartz piedāvā vispārēju atbildi un ieskatu dažādās operētājsistēmās:

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.

Vēl viens ieguldītājs, ChrisF atbildes konkrētāk par Windows operētājsistēmu:

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.

Vai kaut ko pievienot paskaidrojumam? Skatieties komentāros. Vēlaties lasīt citas atbildes no citiem tehnoloģiju savvy Stack Exchange lietotājiem? Šeit skatiet pilnu diskusiju pavedienu.

Ieteicams: