怪怪虎 发表于 2012-07-14 16:10

用户空间和内核空间的疑问

在概念上一个进程有0~4G的空间,其中0~3G为用户空间,3G~4G为内核空间。
今天突然想用个小程序来验证下,通过read->sys_read, 可objdump显示后,程序的地址空间中怎么没有3G-4G的影子啊?#include <fcntl.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
int fd;
fd=open(argv,O_CREAT);
if (fd == -1)
{
    printf("open file :%s failed\n",argv);
    return 1;
}
close(fd);
return 0;
}
40054c:       e8 e7 fe ff ff          callq400438 <open@plt>
0000000000400438 <open@plt>:
400438:       ff 25 22 05 20 00       jmpq   *2098466(%rip)      # 600960 <_GLOBAL_OFFSET_TABLE_+0x30>
40043e:       68 03 00 00 00          pushq$0x3
400443:       e9 b0 ff ff ff          jmpq   4003f8 <_init+0x18>
页: [1]
查看完整版本: 用户空间和内核空间的疑问