[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>OS实验2-5 课堂练习2.3:系统调用
<>第1关:版本1内核执行的前 3 个系统调用
<>本关任务:
<>解题过程:
<>1.跟踪到系统调用发生
系统调用的总控函数是 system_call ,只要在这里设断点,即可捕获系统调用的发生
<>2.查找系统调用的编号与名字
系统调用发生时系统调用号存放在寄存器 eax 中,编号与名字对应关系可在文件unistd.h中查到
在地址 0x7780 这里会调用系统调用的实现函数,故执行完毕0x7780处指令后会进入具体的系统调用函数
可直接在0x7780处设置断点,同时设置命令查看eax寄存器及进入具体调用函数
注意:答案中系统调用名字不加下划线前缀:即sys_fork在填写时应写为fork
<>第2关:命令 ls 执行的系统调用
<>本关任务:
<>解题过程:
<>1.跟踪到ls命令发生
在do_execve函数处设置断点
同时设置命令,显示当前执行文件名
一直continue到虚拟机等待输入为止
此时虚拟机输入ls命令执行
<>2.查找ls执行的系统调用编号与名字
在系统调用函数处设置断点,同时设置命令展示寄存器中编号值,以及调用函数查看对应函数名
注意:在exit函数后,current->pid发生改变,之后函数已不再是6号进程ls调用
<>补充知识
* do_execve函数负责可执行程序的加载和运行
* sys_call_table为系统调用表,系统调用程序system_call会查找系统调用表以获得系统调用号对应的系统调用,并执行