6.822 Homework 8 User-level threads

作业地址 下载两个文件到 xv6 文件夹并在 Makefile 在 _forktest 后面加入下面的代码 1 2 3 _uthread: uthread.o uthread_switch.o $(LD) $(LDFLAGS) -N -e main -Ttext 0 -o _uthread uthread.o uthread_switch.o $(ULIB) $(OBJDUMP) -S _uthread > uthread.asm 并在 UPROGS 后面加入 _uthread 在重新编译后会遇到 panic

6.828 Homework 7 xv6 locking

作业地址 锁的实现 锁的结构 阅读 spinlock.h ,锁的结构如下: 1 2 3 4 5 6 7 8 9 10 // Mutual exclusion lock. struct spinlock { uint locked; // Is the lock held? // For debugging: char *name; // Name of lock. struct cpu *cpu; // The cpu holding the lock. uint pcs[10]; // The call

6.828 Lab 3 User Environments

实验地址 Part A: User Environments and Exception Handling 通过 inc/env.h 得知一个运行环境 Env 定义: 1 2 3 4 5 6 7 8 9 10 11 12 struct Env { struct Trapframe env_tf; // Saved registers struct Env *env_link; // Next free Env envid_t env_id; // Unique environment identifier envid_t env_parent_id; // env_id of this env's parent enum EnvType