سوال ۹۶ کنکور ارشد مهندسی کامپیوتر ۱۴۰۴
هدف اصلی از مکانیزم حالت دوگانه (Dual Mode)، حفاظت از کدام مورد است و در کجا پیادهسازی شده است؟
پاسخ صحیح: گزینهٔ C — منابع سیستم در برابر عملکرد مخرب فرایندها ـ پردازنده
Dual-mode operation distinguishes a user mode from a kernel (supervisor / monitor) mode. The current mode is recorded by a mode bit in the hardware, so the mechanism is implemented in the processor (CPU), not in software.
Why it exists. Certain instructions are designated privileged (e.g. I/O instructions, loading the timer, switching the mode bit, modifying memory-management registers, the halt instruction). The CPU executes a privileged instruction only while the mode bit indicates kernel mode. If a user-mode process tries to execute one, the hardware raises a trap and hands control to the operating system instead of carrying out the operation.
The goal is therefore to protect the system and its resources (CPU, memory, I/O devices) from erroneous or malicious behavior of processes: a user program cannot directly seize the hardware, monopolize the CPU, or corrupt other processes' memory, because the operations that would do so are privileged and trap when attempted in user mode.
Matching the two parts of each option:
| Part | Correct value |
|---|---|
| What is protected | system resources against malicious behavior of processes |
| Where implemented | the processor (hardware mode bit) |
Only option 3 states both correctly. Options 1 and 2 misname the protected item, and options 2 and 4 wrongly place the mechanism in the operating system rather than in the CPU hardware.
Pitfall: Dual mode is hardware support provided by the CPU; the OS uses it but does not implement it. Any choice that says it is implemented "in the operating system" is wrong.