随笔分类 -  6.1810 / Lab_6.1810

摘要:Lab: mmap (hard) 一、要求 只要求实现mmap功能的子集,即对文件进行内存映射 mmap说明 void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset); map:成功时, 返回map的虚 阅读全文
posted @ 2024-04-21 00:16 INnoVation-V2 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1. Large files (moderate) xv6中,一个block大小为1024b,块编号需要4b表示,所以一个块最多容纳256个块编号。 当前 xv6 单个文件最多有12个直接块和一个间接块,一个间接块最多放置256个块,一共268个块。 目标:单个文件增大到65803个块,即需要增加一 阅读全文
posted @ 2024-04-21 00:16 INnoVation-V2 阅读(11) 评论(0) 推荐(0) 编辑
摘要:Uthread: switching between threads (moderate) Riscv32 Callee寄存器 Name ABI Name Description Saver x0 zero Zero - x1 ra Return address Caller x2 sp Stack 阅读全文
posted @ 2024-04-21 00:15 INnoVation-V2 阅读(6) 评论(0) 推荐(0) 编辑
摘要:Memory allocator (moderate) 代码地址 https://github.com/INnoVationv2/xv6-labs-2023/commit/6a93f5a9a5fca0627f9d44f185a33f30f3b8cd16 Buffer cache (hard) 创建多 阅读全文
posted @ 2024-04-21 00:14 INnoVation-V2 阅读(11) 评论(0) 推荐(0) 编辑
摘要:学习流程 QEMU模仿的是82540EM 一、LAB说明 1. 背景 将使用一个名为 E1000 的网卡来处理网络通信。xv6是qemu模拟的硬件,连接到一个同样由 QEMU 模拟的 LAN。在这个仿真LAN上,xv6的IP地址是10.0.2.15。同时,Qemu将运行qemu的宿主的ip地址设置为 阅读全文
posted @ 2024-04-21 00:12 INnoVation-V2 阅读(34) 评论(0) 推荐(0) 编辑
摘要:LAB-5 COW 主要是修改fork和缺页中断处理程序 以前fork时,会直接复制原进程的页表内容到新页表,具体过程是 ​ 对于原页表中的每一页,malloc一个新页,然后复制数据到新页,最后把这一页映射到新页表 现在进行修改: 1. fork复制页表 对于新进程,为其创建新页表 直接复用旧页表项 阅读全文
posted @ 2024-04-21 00:11 INnoVation-V2 阅读(21) 评论(0) 推荐(0) 编辑
摘要:Backtrace 注意栈帧的结构就很简单 Alarm (hard) sys_sigalarm 解决思路 保存时钟周期和handler地址 每次发生时钟中断时,计数一次,经过n个时钟周期,就调用handler函数 但是handler函数位于用户态 需要跳转到用户态执行handler 然后跳转回来继续 阅读全文
posted @ 2024-04-21 00:10 INnoVation-V2 阅读(10) 评论(0) 推荐(0) 编辑
摘要:Lab: page tables 1.Speed up system calls (easy) 加速getpid()系统调用速度 映射一页在USYSCALL位置,向其中写入一个结构体 struct usyscall { int pid; // Process ID }; 赋予用户态只读权限 代码:g 阅读全文
posted @ 2024-04-20 23:58 INnoVation-V2 阅读(64) 评论(0) 推荐(0) 编辑
摘要:Lab: system calls 1.Using gdb (easy) 打开两个shell,都进入xv6文件夹 第一个shell输入 make qemu-gdb 第二个shell输入 riscv64-unknown-elf-gdb Looking at the backtrace output, 阅读全文
posted @ 2024-04-20 23:57 INnoVation-V2 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Lab: utilities 1.Sleep 代码:github 2.pingpong 代码:github 3.primes 代码:github 需要注意父子进程的管道阻塞问题,之前写过一个相关博客 https://www.cnblogs.com/INnoVationv2/p/16700899.ht 阅读全文
posted @ 2024-01-18 19:24 INnoVation-V2 阅读(29) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示