
Xv6
文章平均质量分 88
CDFMLR
Could Devils Find My Lovely Rabbit?
展开
-
Xv6 文件系统
Xv6 文件系统学习: xv6-riscv-book Chapter 8 File system文件系统:目的:组织和储存文件一般支持:在用户和应用之间共享数据持久化:重启后,数据仍可用实现难点:在磁盘上的数据结构:文件、目录、记录错误恢复多个不同的进程可能同时操作文件系统访问磁盘的速度比内存慢,文件系统应该用内存对热门块做缓存Xv6 文件系统总览七层实现:disk 层:从设备(virtio haed drive)读写磁盘块buffer cache.原创 2021-05-11 15:32:06 · 1028 阅读 · 0 评论 -
6.S081 Xv6 Lab Multithreading
6.S081 Xv6 Lab: MultithreadingLab: Multithreading of MIT 6.S081 Fall 2020$ git fetch$ git checkout thread$ make cleanUthread: switching between threads这个题有意思的,手写用户线程的实现。做起来不难,大体框架人家都给了,自己只要实现一下上下文切换。首先在 notxv6/uthread.c 里面补充定义一个「线程上下文」:// saved.原创 2021-05-01 11:44:26 · 2909 阅读 · 3 评论 -
Xv6 调度
Xv6 SchedulingLearning xv6-riscv-book Chapter 7 Schedulingtime-share the CPUs: run more processes than CPUstransparent to user processesmultiplexing processes onto CPUs:illusion: each process has its own virtual CPUMultiplexingSwitching CPU .原创 2021-04-25 16:08:26 · 298 阅读 · 0 评论 -
Xv6 Locking
LockingLearning xv6-riscv-book Chapter 5 LockingConcurrency: situations in which multiple instruction sreams are interleaved, due to multiprocessor parallelism, threasd switching, or interrupts.Concurrency control: strategies aimed at correctness und.原创 2021-04-09 09:13:25 · 462 阅读 · 0 评论 -
6.S081 Xv6 Lab 5: lazy page allocation
Lab: xv6 lazy page allocationhttps://pdos.csail.mit.edu/6.S081/2020/labs/lazy.html新的 2020 版哦。$ git fetch$ git checkout lazy$ make cleanEliminate allocation from sbrk()就是把 sys_sbrk 里的 growproc 调用删了,等用到的时候再去分配内存。如果是空间减小,要取消分配。uint64sys_sbrk(void.原创 2021-04-03 13:23:07 · 1552 阅读 · 0 评论 -
Xv6 Interrupts and device drivers
date: 2021-03-29 16:36:49.049839title: Xv6 Interrupts and device driversXv6 Interrupts and device driversLearning: xv6-riscv-book Chapter 5 Interrupts and device driversDriver:code in an OSmanages a particular deviceconfig hardwaretells opera.原创 2021-03-30 13:35:10 · 226 阅读 · 0 评论 -
6.S081 Xv6 Lab 4 traps
Lab: traps6.S081 的 Xv6 RISC-V Lab traps,实验内容:https://pdos.csail.mit.edu/6.S081/2020/labs/traps.html$ git fetch$ git checkout traps$ make cleanRISC-V assembly这题没什么具体要做的,就看一看,跟着题目学一下 RISC- V 汇编。Backtrace这题主要是实现打印函数栈。就是 GDB 里面 bt 的这种效果:(gdb) bt.原创 2021-03-28 12:58:40 · 2581 阅读 · 2 评论 -
Xv6 traps and system calls
Trap: CPU transfer to speical code to handle eventssystem call exception interruptTraps and system callsRISC-V trap machineryRegistershardware trap handling sequenceTraps from user spaceuservecusertrapusertrapretuserretCalling system callsSys原创 2021-03-18 22:14:40 · 544 阅读 · 0 评论 -
6.S081 Xv6 Lab 3: page tables
Lab: page tablesMIT 6.S081 Xv6-riscv Lab 3: https://pdos.csail.mit.edu/6.S081/2020/labs/pgtbl.htmlIn this lab you will explore page tables and modify them to simplify the functions that copy data from user space to kernel space.Print a page tableDef.原创 2021-03-12 17:31:29 · 6873 阅读 · 4 评论 -
Xv6 Page Table
Xv6 Page TableLearning xv6-riscv-book Chapter 3 Page tablesXv6 Page TablePaging hardwareKernel address spaceCreating an address spacePhysical memory allocationPhysical memory allocatorProcess address spacesbrkexec原创 2021-03-09 12:37:55 · 816 阅读 · 0 评论 -
6.S081 Xv6 Lab 2: system calls
Lab: system callsFrom: https://pdos.csail.mit.edu/6.S081/2020/labs/syscall.html【NOTE】Add a new system callTo add a new system call, say, named xxx:add a prototype for the system call to user/user.hint xxx(int)add a stub to user/usys.plentry(.原创 2021-03-02 15:25:01 · 2188 阅读 · 0 评论 -
Xv6 Operating System Organization
Operating System OrganizationAbstracting physical resourcesUser mode, supervisor mode, and system callsKernel organizationXv6 organizationProcess overviewProcessThreadVirtual addressSystem callStarting xv6 and the first process原创 2021-02-27 21:19:00 · 301 阅读 · 0 评论 -
6.S081 Lab 1: Xv6 and Unix utilities
date: 2021-02-24 15:03:34.892093tags: xv6title: Xv6 Lab Utilities[外链图片转存失败,源站可能有防盗Meaning Unknown’s Head Image]!链机制,建上https://传(imb2og.csdnimg.cn/img_convert/3af2d2e80V15601e5b62fb41b7f9a42093.pg)(https://tva1.sinaimg.cn/large/0072Vf1pgy1fodqj0k1d4j31k.原创 2021-02-24 15:12:59 · 978 阅读 · 6 评论 -
Xv6 文件系统接口
Xv6 文件系统接口文件系统调用System callDescriptionint chdir(char *dir)改变当前目录int mkdir(char *dir)创建新目录int open(char *file, O_CREATE)创建新文件int mknod(char *file, int, int)创建新的设备文件(后两个参数是主设备号、次设备号,这两个数在内核中唯一确定一个设备),对设备文件的 read、write 会转发给设备,而不操作文件系.原创 2021-02-21 14:53:29 · 161 阅读 · 0 评论 -
Xv6 管道
Xv6 管道参考: xv6-riscv-book 1.3 Pipes文章目录Xv6 管道pipe管道 V.S. 临时文件pipeXv6 系统调用 pipe() 来创建管道。管道类似于 Go 语言中的 chan。在 Shell 里我们用 | 表示管道,对于命令: echo "hello world" | wc,可以用如下代码实现:// upipe.c//// Runs the program wc with standard input connected to the read end .原创 2021-02-20 14:19:18 · 1322 阅读 · 0 评论 -
Xv6 I/O 与文件描述符
Xv6 I/O 与文件描述符Xv6 I/O 系统调用Xv6 文件描述符read & write重定向的实现共享偏移dup原创 2021-02-18 17:43:29 · 886 阅读 · 0 评论 -
Xv6 多进程编程
本文参考 xv6-riscv-book,介绍如何使用 Xv6 系统调用,实现多进程编程。把书上的代码完整化,并附上真实系统中的实现方式fork exit wait exec原创 2021-02-18 11:50:52 · 405 阅读 · 0 评论 -
Xv6 编写用户程序
如何在 Xv6(xv6-riscv)中添加自己编写的用户程序,比如实现一个 helloworld?1. 编写代码2. 修改 Makefile3. 编译运行 Xv6原创 2021-02-17 17:58:58 · 2312 阅读 · 0 评论 -
Xv6 编译运行
本文介绍在 macOS 下搭建环境、编译运行 6.S081 课程的 mit-pdos/xv6-riscv 系统。Xv6 编译运行工具安装测试安装编译运行退出系统原创 2021-02-17 13:03:35 · 865 阅读 · 6 评论