Coder Social home page Coder Social logo

operating-system-simulations's Introduction

Simulation of Operating Systems Functions

I created a simulation of the 2-pass linker used in C compilers and simulations of 3 crucial operating system functions. OS-level simulations include process scheduling, resource allocation, and demand paging.

Linker

When the compiler and assembler have finished processing a module, they produce an object module that is almost runnable. There are two remaining tasks to be accomplished before object modules can be run. Both are involved with linking together multiple object modules. The tasks are relocating relative addresses and resolving external references. The "C-Linker" program simulates how these two remaining tasks work.

Process Scheduling

One of the responsibilities of the OS is to schedule processes. First come first serve, Round Robin with quantum = 2, Uniprogrammed, and Shortest Job First have been selected for simulation. A summary of these algorithms can be found in the README inside the process scheduling directory.

Resource Allocation

The simulation performs resource allocation using both optimistic resource manager and banker's algorithm of Dijkstra. A deadlock can occur for the optimistic resource manager and the simulation handles the deadlock by aborting the lowest numbered deadlocked task after releasing all its resources (continues this until there are no more deadlocks).

A deadlock occurs when every member of a set of processes is waiting for an event that can only be caused by a member of the set. Often the event waited for is the release of a resource.

Demand Paging

Demand paging is a part of memory management. The idea of demand paging is to fetch pages from disk to memory when they are referenced, hoping to get the most actively used pages in memory. With demand paging, an important question is the choice of a victim page to evict. The simulation accepts LIFO, RANDOM, and LRU as replacement algorithms.

Credits

These notes were adapted from Professor Allan Gottlieb, an Operating Systems professor at NYU.

operating-system-simulations's People

Contributors

adithepnarula avatar

Stargazers

 avatar Vic Shihang Li avatar

Watchers

 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.