Operating System: Prepared By: Prof. Sayalee Narkhede ©
Operating System: Prepared By: Prof. Sayalee Narkhede ©
Operating System
Overview
System Software is a set of programs that control System Software is a computer program
and manage the operations of computer hardware that performs specific task for a user
Process
Accounting
Management
Operatin
g System
Communi I/O
cation Management
Error Memory
Detection Management
1. User Interface
CLI uses text commands GUI uses a pointing device to direct I/0,
choose from menus, and make selections
2. Program Execution
3. Process Management
4. I/O Management
5. Memory Management
6. Error Detection
7. Communication
8. Accounting
Protection
Protection provides a mechanism for controlling access to processes, programs, and user
resources.
Security
Security provides a mechanism to safeguard the system resources and the user resources
from all external users.
❖ First Generation
❖ Second Generation
❖ Third Generation
❖ Fourth Generation
❖ Serial processing
❖ Drawback:
❖ Drawback:
Advantages
1.It provides superior application performance due to the limited interfaces between the
application program and the hardware.
2.It is simple for kernel developers to create such an operating system.
Disadvantages
1.The structure is quite complex because there are no apparent boundaries between modules.
2.It does not impose data concealment in the operating system.
Advantages:
❖ The execution of the monolithic kernel is quite fast as the services such as memory
management, file management, process scheduling, etc., are implemented under the same
address space.
❖ A process runs completely in single address space in the monolithic kernel.
❖ The monolithic kernel is a static single binary file.
Disadvantages:
❖ If any service fails in the monolithic kernel, it leads to the failure of the entire system.
❖ The entire operating system needs to be modified by the user to add any new service.
Advantages:
❖ Modularity: This design promotes modularity as each layer performs only the tasks it is scheduled to
perform.
❖ Easy debugging: As the layers are discrete so it is very easy to debug
❖ Easy update: A modification made in a particular layer will not affect the other layers.
❖ No direct access to hardware: The hardware layer is the innermost layer present in the design. So a
user can use the services of hardware but cannot directly modify or access it, unlike the Simple system
in which the user had direct access to the hardware.
❖ Abstraction: Every layer is concerned with its functions. So the functions and implementations of the
other layers are abstract to it.
Disadvantages:
❖ Complex and careful implementation: As a layer can access the services of the layers below it, so the
arrangement of the layers must be done carefully
❖ Slower in execution: If a layer wants to interact with another layer, it requests to travel through all the
layers present between the two interacting layers
❖ Functionality: It is not always possible to divide the functionalities
❖ Communication: No communication between non-adjacent layers.
Disadvantages
1.When the drivers are implemented as procedures, a context switch or a function call is needed.
2.In a microkernel system, providing services are more costly than in a traditional monolithic system.
3.The performance of a microkernel system might be indifferent and cause issues.
❖ Syntax:
pid_t fork(void);
exit()
❖ Syntax:
void exit ( int status );
❖ A call to wait() blocks the calling process until one of its child
processes exits or a signal is received
❖ After child process terminates, parent continues its execution
❖ wait() takes the address of an integer variable and returns
the process ID of the completed process
❖ Child process may terminate due to:
It calls exit();
It returns (an int) from main
It receives a signal (from the OS or another process)
whose default action is to terminate
❖ Return Value:
Returns a file descriptor – positive integer value greater than 2
Returns -1 if failed to open a file
❖ Return Value:
0 : on successful closing of a file int close(int fd);
-1 : if error exists while closing a file
❖ Example:
File Content: “1234567890”
Update it to: “12345hello”
❖ Syntax:
pid_t getpid(void);
❖ Return type:
returns the process ID of the current process
It never throws any error therefore is always successful
❖ Syntax:
pid_t getppid(void);
❖ Return type:
returns the process ID of the parent of the current process
It never throws any error therefore is always successful