Git Product home page Git Product logo

mishors / pintos Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 4.0 365 KB

Implementation of the operating system named PintOS which is a project from Stan- ford university. It consists of 3 projects for implementing Threads, timer interrupt, priority schedulers, UI to run user programs and system calls.

License: Other

Makefile 3.65% C 67.68% Objective-C 0.30% C++ 0.71% Shell 0.23% Perl 24.73% Perl 6 0.09% Assembly 2.63%
c pintos operating-systems kernel scheduling-algorithms thread priority-scheduling alarm-clock

pintos's Introduction

PintOS - Threads phase

Pintos is a simple operating system framework for the 80x86 architecture. It supports kernel threads, loading and running user programs, and a file system, but it implements all of these in a very simple way. Pintos could, theoretically, run on a regular IBM-compatible PC. Unfortunately, it is impractical to supply every student a dedicated PC for use with Pintos. Therefore, we will run Pintos projects in a system simulator, that is, a program that simulates an 80x86 CPU and its peripheral devices accurately enough that unmodified operating systems and software can run under it. Bochs and QEMU simulators are used to run Pintos.

Threads Phase Overview

In this phase 3 parts of PintOS have been implemented or reimplemented to support more efficiency and good performance. The 3 parts are System Alarm clock, Priority Scheduler and Advanced Scheduler.

Alarm Clock

timer_sleep() function is reimplemented to avoid busy waiting and spinning in a loop checking the current time and calling thread_yield() until enough time has gone.

Priority Scheduler

Threads are given priorites.Then a thread is added to the ready list that has a higher priority than the currently running thread, the current thread should immediately yield the processor to the new thread. Similarly, when threads are waiting for a lock, semaphore, or condition variable, the highest priority waiting thread should be awakened first. A thread may raise or lower its own priority at any time, but lowering its priority such that it no longer has the highest priority must cause it to immediately yield the CPU.

Priority inversion situations is handelled in the scheduler.Consider high, medium, and low priority threads H, M, and L, respectively. If H needs to wait for L (for instance, for a lock held by L), and M is on the ready list, then H will never get the CPU because the low priority thread will not get any CPU time. The technique used to solve this issue is priority donation.

Advanced Scheduler

Multilevel feedback queue scheduler which is similar to the BSD scheduler to reduce the average response time for running jobs on the system.

Like the priority scheduler, the advanced scheduler chooses the thread to run based on priorities. However, the advanced scheduler does not do priority donation.

Advanced Scheduler uses equations to calculate some values that make it take the decisions for example :

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.