This is a study project to implement Lottery Scheduling and Stride Scheduling into the XV6 OS.
- QEMU for virtualization.
- gcc v11
- libc6-dev-i386
- make
The project uses make to automate the building proccess, some of the availables commands are:
make # Compile the source
make clean # Remove build files
make qemu # Build the source and start virtualization with qemu using a graphical interface
make qemu-nox # Bould the source and start the virtualization in the terminal
Both Stride Schedule and Lottery Schedule can be accessed at their respective branches stride-scheduling and lottery-scheduling.
Alternatively, you can use one of the diff files: 0001-Stride-scheduling.diff and 0001-Lottery-scheduling.diff.
To apply a diff run the git command:
git apply <diff-file>
# Being:
git apply 0001-Stride-scheduling.diff # For stride scheduling
git apply 0001-Lottery-scheduling.diff # For lottery scheduling
Note that this will not add any commits or stage the changes in the git repository. Trying to merge both will generate a conflicts, the implementations are not mean to, and cannot be used together.
A easy way to revert the diff (if not staged):
git restore .
Learn more about diff patches on:
XV6 will bahave similar to a unix like OS in a very minimal way.
To see the scheduling in actions (if you applied the diffs) you can run schedulingtest
and see something like this:
$ schedulingtest
> schedulingtest - the next lines should be displayed in order
> 1 - proccess finished.
> 2 - proccess finished.
> 3 - proccess finished.
As described, if the number of the proccess are in order it means that the scheduler worked.
The command schedulingtest
will run the schedulingtest.c, which can only be seeing in one of the branches or diffs. This file contains the logic to run forks assigning to each a different number of tickets, giving priotiry to respectively the first, second and thirt proccess.