/minOS

Pthreads, Example of mini operating system

Primary LanguageC

minOS

This program is an simple example for the usage of pthreads. This example consists of the performing various operations like sum, multiplication, prime numbers etc. using threads. This is like a simple operating system, where commands are defined programatically.

Compiling and Running the program

Compiling

  • gcc index.c -pthread -o index -std=c99

Running

  • ./index

Various commands

Sum of numbers
  • sum(x1, x2,..., x6)
Difference of numbers
  • sub(x1, x2) or sub(x1, x2, ..., x6)
Multiplication of numbers
  • mul(x1, x2,..., x6)
Division of numbers
  • div(x1, x2)
Smallest prime number
  • sprime(x1, x2,..., x6)
Biggest prime number
  • bprime(x1, x2,..., x6)
LCM of numbers
  • lcm(x1, x2,..., x6)
GCD of numbers
  • gcd(x1, x2,..., x6)
Listing all files and directories
  • ls