1、lab2的内容总结:关于系统调用整个跟踪过程: 使用系统调用时,用户态会通过软中断(trap,陷阱)进入内核中,由trap识别中断来自系统调用,然后调用syscall函数, 跟踪过程: 1、打开gdb: 2、跟踪用户态trace执行过程: 首先执行以下两条指令,为trace的main函数打上断点 file user/_trace b main 三次c之后成功进入trace...
在lab2里面,你需要添加一个自己的系统调用,然后给user目录提供出去标准接口,以此,我来解释一下整个流程。 刚才我们说了,你需要向外提供接口。作为用户来说,用户不需要考虑实现细节,只要根据文档来写,就应该可以正常使用。像一些需求,比如系统资源使用率、在当前文件夹下创建一个新的文件等这些需求,我们不希望用户可以...
1.实验 (1)Usinggdb 略 (2) System call tracing 根据hints 来写基本上就没什么问题。主要代码如下: uint64sys_trace(void){//memset(&mask, 0, sizeof(mask));argint(0,&mask);return0;} 其中mask是定义在syscall.c里面的一个全局变量,argint则是获取参数的函数,其中在syscall.c中的修改如下: void sy...
While GDB can only access QEMU's memory by virtual address, it's often useful to be able to inspect physical memory while setting up virtual memory. Review the QEMU monitor commands from the lab tools guide, especially the xp command, which lets you inspect physical memory. To access the ...
对我来说,最大的收获是能够从代码角度深入理解页表的具体实现,用GDB调试汇编代码中的错误,以及详细了解文件系统中的各个组成部分。 每个项目的代码量都不大,很多项目甚至只需要不到20行的改动。但有时候锁的使用不当会导致程序卡住,或者忘记释放分配的内存。 🌟🌟🌟 Lab Page Tables 这个项目让我对虚拟地址和...
set architecture riscv:rv64 -- fix gdb trampoline disassembly, thanks… Sep 12, 2019 .gitignore COW lab Oct 1, 2020 LICENSE x Jul 24, 2019 Makefile implemented cow~ May 14, 2022 README copyright and 6.S081 Aug 11, 2020 grade-lab-cow COW lab Oct 1, 2020 ...
set architecture riscv:rv64 -- fix gdb trampoline disassembly, thanks… Sep 12, 2019 .gitignore util lab Aug 19, 2020 LICENSE x Jul 24, 2019 Makefile finish lab01 Jul 9, 2024 README.md add README Aug 14, 2024 barrier add README ...
for(int level = 2; level > 0; level--) { pte_t *pte = &pagetable[PX(level, va)]; // 若当前 PTE 是可用的 if(*pte & PTE_V) { // 更新成下一级页表的物理地址 pagetable = (pagetable_t)PTE2PA(*pte); // 若不可用就根据 alloc 参数来决定是否新分配一个下一级页表 ...
MIT_6.s081_Lab1:Xv6 and Unix utilities 于2022年3月1日2022年3月1日由Sukuna发布 运行环境:Ubuntu20.04 qemu 在做6.s081的实验之前我们首先要先下载Xv6操作系统以及qemu虚拟机: 代码语言:javascript 复制 sudo apt-getinstall git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binu...
Xv6 Lab1 环境: Ubuntu 20.04 LTS 一开始没啥好说的,按照官方的文档 https://github.com/mit-pdos/xv6-public https://pdos.csail.mit.edu/6.828/2020/tools.html 执行 sudo apt-getinstall git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu...