In: Computer Science
. 1. In the Operating System zoo describe the 4 different types of Operating Systems and describe them.
2. What is a process, when are they created and when are they terminated.
Question 1:
Operating System:
The operating system is the system software that handles the computer's basic functionality like scheduling, input/output operation resource allocation, file system manipulation, etc.
It is an interface between the computer hardware and the user.
Type of operating system:
Real-time operating system:
The real-time operating is used for the real-time application in which time is very important to complete a given task and no buffer delay allowed. If the given task is not completed within the given time period then the system will fail.
Type of real-time operating system:
In a hard real-time system the given tasks must be completed in the given time bound otherwise the system will fail.
In a soft real-time system if the given tasks may not be completed in the given time bound the system will not fail and some more time may be assigned with low probability.
Distributed operating system:
A distributed operating system is a collection of distributed application which are running on the multiple computers which are connected with each other through the communication channel.
The distributed system is a loosely coupled system in which multiple CPU is physically separate computational nodes.
Example:
A distributed operating system contributes by communicating with high-speed communication lines. The complete system looks like an ordinary centralized operating system. Each of the system or node has its own memory.
Actually, the user doesn't know about the machine on which the programs are running and about the storage of the files.
The application work towards achieving a common goal. The operating system takes care of the network if needed. The process can move among different computers but the distributed nature of the process is hidden from the processes.
Batch Processing System:
In the batch processing system, multiple tasks are completed in serial order and run one after the other. In this type of processing system, there is no switching between the task or job before the completion of executing tasks or jobs.
The multiple jobs in a batch are completed without user interaction.
Time-Sharing Processing System:
In the time-sharing processing system, the operating system will switch between different jobs and this system is more responsive as compared to the batch processing system. The context switching is very fast.
Time-sharing means the processor time that is shared among multiple users simultaneously. The resources are allocated to the user in time slots.
Question 2:
Process:
A process is not only a program under execution but it is the active state of the program when it is executing and it has its own Process Control Block.
A process requires other resources like memory, CPU, hard disk, and Input/Output, etc.
A process has five states as given below:
When the user request a new process, or at the time of system initialization or a process wants to run a system call, etc. then the new process will be created in the system.
A new process is created by using the fork() system call.
The fork() system call is used to create the child process and the child process is a copy of the parent process that will be run concurrently with the parent process. It returns an integer value and this value may be of three types:
The zero value is returned to the newly created process.
The positive value is the process id and this value is returned to the parent process.
If the child process is not created successfully then the negative value is returned.
When the process completed its task or there is no process to get the status of the running process then the process will be terminated by calling the exit() system call.
We can use wait() and exit() system call to establish a communication between the parent process and the child process.