Objective Create a module mtest. When it is loaded into the kernel, a proc file /proc/mtest is created. The file accepts parameters as following: listvma: print all virtual addresses of all processes in the format of start-addr end-addr permission. findpage addr: print the corresponding physical address of virtual address addr. If no such translation exists, print translation not found. writeval addr val: try to write val to addr.
Objective Create an entry ctx for each process. It is initialized with 0 and will increase by 1 whenever the process runs. One can see the value of it using cat /proc/<pid>/ctx.The target is to know how the scheduler works with this kind of interactive process.
```py from future import annotations from itertools import tee, chain from typing import TypeVar, Tuple from collections.abc import Iterator
So I get the shell of DIR-867. I didn’t do that on purpose, it was a project of one of my courses. Anyway, let’s hop in.