# ostep-homework **Repository Path**: trace1729/ostep-homework ## Basic Information - **Project Name**: ostep-homework - **Description**: 操作系统导论附带代码 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: dev-zhongyl - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 8 - **Created**: 2023-08-27 - **Last Updated**: 2023-08-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Homeworks Each chapter has some questions at the end; we call these "homeworks", because you should do the "work" at your "home". Make sense? It's one of the innovations of this book. 每章最后都有一些问题;我们称这些为“家庭作业”,因为你应该在你的“家”做“工作”。有道理?这是本书的创新之一。 Homeworks can be used to solidify your knowledge of the material in each of the chapters. Many homeworks are based on running a simulator, which mimic some aspect of an operating system. For example, a disk scheduling simulator could be useful in understanding how different disk scheduling algorithms work. Some other homeworks are just short programming exercises, allowing you to explore how real systems work. 家庭作业可用于巩固您对每一章材料的了解。许多作业都基于运行模拟器,模拟操作系统的某些方面。例如,磁盘调度模拟器可能有助于理解不同磁盘调度算法的工作方式。其他一些作业只是简短的编程练习,可让您探索真实系统的工作方式。 For the simulators, the basic idea is simple: each of the simulators below let you both generate problems and obtain solutions for an infinite number of problems. Different random seeds can usually be used to generate different problems; using the `-c` flag computes the answers for you (presumably after you have tried to compute them yourself!). 对于模拟器,基本思想很简单:下面的每个模拟器都可以让您生成问题并获得无限数量问题的解决方案。不同的随机种子通常可以用来产生不同的问题;使用 -c 标志为您计算答案(大概是在您尝试自己计算之后!)。 Each homework included below has a README file that explains what to do. Previously, this material had been included in the chapters themselves, but that was making the book too long. Now, all that is left in the book are the questions you might want to answer with the simulator; the details on how to run code are all in the README. 下面包含的每个作业都有一个 README 文件,说明要做什么。以前,这些材料已包含在章节本身中,但这使本书太长了。现在,本书剩下的就是您可能想用模拟器回答的问题;关于如何运行代码的详细信息都在 README 中。 Thus, your task: read a chapter, look at the questions at the end of the chapter, and try to answer them by doing the homework. Some require a simulator (written in Python); those are available by below. Some others require you to write some code. At this point, reading the relevant README is a good idea. Still others require some other stuff, like writing C code to accomplish some task. 因此,您的任务是:阅读一章,查看该章末尾的问题,并尝试通过做功课来回答这些问题。有些需要模拟器(用 Python 编写);这些可以通过以下方式获得。其他一些要求您编写一些代码。在这一点上,阅读相关的 README 是个好主意。还有一些需要一些其他的东西,比如编写 C 代码来完成一些任务。 To use these, the best thing to do is to clone the homeworks. For example: 要使用这些,最好的办法是克隆作业。例如: ```sh prompt> git clone https://github.com/remzi-arpacidusseau/ostep-homework/ prompt> cd file-disks prompt> ./disk.py -h ``` # Introduction Chapter | What To Do --------|----------- [Introduction](http://www.cs.wisc.edu/~remzi/OSTEP/intro.pdf)                         | No homework (yet) # Virtualization Chapter | What To Do --------|----------- [Abstraction: Processes](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-intro.pdf) | Run [process-run.py](cpu-intro) [Process API](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-api.pdf) | Run [fork.py](cpu-api) and write some code [Direct Execution](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf) | Write some code [Scheduling Basics](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-sched.pdf) | Run [scheduler.py](cpu-sched) [MLFQ Scheduling](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-sched-mlfq.pdf) | Run [mlfq.py](cpu-sched-mlfq) [Lottery Scheduling](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-sched-lottery.pdf) | Run [lottery.py](cpu-sched-lottery) [Multiprocessor Scheduling](http://www.cs.wisc.edu/~remzi/OSTEP/cpu-sched-multi.pdf) | Run [multi.py](cpu-sched-multi) [Abstraction: Address Spaces](http://www.cs.wisc.edu/~remzi/OSTEP/vm-intro.pdf) | Write some code [VM API](http://www.cs.wisc.edu/~remzi/OSTEP/vm-api.pdf) | Write some code [Relocation](http://www.cs.wisc.edu/~remzi/OSTEP/vm-mechanism.pdf) | Run [relocation.py](vm-mechanism) [Segmentation](http://www.cs.wisc.edu/~remzi/OSTEP/vm-segmentation.pdf) | Run [segmentation.py](vm-segmentation) [Free Space](http://www.cs.wisc.edu/~remzi/OSTEP/vm-freespace.pdf) | Run [malloc.py](vm-freespace) [Paging](http://www.cs.wisc.edu/~remzi/OSTEP/vm-paging.pdf) | Run [paging-linear-translate.py](vm-paging) [TLBs](http://www.cs.wisc.edu/~remzi/OSTEP/vm-tlbs.pdf) | Write some code [Multi-level Paging](http://www.cs.wisc.edu/~remzi/OSTEP/vm-smalltables.pdf) | Run [paging-multilevel-translate.py](vm-smalltables) [Paging Mechanism](http://www.cs.wisc.edu/~remzi/OSTEP/vm-beyondphys.pdf) | Run [mem.c](vm-beyondphys) [Paging Policy](http://www.cs.wisc.edu/~remzi/OSTEP/vm-beyondphys-policy.pdf) | Run [paging-policy.py](vm-beyondphys-policy) [Complete VM](http://www.cs.wisc.edu/~remzi/OSTEP/vm-complete.pdf) | No homework (yet) # Concurrency Chapter | What To Do --------|----------- [Threads Intro](http://www.cs.wisc.edu/~remzi/OSTEP/threads-intro.pdf) | Run [x86.py](threads-intro) [Thread API](http://www.cs.wisc.edu/~remzi/OSTEP/threads-api.pdf) | Run [some C code](threads-api) [Locks](http://www.cs.wisc.edu/~remzi/OSTEP/threads-locks.pdf) | Run [x86.py](threads-locks) [Lock Usage](http://www.cs.wisc.edu/~remzi/OSTEP/threads-locks-usage.pdf) | Write some code [Condition Variables](http://www.cs.wisc.edu/~remzi/OSTEP/threads-cv.pdf) | Run [some C code](threads-cv) [Semaphores](http://www.cs.wisc.edu/~remzi/OSTEP/threads-sema.pdf) | Read and write [some code](threads-sema) [Concurrency Bugs](http://www.cs.wisc.edu/~remzi/OSTEP/threads-bugs.pdf) | Run [some C code](threads-bugs) [Event-based Concurrency](http://www.cs.wisc.edu/~remzi/OSTEP/threads-events.pdf) | Write some code # Persistence Chapter | What To Do --------|----------- [I/O Devices](http://www.cs.wisc.edu/~remzi/OSTEP/file-devices.pdf) | No homework (yet) [Hard Disk Drives](http://www.cs.wisc.edu/~remzi/OSTEP/file-disks.pdf) | Run [disk.py](file-disks) [RAID](http://www.cs.wisc.edu/~remzi/OSTEP/file-raid.pdf) | Run [raid.py](file-raid) [FS Intro](http://www.cs.wisc.edu/~remzi/OSTEP/file-intro.pdf) | Write some code [FS Implementation](http://www.cs.wisc.edu/~remzi/OSTEP/file-implementation.pdf) | Run [vsfs.py](file-implementation) [Fast File System](http://www.cs.wisc.edu/~remzi/OSTEP/file-ffs.pdf) | Run [ffs.py](file-ffs) [Crash Consistency and Journaling](http://www.cs.wisc.edu/~remzi/OSTEP/file-journaling.pdf) | Run [fsck.py](file-journaling) [Log-Structured File Systems](http://www.cs.wisc.edu/~remzi/OSTEP/file-lfs.pdf) | Run [lfs.py](file-lfs) [Solid-State Disk Drives](http://www.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf) | Run [ssd.py](file-ssd) [Data Integrity](http://www.cs.wisc.edu/~remzi/OSTEP/file-integrity.pdf) | Run [checksum.py](file-integrity) and Write some code [Distributed Intro](http://www.cs.wisc.edu/~remzi/OSTEP/dist-intro.pdf) | Write some code [NFS](http://www.cs.wisc.edu/~remzi/OSTEP/dist-nfs.pdf) | Write some analysis code [AFS](http://www.cs.wisc.edu/~remzi/OSTEP/dist-afs.pdf) | Run [afs.py](dist-afs)