• 22、深入理解计算机系统笔记,虚拟存储器,Linux示例


    1、Pentium地址翻译的情况

    wps_clip_image-24228

    1)页表

        每个pentium系统都使用如图所示两级页表。

    wps_clip_image-5431

    每个进程都有一个惟一的页面目录和页表集合。页面目录基址寄存器(page directory base register, PDBR)指向页表目录的起始位置。

    2)PDEPTE格式

    wps_clip_image-12702

    Write-through 直写;write back: 写回。

    wps_clip_image-28597

    Pentium页表条目缺少一个执行许可证,用来控制一个页面的内容是否可以被执行。缓冲区溢出攻击利用了这个疏漏,有用户栈上直接加载和运行代码。如果有这样一个执行位,那么内核就可以通过限制对只读代码段的可执行权限,来消除这种攻击的威胁了。

    3)页表翻译

    wps_clip_image-16506

    2、Linux虚拟存储器

    1)一个进程虚拟存储器示例

    wps_clip_image-7740

    内核在系统中为每个进程维护一个单独的任务结构(如图中,task_struct)。任务结构中的元素包含或者指向内核运行该进程所需要的所有信息,如PID,指向用户的栈,可执行目标文件的名字,PC等。

    One of the entries in the task structure points to an mm_struct that characterizes the current state of the virtual memory. The two fields of interest to us are pgd, which points to the base of the page directory table, and mmap, which points to a list of vm_area_structs (area structs), each of which characterizes an area of the current virtual address space. When the kernel runs this process, it stores pgd in the PDBR control register.

    wps_clip_image-308

  • 相关阅读:
    DOM 高级编程笔记
    什么是目标管理?什么叫smart原则?
    HTML文档中小meta的大作用
    《javascript权威指南》基础笔记 重要
    应聘时最漂亮的回答 转
    JS在IE和Firefox之间的区别
    apply与call的用法及区别
    谈谈Ajax跨域
    《高性能网站建设指南》、《高性能网站建设进阶指南》笔记
    HTTP协议状态码详解(HTTP Status Code)
  • 原文地址:https://www.cnblogs.com/mydomain/p/2090072.html
Copyright © 2020-2023  润新知