zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    胖虎都看得懂的CSS入门
    Python-ORM之sqlalchemy的简单使用
    类似fabric主机管理demo
    Redis 数据库学习
    sublime 3插件安装记录
    斐波那契数列—java实现
    mysql基础操作记录
    [转]修改github已提交的用户名和邮箱
    python nose的html报告优化
    python report中文显示乱码
  • 原文地址:https://www.cnblogs.com/mydomain/p/2090072.html
Copyright © 2011-2022 走看看