Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 5.32 KB

lab.md

File metadata and controls

110 lines (80 loc) · 5.32 KB

xv6-labs-2020

MIT6.s081 麻省理工2020秋季学期操作系统工程(Operating System Engineering)实验。Windows 下成功编译运行。

🧀 课程资源汇总、课堂笔记、读书笔记:github/PiperLiu/CS-courses-notes/mit6.s081

本仓库来自 git clone git://g.csail.mit.edu/xv6-labs-2020

🧂如何安装

实验基于 xv6 操作系统(简化版 Unix version 6)。实验需要在类 unix 系统(MacOS/Linux)上安装 RISC-V versions of a couple different tools: QEMU 5.1, GDB 8.3, GCC, and Binutils 。官方安装说明在这里

我使用的是 WSL2 (Windows Subsystem for Linux 2)。

🌭首先检查版本
$ cat /etc/debian_version
bullseye/sid

$ cat /proc/version
Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

🍿然后安装工具
$ sudo apt-get update

$ sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu
$ sudo apt-get remove qemu-system-misc
$ sudo apt-get install qemu-system-misc=1:4.2-3ubuntu6

🥓如何使用

切换到相应作业分支,然后 make qemu 后 xv6 操作系统就自动运行起来了。

比如:

$ git checkout util
$ make qemu

...编译、执行...

xv6 kernel is booting

hart 2 starting
hart 1 starting
init: starting sh
$ 

此时我们可以输入 ls 命令,发现成功执行。

🥚作业索引

Lab: Xv6 and Unix utilities

Lab: system calls

Lab: page tables

Lab: traps

Lab: xv6 lazy page allocation

Lab: Copy-on-Write Fork for xv6

Lab: Multithreading

Lab: locks

Lab: file system

Lab: mmap

Lab: networking