An operating system (OS) is a fundamental software component that manages and controls computer hardware and provides a platform for running other software applications. It acts as an intermediary between the hardware and the user applications, ensuring that hardware resources are utilized efficiently and that users can interact with the computer in a user-friendly manner. Here are some of the key functions and components of an operating system:
Process Management: The OS manages processes, which are individual programs or tasks running on the computer. It allocates CPU time, memory, and other resources to these processes and ensures they run smoothly.
Memory Management: The OS controls the allocation and deallocation of memory resources, ensuring that each process gets the required amount of memory and that memory is efficiently used.
File System Management: It manages the storage and retrieval of data on storage devices, such as hard drives and solid-state drives. This includes file creation, deletion, and organization.
Device Management: The OS communicates with and manages hardware devices like keyboards, mice, printers, and network adapters. It provides drivers to enable these devices to work with the computer.
User Interface: The OS provides a user interface, which can be a command-line interface (CLI) or a graphical user interface (GUI), to enable users to interact with the computer and its applications.
Security and Access Control: Operating systems implement security mechanisms to protect data and resources. This includes user authentication, file permissions, and encryption.
Networking: The OS facilitates network communication, allowing computers to connect to the internet and interact with other devices on a network.
Error Handling: It monitors the system for errors and hardware failures and provides error messages or takes appropriate actions to prevent system crashes.
1. Operating System Structure
1. Multi programming and multitasking are 2 types
2. Simple structure
3. Monolithic structure
4. Layered Structure
5. Micro kernels
6. Modules
Ms.C.Nithiya
Computer Science and Engineering
KIT-Kalaignarkarunanidhi Institute Of Technology
2. Simple Structure -- MS-DOS
Very old and it has Microsoft Disk os
Base is hardware, device drivers has access to
hardware.
Hardware can be accessed by all the above so
the interfaces are not well separated.
Application program can directly read and write
to hardware.
When user program fails causes entire system to
crash.
Not well protected, well structured and not good
structure.
Ms DOS was written on Intel 8088 does not
provide dual mode(security and protection) or
hardware protection.
3. MONOLITHIC STRUCTURE
Used by earlier UNIX OS
Kernel and system programs grouped,
below system call and above
hardware is kernel.
Everything packed in one level, too
many functions to maintain.
If there is a change need to modify
entire kernel(debug).
System difficult to maintain and
implement.
4. Layered Approach
Zero is hardware, Layer 1 to n is
user interface.
Broken down function into several
layers
Easy to implement and debug.
One layer has problem, if
Scheduling layer gives problem,
look at that layer and debug.
Which is top and which layer below
is main criteria.
Backing store is performed (disk ,
space used by VM) should be below
memory management layer.
Not very efficient compared to
other structures.
6. Microkernel System Structure
Micro kernel is present instead of entire kernel system.
Remove all non essential components from kernel and implement as
system and user level programs.
Micro kernel provide core functionalities of kernel above to which
device drivers, file services, process service, virtual memory are
placed under user level.
Micro kernel provide communication between client program and
these services .
Client request for any service micro kernel gives access through
message passing, runs in user mode.
As function runs in User mode entire system does not get crashed.
Performance decrease as there is system overhead while passing
message all time.
8. Modules
Object oriented techniques to create kernel.
Other function should be loaded to the kernel either at boot
time or run time
Kernel section has defined and protected interfaces , protect
from things don’t need to access.
More flexible than a layered system.
They are loaded dynamically directly into kernel.
9. CPU Scheduling
Assign time for doing a task
Switching CPU among process OS can make
computer productive.
Introduce CPU scheduling – Multi programmed
Which algorithm work better? Difference of
algorithm need to be known
In single processor one process run at time.
Any other must wait and rescheduled.
10. CPU SCHEDULING
A process is executed until it must wait
completion of I/o operation.
CPU sets idle when processor inside CPU uses I/o
operation and sits inside CPU unit.
CPU does no useful work so productivity gets
reduced.
CPU and I/o Burst cycles – Process execution
has CPU execution and I/o execution.
11. CPU Scheduling
When process is under CPU execution for some time it is CPU
Burst
CPU waits for I/o operation to complete is i/o burst
Process execution–
CPU burst
I/o Burst
CPU Burst…..
At final CPU burst system request to terminate execution.
13. PRE-EMPTIVE AND NON-PREEMPTIVE
SCHEDULING
Ways in which scheduling takes place.
CPU SCHEDULER – When CPU is idle , os select
One of processes in ready queue , in a process p1,p2,p3,p4 …p3
is selected from set to place in ready queue to run.
Selection of process is done by Short-term scheduler(ready
queue to CPU through i/o operation.
DISPATCHER– CPU control is given to selected process.
14. PRE-EMPTIVE AND NON-PREEMPTIVE SCHEDULING
Time taken for dispatcher to stop one process and start another
running is Dispatch Latency
CPU scheduling decisions takes place under 4 categories.
Process state switches from Running (Already using CPU)to
Waiting state (I/o operation)
Interrupt occurs, Running ( Process hault, goes back to ready
to get CPU to complete) to Ready state
15. PRE-EMPTIVE AND NON-PREEMPTIVE
SCHEDULING
Waiting state(has any i/o request) to ready state(continue its
execution) when i/o operation occur.
When process terminates CPU assigns to another process.
Based on CPU Allocation, 1 & 4 considered as no choice
(CPU should be assigned )
2 & 3 there is a choice process gets hault, CPU assigned to
new process or old one .
Scheduling under 1 &4 is Non preemptive.
Pre emptive , CPU can be taken away from process before it
completes its execution .
When higher priority process enters switching from non
preemptive to pre emptive occurs.
16. SCHEDULING CRITERIA
CPU utilization, Through put, Turn around time , waiting time,
Response time are 5 criteria need to be known before
scheduling.
CPU utilization – We need to keep the CPU as busy as
possible. CPU should not be idle.
Through put – One measure of work is calc as number of
processes that are completed per time unit
Turn around time – Sum of the periods spent waiting to get
into memory, waiting in ready queue, executing on CPU and
doing I/o. From submission to completion.
Waiting time – Sum of the period spent waiting in ready
queue. It does not depend on scheduling process but the length
of process is taken into account .
17. SCHEDULING CRITERIA
Response time – Time from the submission of
request until the first response is produced.
Time it takes to start responding not the time it
takes to output the response.
Turn around time is generally limited by the speed
of output time in fast system. So we go for
response time.
Video output – first it start processing and takes
time to give output.