美文网首页
2022-06-06

2022-06-06

作者: NeverFade | 来源:发表于2022-07-06 21:22 被阅读0次

1.Process

Definition: the instance of a program (just like object is an instance of a object-oriented program)
What it has: machine instructions, registers, stack, heap
Process control block: PCB stores information like process's memory address, executable image resides on disk, privileges, and so forth

2.Dual Mode Operation

Dual-Mode: User mode and Kernel Mode
How to distinguish: A single bit in the processor status register
What Hardware support: (1)Privileged instructions (2) Memory Protection (3)Timer Interrupts

(1) Privileged instructions

Definition: Instructions that are available in kernel mode but not in user mode
What kernel dose: 1)change instructions' privilege levels, 2)adjust memory access, 3)disable or enable interrupts
What cause processor exception: Applications attempt to change it's privilege level or access restricted memory

(2) Memory Protection

How to perform Memory Protection: set memory Base and Bound for each process, and User-level code cannot change them. Every time processor fetches an instruct of the process, check its memory-access address with the base and bound.

Important features: 1) Expandable heap and stack 2)Memory sharing 3)Physical memory addresses 4) Memory fragmentation

virtual addresses: Every process start at virtual addresses, and hardware translate the virtual addresses into physical addresses with a map, operating system is responsible for maintaining the map.

Address randomization: Some OS randomizes the processes' virtual addresses each time they run to combat the virus.

(3)Timer Interrupt

What for: OS need to regain control of the processor from time to time, or some process (like dead loop) take up the whole processor and the OS crashes.
How to do: Hardware timer is set to interrupt the processor after a specified delay. When the timer interrupt occurs, the hardware transfer the user process to the kernel running in kernel mode.

3.Types of Mode Transfer:

User mode to Kernel mode:

(1) interrupt (2) processor exception (3) system call

Kernel mode to User mode:

(1) New process (2) back from interrupt or system call (3) switch to different process (4)User-level upcall

4.Implement safe mode transfer

相关文章

  • Requested but did not find exten

    2022-06-06 10:01:26.447 xcodebuild[11700:269888] Requeste...

  • 2022-06-06

    Trends Biotech | 四大类癌症模型指南 原创huacishu图灵基因2022-06-06 10:14...

  • 2022-06-10 因子论实盘记录

    一、交易记录 2022-06-06 4.1570 元买入 24700 股 300ETF。 二、持股实盘 2022-...

  • 2022-06-15考试的季节(结)

    2022-06-06考试的季节(一[https://www.jianshu.com/p/5c29d754b1bf]...

  • 2022-06-06

    Nat Methods | RNA分子结构研究新方法 原创图灵基因图灵基因2022-06-06 10:14发表于江...

  • 【洞仙歌】青藏忆旧游

    【洞仙歌】 青藏忆旧游 (2022-06-06) 不甘伏枥,故携游天路。 别样风光教人妒。 挽冰峰、出鞘剑刺云霄,...

  • 督导收获

    中原焦点团队 坚持分享1421天 2022-06-06 今晚,是刘老师对我们高七和高六的联合督导,其中感触最深...

  • 2022-06-06

    2022-06-06 坚持分享第1345天 探讨例外 SFBT咨询历程,不会把注意力集中在问题上,而是聚焦在解决之...

  • 戒定慧·《感恩日志》重启第24天

    2022-06-06(周一)五月初八 【20:37】 01、感恩:不太宁静的当下~教练角色~见证五个娃的生活日常~...

  • 0217读书|唤醒沉睡的天才

    2022-06-06 北京 晴天5:10起床参加读书《唤醒沉睡的天才》~ 古典老师的序:五年后,你的家人,朋友会因...

网友评论

      本文标题:2022-06-06

      本文链接:https://www.haomeiwen.com/subject/ujajmrtx.html