This project enhances the XV6 operating system by implementing a lottery scheduler and introducing several custom system calls. This README provides an overview of the changes, commands, and files associated with the project.
This scheduler allocates CPU time to processes based on a lottery system, allowing for a more dynamic and fair distribution of resources.
We have implemented the following custom system calls to support the lottery scheduler:
SYS_nice
: Adjusts the priority (and hence, the ticket count) of a process.SYS_ps
: Retrieves information about running processes.SYS_resetticks
: Resets the ticks for the process specified.SYS_killifticks
: Kills a process after the process reaches a specific number of ticks.SYS_random
: Provides a system call to generate random numbers between two values.
You can build and test the project using the following commands:
make SCHEDPOLICY=LOTTERY
: Build XV6 with the lottery scheduler.make clean
: Before building with different scheduler policymake SCHEDPOLICY=DEFAULT
: Build XV6 with the default scheduler (Round Robin).make
: Build XV6 with the default scheduler.
make qemu-nox
: Enters xv6 terminal.
nice_test
: Observe changes in process priorities and explore edge cases.lottery_test
: Run multiple tests to assess the lottery scheduler's performance.randTest
: Test the random number generation system call.
syscall.h
syscall.c
sysproc.c
usys.S
defs.h
user.h
proc.h
proc.c
Makefile
lottery_test.c
nice.c
nice_test.c
scheduler_utils.c
randTest.c
- Build XV6 with your preferred scheduler using one of the provided
make
commands. - Execute tests such as
nice_test
,lottery_test
, andrandTest
to explore the lottery scheduler's functionality and the custom system calls. - Analyze the source code in the modified and new files to understand the implementation details.