MIT 6.S081 Lab util
Compulsory exercises
Lab guidance
Boot xv6 (easy)
- 
启动xv6
 
在shell中
1  | cd xv6-labs-2021  | 
在xv6 shell中列出文件
1  | ls  | 
在xv6中
Ctrl-p 打印进程信息
Ctrl-a x 退出qemu
sleep (easy)
- 
了解系统调用
 - 
代码实现
 
        code
    
    1  | // sleep.c  | 
- 
补全Makefile
 
1  | $U/_sleep\  | 
- 
测试
 
1  | cd xv6-labs-2021  | 
pingpong (easy)
- 
图解


 - 
代码实现
 
        code
    
    1  | // pingpong.c  | 
primes (moderate)/(hard)
- 
图解

 - 
根据分析需要使用两个管道分别用于左邻居和右邻居
 - 
代码实现
 
        code
    
    1  | // primes.c  | 
find (moderate)
- 
阅读ls.c了解文件系统
 - 
代码实现
 
        code
    
    1  | 
  | 
xargs (moderate)
- 
了解xargs
- 教程
 - 要求实现简易的xarg,即实现下列命令行调用
 
 
1  | find . b | xargs grep hello  | 
- 
代码实现(reference)
 
        code
    
    1  | 
  | 
Optional challenge exercises
- 
Write an uptime program that prints the uptime in terms of ticks using the uptime system call. (easy)
 - 
Support regular expressions in name matching for find. grep.c has some primitive support for regular expressions. (easy)
 - 
The xv6 shell (user/sh.c) is just another user program and you can improve it.
 

