Git Product home page Git Product logo

os161's Introduction

OS161

This is an implementation of an operating system for the Operating Systems course, CPEN 331, at the University of British Columbia.

Overview

This is a project that involved implementing various portions of an operating system. The main goal was to gain a strengthened understanding of concurrency, synchronization, virtual memory, system calls, and file systems.

The course that this project was associated with describes the key aspects of the course as: Operating systems, their design and their implementation. Process concurrency, synchronization, communication and scheduling. Device drivers, memory management, virtual memory, file systems, networking and security.

Implemented Features

Concurrency

Mutex Lock

A mutex lock is an struct that may be acquired only by one thread at a time. It operates using a waiting channel and a spinlock. When a thread wants to use the mutex lock, the implementation will acquire a spinlock (and spin on it if it not available), check the status of the lock flag, and sleep on the waiting channel / release the spinlock if the flag is not free.

The implementation of mutex locks can be found in /kern/thread/synch.c

Condition Variable

A condition variable is a struct that threads may be placed on to sleep until some function calls upon it to wake a single thread, or all threads. Condition variables allow for synchronization as the act of going to sleep/waking up is an atomic action. They are often used for pausing until a condition is satisfied that allows for concurrent operations to occur safely.

The implementation of condition variables can be found in /kern/thread/synch.c

Filesystem System Calls

open()

The implementation of open() can be found in /kern/syscall/fsyscall.c

read()

The implementation of read() can be found in /kern/syscall/fsyscall.c

write()

The implementation of write() can be found in /kern/syscall/fsyscall.c

lseek()

The implementation of lseek() can be found in /kern/syscall/fsyscall.c

close()

The implementation of close() can be found in /kern/syscall/fsyscall.c

dup2()

The implementation of dup2() can be found in /kern/syscall/fsyscall.c

chdir()

The implementation of chdir() can be found in /kern/syscall/fsyscall.c

__getcwd()

The implementation of __getcwd() can be found in /kern/syscall/fsyscall.c

Process System Calls

System Call: getpid()

The implementation of getpid() can be found in /kern/syscall/psyscall.c

System Call: fork()

The implementation of fork() can be found in /kern/syscall/psyscall.c

System Call: execv()

The implementation of execv() can be found in /kern/syscall/psyscall.c

System Call: _exit()

The implementation of _exit() can be found in /kern/syscall/psyscall.c

System Call: kill_curthread()

The implementation of kill_curthread() can be found in [TODO: fill in]

System Call: sbrk()

The implementation of sbrk() can be found in [TODO: fill in]

Virtual Memory

OS161 has implemented virtual memory. TODO: Talk about TLB, page tables, MMU, swap.

Configuration

Installation

Detailed installation instructions for the base OS161 may be found here and here. If you are simply working with this repository, the following libraries will be required:

On Linux these may be installed by the command:

sudo apt-get -y install bmake ncurses-dev libmpc-dev

On macOS these may be installed by the Homebrew commands:

brew install bmake
brew install libmpc
brew install gmp
brew install wget

Setup

We assume os161 is installed at ~/os161. We must use the following commands to setup and compile the kernel

  1. Configure the build.
cd ~/os161/src
./configure --ostree=$HOME/os161/root
  1. Build userland.
bmake
bmake install
  1. Configure a kernel.
cd kern/conf
./config DUMBVM
  1. Compile and install the kernel
cd ~/os161/src/kern/compile/DUMBVM
bmake depend
bmake
bmake install

os161's People

Contributors

jacobinski avatar pasindumuth avatar fedorova avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.