• 内核空间和用户空间的分界 PAGE_OFFSET


     
    PAGE_OFFSET
    首先看看PAGE_OFFSET的功能
     
    1. 内存映射
    2.     |            用户空间                  |   内核空间   |
    3.     |——————+——————+——————+———————|
    4. 物理 A:0        1G                         B:3G          C:4G
    5.     B: 定义为    PAGE_OFFSET
    6.     0-1G: 和内核空间又有丰富的内容,我还没有整理,以后再说。
     
     
    -------------------------------------
    1. arch/x86/include/asm/page_types.h
    2.      #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET
    3. -> __PAGE_OFFSET
    4.         arch/x86/include/asm/page_64_types.h:
    5.             #define __PAGE_OFFSET _AC(0xffff880000000000, UL)
    6.         arch/x86/include/asm/page_32_types.h:
    7.             #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
    8.  
    9. -->CONFIG_PAGE_OFFSET
    10.         arch/x86/configs/i386_defconfig:
    11.             CONFIG_PAGE_OFFSET=0xC0000000
    12. -->AC
    13.          include/linux/const.h
    14.             #ifdef __ASSEMBLY__
    15.             #define _AC(X,Y) X
    16.             #else
    17.             #define __AC(X,Y) (X##Y)
    18.             #define _AC(X,Y) __AC(X,Y)
    19.             #endif
    =====================================
    我们就很清晰的看到,在x86下,32时PAGE_OFFSET 为0xC0000000(3G),也是内核空间和用户空间的分界。
     
  • 相关阅读:
    【web安全】浅谈web安全之XSS
    【css】浅谈BFC
    nodejs笔记一--模块,全局process对象;
    逼真打字机效果;
    深入理解CSS3 animation的steps
    网址链接收藏
    用hoverclock插件实现HTML5时钟
    JS多种方法实现随机颜色;
    canvas实现跟随鼠标旋转的箭头
    封装insertAfter、addClass、格式化时间
  • 原文地址:https://www.cnblogs.com/timssd/p/4781099.html
Copyright © 2020-2023  润新知