Question

Q1. Which of the following instructions should be privileged? Explain your answer. Set value of timer....

Q1. Which of the following instructions should be privileged? Explain your answer.

  1. Set value of timer.
  2. Read the clock.
  3. Clear memory.
  4. Issue a trap instruction.
  5. Turn off interrupts.
  6. Modify entries in device-status table.
  7. Switch from user to kernel mode.
  8. Access I/O device.

EXPLAIN WHY PLEASE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: In case of any queries, just comment in box I would be very happy to assist all your queries

note:

The Kernel mode is the reserved mode or privilleged mode for the low-level tasks of the OS. In case of User mode, the running code cannot access the reference memory or hardware directly.

Solution with explanation:

Instructions that executed in

Kernal mode / Privileged mode are:

1.)Set value of timer - Since timer control mechanism can interrupt the system also the timer is controlling the scheduling and suppose a user program executes upto the timer stops without voluntarily give up the control, user program will be forced to yield by the OS. If a user program could set the value of the timer, then it could dominate the CPU.

3.)Clear memory - Operating System have to check whether the process that needed to clear the memory should control the part of memory in the question prior to comply with the request.

5.)Turn off interrupts - Interrupts are utilized in the context switches or for notifying the system whenever it fetch data from the hard disk. Also the OS should set the flow of the control between the kernel and the user processes.

6.)Modify entries in device-status table- User program should not overwrite  the entries.

7.) Switch from user to monitor mode - Suppose user programs can switch to the monitor mode, they will carry out anything they needed. So, they should request a switch to monitor mode and then tahe away the control to the kernel by means of a system call.

8.)Access I/O device - Read/write to a device will be interference for other processes. Suppose while typing passwords in keyboard, some un-authorized process read them.

User mode:

2.) Read the clock:- Example: The clock is displayed on computer desktop.

4.) Issue a trap - This is the only way which they are allowed to enter the kernel to mak a system call.

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Q1. Which of the following instructions should be privileged? Explain your answer. Set value of timer....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT