OS-Memory Management

进程管理:一组进程如何共享CPU

内存管理:一组进程如何共享内存

stall ,cache

memory和register都是access directly for cpu,

memory: many cycles(2 or more)

register:one cycle of the cpu clock

所以cpu needs to stall frequently (intolerable)

所以在memory与cpu之间加入了cache

cache的思想

Copying information into faster storage system

When accessing, firstcheck in the cache, 

if In:useit directly 

Not in:getfrom upper storage system,andleave a  copy inthe cache 

Memory protection

1.A pair of base and limit registers define the logical address space

2.OS has unrestricted access to both monitor and user's memory

3.Load instrutions for the base/limit registers are privileged


二级页表需要3次内存访问

Structure of the Page Table

1.hashed page tables

algorithm:1.the virtual page number is hashed into a page table

                2.vitual page numbers compare in the chain searching for a match

                3.if a match is found,the corresponding physical frame is extracted

2.inverted page tables

one entry for each real page of memory

        1.entry consists of the virtual address of the page stored in that real memory location

        2.with information about the process that owns that page

优点:decrease memory need to store each page table,only one page table inthe system

            不用为每个进程都存一个页表了,只需要维护一张表

缺点:


Paging and Segmentation


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,499评论 0 10
  • 待我君临天下,许你四海为家; 待你君临天下,许谁四海为家,宫门万丈千家宠,我已昨日黄花; 待我了无牵挂,许你浪迹天...
    世斌阅读 2,741评论 0 1
  • 1.开始 2027年,是我踏上旅途的第二年,也是我成为旅行者的第一年。 世界变了一个样子。2018年,雾霾爆发,小...
    笑面sr阅读 522评论 8 12