日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

硬件保护和软件保护_什么是硬件保护?

發(fā)布時間:2023/12/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 硬件保护和软件保护_什么是硬件保护? 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

硬件保護(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)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。