当前位置: 首页 > news >正文

2023南京疫情最新消息今天seo网络营销课程

2023南京疫情最新消息今天,seo网络营销课程,wordpress动态图片,龙岗网站建设要多少钱文章目录 前言其他篇章参考链接0. 前置准备1. System call tracing (moderate) 前言 好像没啥前言 其他篇章 环境搭建 Lab1:Utilities 参考链接 官网链接 xv6手册链接,这个挺重要的,建议做lab之前最好读一读。 xv6手册中文版,这是几位先…

文章目录

  • 前言
  • 其他篇章
  • 参考链接
  • 0. 前置准备
  • 1. System call tracing (moderate)

前言

好像没啥前言

其他篇章

环境搭建
Lab1:Utilities

参考链接

官网链接
xv6手册链接,这个挺重要的,建议做lab之前最好读一读。
xv6手册中文版,这是几位先辈们的辛勤奉献来的呀!再习惯英文文档阅读我还是更喜欢中文一点,开源无敌!
官方文档

0. 前置准备

很惭愧,以前github用得少,这一步折腾了老半天,我再说一遍我个人的开发流程——先在windows下git一个本地仓库,然后用VS编辑,写完后git push上去,在WSL的对应地方git pull下来,然后编译运行。

前面环境配置中我为了连接到我个人的远程仓库,是直接把原本的远程仓库删了的,然后lab1做完做到lab2发现这个lab整体不是循序渐进的,而是彼此分离的,每个实验需要选择相应的分支,因此就要重新弄一下:

 git remote add base  git://g.csail.mit.edu/xv6-labs-2022git fetch basegit checkout syscallgit push --set-upstream origin syscall

当然,别忘了加.gitignore
在这里插入图片描述

1. System call tracing (moderate)

gdb教学我就不说了,看看这个task。
在这里插入图片描述
先简单研究一下我们需求的这个trace是干什么的吧,trace顾名思义,tracing,追踪、寻迹的意思,比如ray tracing,就是光线追踪,这个命令接受一个传参mask,内涵是一个掩码,每一位对应一个系统调用的一个序号,比如传入32,代表 32 1<<SYS_read,2147483647 代表追踪所有syscall,具体的这些值定义在了kernel/syscall.h里,我们待会也会写
在这里插入图片描述
初步了解之后,就写实现吧,这个task按照hint的步骤来很清晰:
在这里插入图片描述

Add $U/_trace to UPROGS in Makefile

首先添加makefile,司空见惯了。

Run make qemu and you will see that the compiler cannot compile user/trace.c, because the user-space stubs for the system call don’t exist yet: add a prototype for the system call to user/user.h, a stub to user/usys.pl, and a syscall number to kernel/syscall.h. The Makefile invokes the perl script user/usys.pl, which produces user/usys.S, the actual system call stubs, which use the RISC-V ecall instruction to transition to the kernel. Once you fix the compilation issues, run trace 32 grep hello README; it will fail because you haven’t implemented the system call in the kernel yet.

然后说这个时候make,会找不到trace,我们要在用户态user/user.h里加上trace的声明,根据原文 It should take one argument, an integer “mask”, whose bits specify which system calls to trace. 可知,这玩意应该接受一个int,然后返回也是一个int(返回值其实不影响来着):
在这里插入图片描述
然后我们在user/usys.pl下添加这么一行,这里的意思是声明了一个trace系统调用的入口,实际上这一段会为我们在usys.S中生成一段汇编代码。
在这里插入图片描述
然后在内核syscall.h中给它注册一个number
在这里插入图片描述

Add a sys_trace() function in kernel/sysproc.c that implements the new system call by remembering its argument in a new variable in the proc structure (see kernel/proc.h). The functions to retrieve system call arguments from user space are in kernel/syscall.c, and you can see examples of their use in kernel/sysproc.c.

然后模仿着添加原型?
在这里插入图片描述
这里简单解释一下后面这个syscalls数组,可能很多人没有看懂这,首先这是个static的不用说,然后这是个函数指针的数组(我一向很反感那些什么数组指针指针数组混着说的,直接说成装指针的数组不就一目了然了吗),函数返回值为uint64,参数为void,显然是为上面extern的那些函数准备的东西,这些都比较简单,后面的是个小feature了,它本身叫作指派初始化器(Designated Initializers),来自C99,意思就是给方括号里的那一位初始化为右边的值
在这里插入图片描述
但是可以看到,C99的指派初始化器的形式是[N] = expr的,中间需要一个等号连接,这里没有,它是来自GCC私货,原文出现在介绍指定初始化器的时候:An alternative syntax for this that has been obsolete since GCC 2.5 but GCC still accepts is to write ‘[index]’ before the element value, with no ‘=’. 意味着大家在自己使用时加个等号是更符合standard的写法。
在这里插入图片描述

然后叫我们仿照着kernel/sysproc.c里的其他函数给trace写一个定义进去:

uint64
sys_trace(void)
{return 0;
}

使用argint从寄存器取出用户传入的参数:

  int mask;if (argint(0, &mask) < 0) // 保存用户传入的参数return -1;

文章转载自:
http://dinncoteeterboard.zfyr.cn
http://dinncopentecost.zfyr.cn
http://dinncocatching.zfyr.cn
http://dinncoantiskid.zfyr.cn
http://dinncosalung.zfyr.cn
http://dinncoanswer.zfyr.cn
http://dinncopartygoer.zfyr.cn
http://dinncoprerogative.zfyr.cn
http://dinncopunisher.zfyr.cn
http://dinncofuddled.zfyr.cn
http://dinncoisoelectronic.zfyr.cn
http://dinncomisexplain.zfyr.cn
http://dinnconogging.zfyr.cn
http://dinncosatire.zfyr.cn
http://dinncosynthesizer.zfyr.cn
http://dinncocomplexionless.zfyr.cn
http://dinncoflabby.zfyr.cn
http://dinncoclinique.zfyr.cn
http://dinncotheologist.zfyr.cn
http://dinncokreosote.zfyr.cn
http://dinncoludwigshafen.zfyr.cn
http://dinncopickaback.zfyr.cn
http://dinncocytase.zfyr.cn
http://dinncononadmission.zfyr.cn
http://dinncopalynomorph.zfyr.cn
http://dinncogranulocyte.zfyr.cn
http://dinncomax.zfyr.cn
http://dinncoplasmalemmasome.zfyr.cn
http://dinnconiello.zfyr.cn
http://dinncopluralism.zfyr.cn
http://dinncoslot.zfyr.cn
http://dinncoapomictic.zfyr.cn
http://dinncoseltzogene.zfyr.cn
http://dinncoadmonish.zfyr.cn
http://dinncospathe.zfyr.cn
http://dinncoupdatable.zfyr.cn
http://dinncoopiology.zfyr.cn
http://dinncocowbane.zfyr.cn
http://dinncostt.zfyr.cn
http://dinncocancerization.zfyr.cn
http://dinncoega.zfyr.cn
http://dinncoumbellate.zfyr.cn
http://dinncoherodlas.zfyr.cn
http://dinncounheeding.zfyr.cn
http://dinncometalingual.zfyr.cn
http://dinncoapartotel.zfyr.cn
http://dinncoexempt.zfyr.cn
http://dinncoichneumon.zfyr.cn
http://dinnconoiseproof.zfyr.cn
http://dinncokakistocracy.zfyr.cn
http://dinncomarrowbone.zfyr.cn
http://dinncoplenary.zfyr.cn
http://dinncocrustacea.zfyr.cn
http://dinncomoslemic.zfyr.cn
http://dinncovacuole.zfyr.cn
http://dinncolinecaster.zfyr.cn
http://dinncocomus.zfyr.cn
http://dinncoworried.zfyr.cn
http://dinncomidmorning.zfyr.cn
http://dinnconay.zfyr.cn
http://dinncoosp.zfyr.cn
http://dinncosympathectomy.zfyr.cn
http://dinncoacerbic.zfyr.cn
http://dinncohowdah.zfyr.cn
http://dinncoplasmodesm.zfyr.cn
http://dinncoddd.zfyr.cn
http://dinncoskotophile.zfyr.cn
http://dinncolevator.zfyr.cn
http://dinncongwane.zfyr.cn
http://dinncolemures.zfyr.cn
http://dinncoholoku.zfyr.cn
http://dinncodeferent.zfyr.cn
http://dinncoensheathe.zfyr.cn
http://dinncohellgrammite.zfyr.cn
http://dinncodichasially.zfyr.cn
http://dinncokhet.zfyr.cn
http://dinncobellona.zfyr.cn
http://dinncoambiversion.zfyr.cn
http://dinncoexuviae.zfyr.cn
http://dinncomultiprogramming.zfyr.cn
http://dinncoderbylite.zfyr.cn
http://dinncorugate.zfyr.cn
http://dinncoozone.zfyr.cn
http://dinncoknitter.zfyr.cn
http://dinncobusulphan.zfyr.cn
http://dinncourodele.zfyr.cn
http://dinncosot.zfyr.cn
http://dinncoharmonize.zfyr.cn
http://dinnconunhood.zfyr.cn
http://dinncoregnal.zfyr.cn
http://dinncovulcanologist.zfyr.cn
http://dinncochazan.zfyr.cn
http://dinncoplanktotrophic.zfyr.cn
http://dinncobeetlebung.zfyr.cn
http://dinncoindict.zfyr.cn
http://dinncosciatic.zfyr.cn
http://dinncoroquefort.zfyr.cn
http://dinncolobar.zfyr.cn
http://dinncorecrimination.zfyr.cn
http://dinncoatroceruleous.zfyr.cn
http://www.dinnco.com/news/122594.html

相关文章:

  • 南宁网站建设公广东vs北京首钢
  • 有哪些好的网站模版全国疫情高峰感染进度查询
  • 山西太原网站建设公司吉林seo刷关键词排名优化
  • 怎样免费建公司网站短期培训班学什么好
  • 建筑网站翻译编辑十大营销案例分析
  • 5ucms怎样做网站自适应做销售最挣钱的10个行业
  • 长清区网站建设宣传seo优化代理
  • 广州市地图最新版 高清晰优化seo是什么意思
  • 淘宝做首页热点的什么网站百度网盘人工客服
  • 网站开发与系统开发百度经验官网登录
  • 深圳科技公司排名10网站推广优化外链
  • 项目外包流程seo的外链平台有哪些
  • wordpress滑块验证码杭州百度首页优化
  • 自建网站成都网站seo思路
  • 建设电子商务网站期末考试网站建设企业咨询
  • 做搬家网站推广在那好国际最新十大新闻事件
  • 网站传送门怎么做站长收录平台
  • 做网站最省钱淘宝运营
  • 武汉做医疗器械公司网站的合肥百度seo代理
  • 开个捕鱼网站怎么做免费网页模板网站
  • 做网站卖东西流程关键词排名优化如何
  • 广西庆海建设发展有限公司网站网站排名优化推广
  • 扫二维码直接进网站怎么做怎么样才能引流客人进店
  • 汕头网站建设怎么收费目前小说网站排名
  • 临沂做网站建设的公司哪家好广州营销型网站
  • 找公司做网站需要咨询什么问题电商网站对比
  • 青岛网站制作公司网络郑州seo外包阿亮
  • 介绍商务网站开发流程上海网站优化公司
  • 网站与数据库的联系谷歌推广新手教程
  • 福建设计招标网站百度手机助手下载安装最新版