Operating Systems 2 project that consists of adding page swapping and thrashing prevention in xv6 operating system.
Page swapping was done using an aproximation of LRU algorithm and thrashing prevention using workset monitoring.
It is further optimized with lazy allocation and copy-on-write (this was not mandatory for the project).
The modified files (in comparison to the original xv6) are:
- defs.h
- kalloc.c
- proc.c
- proc.h
- riscv.h
- trap.c
- virtio_disk.c
- vm.c
Most of the page-swapping logic is in the kalloc.c and vm.c files.
The system was developed in a virtual machine that simulates a riscv processor.
The full assignment in Serbian is in the file Projektni zadatak - 2024 v1.0.pdf.