Skip to content

Modifications made to xv6 operating system as part of CSE314 (Operating System Sessional) course of BUET

Notifications You must be signed in to change notification settings

OitijhyaHoque/os-xv6-mod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Operating System - xv6

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

How to Run

Repository

This is the repo on which patches have to be applied:

git clone https://github.com/shuaibw/xv6-riscv --depth=1

Alternatively:

git clone https://github.com/mit-pdos/xv6-riscv
cd xv6-riscv
git reset --hard dd2574bc1097a912e799340172b8b6ef42ac5ceb

Quick commands:

make 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

patch-1: System Calls

  • trace: This system call monitors traces the system call (whose id was provided as an argument) made by a process

    trace 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 info that returns the aggregated information of currently running processes as struct procInfo; design of a load user program that creates some processes, allocates memory and uses info.

    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 !! n command where n is a positive integer. Implemented by storing previously executed commands in kernel space. Used system calls to set and get the desired command.

patch-2: Scheduling

  • Multi Level Feedback Queue
  • 2 queues
  • Round Robin Scheduling in lower priority queue
  • Lottery Scheduling in higher priority queue

patch-3: Threading

  • Implemented threading support and relevant system calls.
  • Implemented synchronization primitives: spinlock and mutex.

About

Modifications made to xv6 operating system as part of CSE314 (Operating System Sessional) course of BUET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published