Question

In: Computer Science

Modern CPU architectures allow for two modes of operation. Explain what the goal of having these...

Modern CPU architectures allow for two modes of operation. Explain what the goal of having these two modes is/are, and explain how two-mode operation is used to achieve this goal(s).

Solutions

Expert Solution

There are two modes of Operation:

1) Kernel Mode
2) User Mode

First, Let us understand what are these modes and what do they do.

Kernel Mode

Kernel is a bridge between Applications and Hardware.

When the system is switched on, It boots first in the Kernel Mode and then shifts to User Mode.

Mode bit for Kernel Mode is 0 and Mode bit for User Mode is 1. So, when changing the operating modes, actually Mode bit changed from 0 to 1 or from 1 to 0.

There are certain privileged operations which can only be performed in the kernel mode. Like Interrupts, I/O calls.

In Kernel mode, executing code can have completely unrestricted access to all the memory addresses and  Hardware.

Kernel Mode is almost always kept and used for trusted functions.

Because, there is so much control and power given kernel mode, and kind of crash and damage and impact the system to the roots and can be disastrous.

User Mode

The Operating System starts in the user mode. It frequently need help of the Kernel Mode to perform various operations.

In User mode, executing code has no direct access to Memory addresses and Hardware.

It must take help of the kernel mode with system APIs to have the access to address and hardware.

Because, User mode does not have so much control and power, crashes in this mode are mostly recoverable.   


Goals

Having these two modes is important because this isolation protects the system from severe damage.

If we do not have two modes, then giving all the access  in any 1 mode can be fatal to the system. Entire Operating System can be wiped out.

Multiple processes may write at the same time in the same system, with catastrophic results.

--------------------------------------

Now, Let's see how the system protects itself when privileged access is wanted in user mode.



Here, we can see that a user process executes in user mode until a system call comes.
When that happens, A TRAP is generated and mode bit changed from 1 to 0.

That system call is executed in Kernel Mode and when that completes,
A return is generated and mode bit is changed from 0 to 1.

and the execution resumes in user mode.

This way, it is made sure that privileged instruction are always performed in kernel mode and not in user mode.


Please comment for any further assistance.


Related Solutions

. In this exercise we will evaluate the performance difference between two CPU architectures: CISC (Complex...
. In this exercise we will evaluate the performance difference between two CPU architectures: CISC (Complex Instruction Set Computing) and RISC (Reduced Instruction Set Computing). Generally speaking, CISC CPUs have more complex instructions than RISC CPUs and therefore need fewer instructions to perform the same tasks. However, typically one CISC instruction, since it is more complex, takes more time to complete than a RISC instruction. Assume that a certain task needs P CISC instructions and 2P RISC instructions, and that...
Explain how a CPU in a modern computer with peripherals works, including how the CPU interacts...
Explain how a CPU in a modern computer with peripherals works, including how the CPU interacts with various levels of the memory hierarchy.
What are the two modes of encryption that allow random access to the ciphertext blocks. Specifically,...
What are the two modes of encryption that allow random access to the ciphertext blocks. Specifically, if a hacker has the information about i-th cyphertext block Ci and it can find the plaintext Pi without having any other cyphertext blocks.
1. Explain how threads are used by the CPU to process tasks by describing a modern...
1. Explain how threads are used by the CPU to process tasks by describing a modern example, e.g., the multi-core mobile phone that you use every day has an interesting organisation of threads. However, it can be any other modern example of hardware that uses ―threads. 2. There are a number of techniques used by CPU designers to improve the performance of their processors. However, these optimisation strategies do not always work – for some workloads, they may have no...
What is the goal of modern oil refining? What are the major processes?
What is the goal of modern oil refining? What are the major processes?
Explain the major differences between two-tier and three-tier database architectures.
Explain the major differences between two-tier and three-tier database architectures.
1. a. Explain why modern Operating Systems don’t allow the user to access the hardware directly....
1. a. Explain why modern Operating Systems don’t allow the user to access the hardware directly. b. System calls pass parameters to the kernel using one of three methods: in registers, in a block or table and the address of the block passed as parameter in a register, on the stack. Discuss the advantages and disadvantages of each.
Briefly explain two modes to convey information in the SNMP protocol.
Briefly explain two modes to convey information in the SNMP protocol.
Explain what has changed in CPU architecture to deal with clock rate
Explain what has changed in CPU architecture to deal with clock rate
Explain the basic operation of an operation amplifier. What are the most significant characteristics of such...
Explain the basic operation of an operation amplifier. What are the most significant characteristics of such a device and in designing a circuit what parameters of the device must be considered?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT