Bagaimana Komputer Tahu Ketika Itu Tidak Dimatikan dengan Benar?

Daftar Isi:

Bagaimana Komputer Tahu Ketika Itu Tidak Dimatikan dengan Benar?
Bagaimana Komputer Tahu Ketika Itu Tidak Dimatikan dengan Benar?

Video: Bagaimana Komputer Tahu Ketika Itu Tidak Dimatikan dengan Benar?

Video: Bagaimana Komputer Tahu Ketika Itu Tidak Dimatikan dengan Benar?
Video: Sistem File - YouTube 2024, April
Anonim
Ketika Anda menyalakan komputer Anda setelah crash sistem / shutdown yang tidak benar, biasanya akan menyarankan tindakan seperti boot ke safe mode dan menjalankan pemeriksaan disk. Bagaimana komputer tahu itu jatuh?
Ketika Anda menyalakan komputer Anda setelah crash sistem / shutdown yang tidak benar, biasanya akan menyarankan tindakan seperti boot ke safe mode dan menjalankan pemeriksaan disk. Bagaimana komputer tahu itu jatuh?

Sesi Tanya & Jawab Hari ini hadir untuk memberi kami SuperUser - subdivisi Stack Exchange, pengelompokan komunitas situs web Tanya-Jawab.

Pertanyaan

Pembaca SuperUser FrozenKing ingin tahu bagaimana komputernya tahu ketika komputer itu mengalami gangguan atau mengalami shutdown yang tidak benar. Dia menulis:

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?

Ini pertanyaan yang menarik; jelas sistem operasi modern sangat menyadari bahwa ada sesuatu yang salah, tetapi dengan mekanisme apa yang mereka sadari?

Jawaban

Kontributor SuperUser David Schwartz menawarkan jawaban umum dan wawasan tentang berbagai sistem operasi:

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.

Kontributor lain, ChrisF menjawab lebih spesifik untuk sistem operasi 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.

Memiliki sesuatu untuk ditambahkan ke penjelasan? Bicaralah di komentar. Ingin membaca lebih banyak jawaban dari pengguna Stack Exchange yang paham teknologi lainnya? Lihat diskusi lengkap di sini.

Direkomendasikan: