硬件保护和软件保护_什么是硬件保护?
硬件保護(hù)和軟件保護(hù)
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).
計算機(jī)包含各種硬件,例如處理器,RAM,監(jiān)視器等。因此,操作系統(tǒng)必須確保這些設(shè)備保持完整(用戶不能直接訪問)。
It is divided into three categories:
它分為三類:
1)CPU保護(hù) (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.
這意味著一個進(jìn)程不應(yīng)永遠(yuǎn)占用(保持)CPU,否則其他進(jìn)程將無法獲得該進(jìn)程。 為此,引入了計時器以防止這種情況。 給某個進(jìn)程一定的執(zhí)行時間,之后將信號發(fā)送到該進(jìn)程,使該進(jìn)程離開CPU。 因此,進(jìn)程不會占用CPU。
2)記憶保護(hù) (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.
內(nèi)存中可能有多個進(jìn)程,因此一個進(jìn)程可能會嘗試訪問其他進(jìn)程內(nèi)存。
To prevent such situation we use two register:
為了防止這種情況,我們使用兩個寄存器:
Base Register
基本寄存器
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.
基址寄存器存儲程序的起始地址,而極限寄存器存儲過程的大小。 因此,只要進(jìn)程想要訪問內(nèi)存中的地址,就會檢查該進(jìn)程是否可以訪問內(nèi)存。
3)I / O保護(hù) (3) I/O protection)
To ensure CPU protection OS ensure that below case should not occur
為了確保CPU保護(hù)OS,請確保不會發(fā)生以下情況
View I/O of other process
查看其他進(jìn)程的I / O
Terminate I/O of another process
終止另一個進(jìn)程的I / O
Give priority to a particular process I/O
優(yōu)先處理特定的流程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.
如果應(yīng)用程序進(jìn)程要訪問任何I / O設(shè)備,則將通過系統(tǒng)調(diào)用來完成,以便OS監(jiān)視任務(wù)。
Like In C language write() and read() is a system call to read and write on file. There are two modes in instruction execute:
像在C語言中一樣, write()和read()是對文件進(jìn)行讀寫的系統(tǒng)調(diào)用。 指令執(zhí)行有兩種模式:
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.
系統(tǒng)代表用戶應(yīng)用程序執(zhí)行此指令的任務(wù)。 在這種模式下,用戶無法直接訪問硬件和參考存儲器。
Kernel mode
內(nèi)核模式
Whenever a direct access to hardware is required a system call is used by the application program.
每當(dāng)需要直接訪問硬件時,應(yīng)用程序就會使用系統(tǒng)調(diào)用。
翻譯自: https://www.includehelp.com/operating-systems/hardware-protection.aspx
硬件保護(hù)和軟件保護(hù)
總結(jié)
以上是生活随笔為你收集整理的硬件保护和软件保护_什么是硬件保护?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 看懂这些故事,你做人就很成功了
- 下一篇: mootools 选择器_MooTool