This repository contains several patch files that modify the xv6 operating system. These modifications were made for CSE314 (Operating System Sessional) course at BUET. The detailed specifications for patches can be found in the corresponding folders.
- Added system calls and
!!command - Implemented multi-level feedback queue scheduling
- Implemented threading and synchronization support
This is the repo on which patches have to be applied:
git clone https://github.com/shuaibw/xv6-riscv --depth=1Alternatively:
git clone https://github.com/mit-pdos/xv6-riscv
cd xv6-riscv
git reset --hard dd2574bc1097a912e799340172b8b6ef42ac5cebmake qemu
make clean
git add --all; git diff HEAD > <patch file name>
git apply --whitespace=fix <patch file name>
git clean -fdx; git reset --hard
-
trace: This system call monitors traces the system call (whose id was provided as an argument) made by a processtrace 5 grep hello README pid: 4, syscall: read, args: (3, 0x0000000000001010, 1023), return: 1023 pid: 4, syscall: read, args: (3, 0x000000000000103a, 981), return: 981 pid: 4, syscall: read, args: (3, 0x0000000000001023, 1004), return: 350 pid: 4, syscall: read, args: (3, 0x0000000000001010, 1023), return: 0 -
System call named
infothat returns the aggregated information of currently running processes asstruct procInfo; design of aloaduser program that creates some processes, allocates memory and usesinfo.struct procInfo { int activeProcess; // # of processes in RUNNABLE and RUNNING state int totalProcess; // # of total possible processes int memsize; // in bytes; summation of all active process int totalMemSize; // in bytes; all available physical Memory };
-
Implementation of
!!command and!! ncommand wherenis a positive integer. Implemented by storing previously executed commands in kernel space. Used system calls to set and get the desired command.
- Multi Level Feedback Queue
- 2 queues
- Round Robin Scheduling in lower priority queue
- Lottery Scheduling in higher priority queue
- Implemented threading support and relevant system calls.
- Implemented synchronization primitives:
spinlockandmutex.