Home » Operating Systems

What is hardware protection?

Here, we are going to learn what hardware protection, types of hardware protection is?
Submitted by Himanshu Singh Bisht, on November 13, 2018

A computer contains various hardware like processor, RAM, monitor etc. So OS must ensure that these devices remain intact ( not directly accessible by the user).

It is divided into three categories:

1) CPU Protection

It means that a process should not hogg (hold) CPU forever otherwise other processes will not get the process. For that purpose, a timer is introduced to prevent such a situation. A process is given a certain time for execution after which a signal is sent to the process which makes the process to leave CPU. Hence process will not hogg the CPU.

2) Memory Protection

There may be multiple processes in the memory so it is possible that one process may try to access other process memory.

To prevent such situation we use two register:

  1. Base Register
  2. Limit Register

Base register store the starting address of the program and Limit Register store the size of the process. So whenever a process wants to access address in memory then it is checked that it can access the memory or not.

3) I/O protection

To ensure CPU protection OS ensure that below case should not occur

  • View I/O of other process
  • Terminate I/O of another process
  • Give priority to a particular process I/O

If an application process wants to access any I/O device then it will be done through system call so that OS will monitor the task.

Like In C language write() and read() is a system call to read and write on file. There are two modes in instruction execute:

  1. User mode
    The system performs a task on behalf of user application this instruction. In this mode, the user cannot directly access hardware and reference memory.
  2. Kernel mode
    Whenever a direct access to hardware is required a system call is used by the application program.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.