1960’s definition of operating system is “the software that controls the hardware”.
The primary purpose is to create a workable operating Environment for the user.
It is a collection of software that work and communicate with each other.
Requirements to program a Operating System
Knowledge of the C Programming Languages.
The most common language used in OS development is C, C++.
The concept behind the design of C programming Language was for system level and embedded software development.

Knowledge of x86 Assembly Language
Assembly language (low-level programming language) which provide one to one relation with the processor machine instructions, which is the reason Assembly language is used for programming Hardware.

Objective of Operating System.
Abstraction-To hide details of hardware by creating abstraction
Operating system provides subroutines called devices drives that perform operation on behalf of program for example: Input/Output Operation.
Introduces the file abstraction so that program do not have to deal with disks.
Transform the computer hardware into multiple virtual computer, each belonging to a different program.
Each program that is running is called process.
A program by itself is not a process.

Image result for process in os"

New state :– The process is created. Create system call is used.

Ready State:- The process in this state is ready to acquire CPU.

Running State:-as the name suggest.

Waiting State:-The process are waiting for the resources which are held by others processes.

Terminate State:- During this state, the process finishes its execution.

When a running process becomes suspended due to interrupts or I/O request the operating system may schedule another process for execution.

A program is a passive entity, whereas process is an active entity, where the program counter specifies the next instruction to be executed and set of resources.

Enforces security through abstraction.

Communication:- Os manages inter-process communication between the process that are executing on same system or running on a different system on a distributed system.

Resources Management:
Process Management:- performs process scheduling and dispatching.
I/O bound processes
CPU bound processes
Main Memory Management:keeps track of which segment of memory is in use and by which process.
Swapping of the processes is also done by the main memory management unit (MMU).

Secondary Memory Management
File Management
Devices Management
Error Detection Recovery

System Call
create() -> to create new process
fork() -> to create child process
System call is the programming interface to the services provided by the operating to the services provided by the operating system which is written in a high level language or assembly language.

Each system call is associated with a number.

Type of System Call
Process Control System Call
File Manipulation System Call
Device Manipulation System Call
Information maintenance System Call
Communication System Call

Difference Between System Call and Function Call - Comparison Summary
https://pediaa.com/what-is-the-difference-between-system-call-and-function-call/
source




Provide Graphical User Interface

Types of Operating System
I) Batch processing
Limited resources as one CPU, one memory.
Program are stored in batch.
Several program with similar need are batched together on a single input tape and processed through CPU as a group.

The programmer sorts the programs into batches with similar requirements and runs each batch.

Spooling: Simultaneous peripheral operation .
Resource utilization is less ,as when one work other remains idle.
Output is time taking.



II) Multi-programming
Single program runs simultaneous due to which resource does not sit idle.
CPU scheduling:- When several jobs are scheduled for execution and or ready to acquire CPU at the same time the OS must choose one of them.
This decision is called CPU scheduling.


III) Time sharing:- Logical extension of multi-programming. In this OS, each program gets a fixed amount of time.
CPU executes multiple programs by switching among the programs.
Switching occur so quickly that user can interact with program while it is running.
Provides a good response time.
Allows many user to share the computer simultaneously.
It uses CPU scheduling with multi-programming.


IV) Multiprocessing/Parallel :-
More than one processor in close.
By increasing the processor we can expect more work can be done from the system.
Increased reliability:- If the function can be distributed properly among several processor then the failure of one processor does not halt the processor, except for slowing it down.
There are two types of multi-processor:-
Symmetric Multi-processor:- Each processor runs an identical copy of an OS and these copies communicate with other on demand or as needed.

Asymmetric:- Each processor is assigned a specific task.Here a master processor controls the system and other processor have their own predefined task.

Multi-processor can save more money than multiple single processor system because they can share peripheral, storage devices, etc.




V) Distributed
Collection of autonomous computer capable of communication and co-operation through hardware and software connection.
Major Objective of distributed OS is transparency.
The component and resource distribution should be hidden from users and application programs until explicit demand.

It provides the means for system wide sharing of resources such as computational capacity, files, etc.


VI) Real time:- specifically designed to respond to the events that happens in real time.
This includes computer system for ICU equipment, emergencies, etc.

Processing must be done with the given time constraint otherwise it is failure.