[MIT 6.s081] Xv6 Lab 9: Locks Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/8/18: the second exercise in this article is not completely correct, and many other approaches exist. See my discussion with the author of this blog and the author’s new code based on that discussion. If I have time later, I will revise the second part and add comments. Update on 2022/9/14: I recently put the lab code on GitHu...
Solving Ordinary Differential Equations With the Runge-Kutta Method
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version.
[MIT 6.s081] Xv6 Lab 8: Networking Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 8: Networking The lab description is extremely long, although much of it introduces the E1000 network card. The final task is actually simple: i...
[MIT 6.s081] Xv6 Lab 7: Multithreading Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 7: Multithreading Uthread Implement user-mode threads. Because we are implementing user-mode multithreading, much of the design can follow th...
[MIT 6.s081] Xv6 Lab 6: Copy-on-Write Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 6: Copy-on-Write Fork for xv6 The lab description itself is remarkably brief because its main explanation appears immediately beforehand: Th...
[MIT 6.s081] Xv6 Lab 5 (2020): Lazy Page Allocation Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 5 (2020): lazy page allocation Eliminate allocation from sbrk() Remove the part of the sbrk() system call that actually allocates memory. The...
[MIT 6.s081] Xv6 Lab 4: Traps Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Preface: today is 2022/7/25, so first I want to celebrate the blog having operated for 100 days. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 4: traps RISC-V assembly Postponed for now. Ba...
CC (CodeChef) STARTERS 48 Solutions
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Accurate XOR Approach Problem link This problem uses a property of XOR. When XORing multiple consecutive 0s or 1s, only an odd number of 1s makes the result 1. If there are an even number of 1s, every 1 can always be paired with another 1 so that their XOR becomes 0. The occurrence of 0 does not affect the final result, so if there are an ev...
CF1705 B, C, D1 Solutions
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. B. Making Towers Approach Observe the figure provided for the first sample in the problem statement: We can see that, if we want blocks of one color to form a tower, unless multiple blocks of the same color are adjacent in array ccc and can be placed directly upward, we must place some blocks of other colors to both sides after placing a bl...
CF1705 C, D Solutions
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. C. Mark and His Unfinished Essay Approach Given these constraints, we obviously cannot actually copy the string, so we need to find another method. We can see that every segment newly appended to the end of the string has an identical counterpart earlier in the string, located by an offset. For example, consider the final insertion in the fi...
[MIT 6.s081] Xv6 Lab 3 (2021): Page Tables Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Note: the basic knowledge related to page tables is discussed in this article, which you can use as a reference. Lab 3: page tables Speed up system ...
CF1703 F, G Solutions
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. F. Yet Another Problem About Pairs Satisfying an Inequality Approach (from the Official Solution) Observe the inequality ai<i<aj<ja_i < i < a_j < jai<i<aj<j in the problem. We can see that, for any element in the array, if it does not satisfy ax<xa_x < xax<x, then it can never form a valid pair with any...
![[MIT 6.s081] Xv6 Lab 9: Locks Record](/img/xv6/note/xv6%E4%B9%A6%E5%B0%81%E9%9D%A2.png)






![[Stanford CS144] Lab 4 Record](/img/CS144/tcp%E7%8A%B6%E6%80%81%E6%B5%81%E8%BD%AC%E5%9B%BE.jpg)