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

  • 相关阅读:
    ElasticSearch学习记录
    用java代码手动控制kafkaconsumer偏移量
    kafka0.9.0及0.10.0配置属性
    kafka常用命令
    kafka消费者客户端(0.9.0.1API)
    kafka入门教程链接
    编程内功
    bzoj3145:[Feyat cup 1.5]Str
    3 SpringBoot与微服务
    2 微服务存在的问题和解决方案
  • 原文地址:https://www.cnblogs.com/mydomain/p/2090072.html
Copyright © 2011-2022 走看看