Giter VIP home page Giter VIP logo

selmanozleyen / spim-os-multiprogramming-extension Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 4.46 MB

This is a modification of SPIM. Original source code can be found here. Original spim is designed to execute only one process but by adding syscalls like execv, fork, wait and some other helper syscalls I was able to modify it to a multi-process OS with multitasking. There are also interrupts periodically to call the interrupt function which is written in assembly. Interrupt handler makes context switches with round robin scheduling.

C++ 49.17% C 9.15% Assembly 12.23% Yacc 2.76% Lex 0.78% Batchfile 0.14% Clarion 0.29% Rich Text Format 4.17% Perl 0.15% QMake 0.38% HTML 17.97% Shell 0.52% Makefile 2.29%
spim syscalls os

spim-os-multiprogramming-extension's Introduction

Introduction

This is a modification of SPIM. Original source code can be found here. Original spim is designed to execute only one process but by adding syscalls like execv, fork, wait and some other helper syscalls I was able to modify it to a multi-process OS with multitasking. There are also interrupts periodically to call the interrupt function which is written in assembly. Interrupt handler makes context switches with round robin scheduling.

Running

To install spim enter the following;

$cd spim
$sudo make clean
$sudo make install

After that enter something like

$./spim -file SPIMOS_GTU_1.s

where the file given could be SPIMOS_GTU_1.s, SPIMOS_GTU_2.s or SPIMOS_GTU_3.s.

Different init processes

SPIMOS_GTU_1.s, SPIMOS_GTU_2.s and SPIMOS_GTU_3.s indicates different init processes of the kernel (the process that runs initially on the system). Here is how they behave;

  1. In the SPIMOS_GTU_1.s init process will initialize Process Table, load 4 different programs (listed below) to the memory start them and will enter an infinite loop until all the processes terminate.
  2. SPIMOS_GTU_2.s is randomly choosing one of the programs and loads it into memory 5 times (Same program 5 different processes), start them and will enter an infinite loop until all the processes terminate.
  3. SPIMOS_GTU_2.s is choosing 3 out 4 programs randomly and loading each program 3 times start them and will enter an infinite loop until all the processes terminate.

Test programs

-BinarySearch.s

-LinearSearch.s

-Collatz.s: You are going to find collatz sequence for each number less than 25. You should do this starting from 25 to 1 iteratively (Not only for 1 number). You can find information about (Collatz conjecture on internet). For each number you will show the number being interested in, and its collatz sequence and go to next number.

-Palindrome.s: Create a dictionary that contains 100 words, where 90 of the words are not palindrome, 10 of them are palindrome. You do not have to create the dictionary by taking from the user. Then, you will print out each word and whether they are palindrome or not respectively. When you assign all the words in the dictionary whether palindrome or not, then you ask for the user continue or not, if yes, take an input word and show whether a string given from keyboard is a palindrome by printing the “string” semicolon: “Palindrome” or “Not Palindrome”. Otherwise terminate the program.

Output Example

out

spim-os-multiprogramming-extension's People

Contributors

selmanozleyen avatar

Stargazers

 avatar  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.