万子惠 + 原创作品转载请注明出处 + 《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000

我选择的是getuid:

int Getuid(int argc ,char *argv)
{
pid_t uu;
uu=getuid();
printf("uu = %d \n", uu);
return 0;
} int GetuidAsm(int argc ,char *argv)
{ pid_t uu;
uu = getuid();
asm volatile(
"mov $0x24,%%eax\n\t"
"int $0x80\n\t"
"mov %%eax,%0\n\t"
:"=m"(uu)
);
printf("uu = %d \n",uu);
return 0; }

1)先更新menu

2)在main函数中添加新的MenuConfig并添加相应函数

3)之后进入menu中使用make rootfs=>自动编译生成根文件系统【还自动启动起来~】

然后我们开始调试:

1)qemu -kernel linux-3.18.6/arch/x86/bzImage -initrd rootfs.img -s -S

2)gdb

3)file linux-3.18.6/vmlinux

4)target remote:1234

5)之后设置断点:

这个函数我好像和表里不一样 我设置了两个sys_getuid的断点

可以看到运行停在了这里(被压到背后的那个黑色部分)

6)之后使用s进行单步的运行,在使用finish运行到最后,这时候

在system_call设置断点,看到这是一段在entry32.s的特殊汇编代码。

从system_call开始到iret结束过程流程图

system_call的处理过程中:

xyz<=系统调用号=>sys_xyz()
int 0x80<=中断向量=>system_call

Linux内核分析——分析system_call中断处理过程的更多相关文章

  1. 《Linux内核分析》-- 扒开系统调用的三层皮(下)之system_call中断处理过程 20135311傅冬菁

    20135311傅冬菁  原创作品 <Linux内核分析>MOOC课程 分析system_call中断处理过程 内容分析与总结: 系统调用在内核代码中的工作机制和初始化 系统调用在用户态中 ...

  2. 《Linux内核分析》第五周:分析system_call中断处理过程

    实验 分析system_call中断处理过程 使用gdb跟踪分析一个系统调用内核函数(您上周选择那一个系统调用),系统调用列表参见http://codelab.shiyanlou.com/xref/l ...

  3. Linux内核分析-分析system_call中断处理过程

    姓名:江军 ID:fuchen1994 分析system_call中断处理过程 使用gdb跟踪分析一个系统调用内核函数(您上周选择那一个系统调用),系统调用列表参见http://codelab.shi ...

  4. Linux内核设计第五周学习总结 分析system_call中断处理过程

    陈巧然原创作品 转载请注明出处   <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 使用gdb跟踪分析一 ...

  5. Linux内核分析第五周学习总结——分析system_call中断处理过程

    Linux内核分析第五周学习总结--分析system_call中断处理过程 zl + <Linux内核分析>MOOC课程http://mooc.study.163.com/course/U ...

  6. 分析system_call中断处理过程

    分析system_call中断处理过程 上周我们使用gcc内嵌汇编调用系统调用,这次我们具体分析下过程. 将getpid嵌入menuos 代码从github下载,步骤如下: 1. 增加一个函数,get ...

  7. 作业五:分析system_call中断处理过程

    分析system_call中断处理过程 一.MesuSO增加getpid和getpid-asm 二.使用GDB跟踪系统调用内核函数sys_getpid 分析system_call中断处理过程 使用gd ...

  8. 通过分析system_call中断处理过程来深入理解系统调用

    通过分析system_call中断处理过程来深入理解系统调用 前言说明 本篇为网易云课堂Linux内核分析课程的第五周作业,上一次作业中我以2个系统调用(getpid, open)作为分析实例来分析系 ...

  9. 20135202闫佳歆--week5 分析system_call中断处理过程--实验及总结

    week 5 实验:分析system_call中断处理过程 一.使用gdb跟踪分析一个系统调用内核函数(上周选择那一个系统调用)--getpid 复习视频: 如何实现? - 更新menu代码到最新版 ...

  10. linux内核与分析 心得与体会

    作业目录: (1)计算机是如何工作的:http://www.cnblogs.com/20135335hs/p/5213394.html (2)操作系统是如何工作的:http://www.cnblogs ...

随机推荐

  1. ARM: STM32F7: hardfault caused by unaligned memory access

    ARM: STM32F7: hardfault caused by unaligned memory access ARM: STM32F7: 由未对齐的内存访问引起的hardfault异常 Info ...

  2. box-sizing 属性、min-width属性、max-width属性

    1.box-sizing  这个属性是CSS3新增的属性.IE8开始兼容.box-sizing: border-box; border-box,就是边框的这个小盒.这个属性命令,width数值指的是b ...

  3. linux PHP 编译安装参数详解

    linux PHP 编译安装参数详解 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc -- ...

  4. function,new function,Function,new Function 之间的区别

    测试一: var fud01 = function()  { var temp = 100; this.temp = 200; return temp + this.temp; } alert(typ ...

  5. 给vs2010换皮肤

    http://www.cnblogs.com/aolinwxfx/articles/2379252.html O(∩_∩)O哈哈~,很不错哦

  6. 美化iTerm2

    一.下载iTerm2,启动 二.安装oh-my-zsh curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/insta ...

  7. string类实现(C++)

    class CMyString { friend std::ostream& operator<<( std::ostream& os, const CMyString&a ...

  8. Spark机器学习读书笔记-CH03

    3.1.获取数据: wget http://files.grouplens.org/datasets/movielens/ml-100k.zip 3.2.探索与可视化数据: In [3]: user_ ...

  9. 最近用到js筛选一个url的域名部分(草创)

    var TLD = ['com','net','org','gov','edu','mil','biz','name','info','mobi','cn','hk']; var host = ''; ...

  10. 动态加载jQuery

    success: function(data){ for(var i in data){ $('.x-details>ul:eq(0)').append("<li>&quo ...