MODULE 1 - Introduction
MODULE 1 - Introduction
M1-L1
Introduction to OS
2
What is an Operating System?
Mainframe OS
Optimize hardware utilization
Computer standard OS
Standard Application, Games, etc.
Handheld OS -> Apps, etc.
4
OS as a base for Application Programs 5
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient and fair resource use
OS is a control program
Controls execution of programs to prevent errors and improper use of the computer
OS plays an important role to determine which application you need, because some
applications may exists only in some OS.
Example:
Words in windows
Libre office in linux
6
Microsoft Windows
Mainframe
DOS
OS/2
Mac OS
AmigaOS
Types of Operating Systems
1. Batch Operating System
2. Multiprogramming Operating System
3. Time-Sharing OS
4. Multiprocessing OS
5. Distributed OS
6. Real Time OS
1. Batch Operating System
The users of this type of operating system does not interact with the computer
directly.
Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator
There is an operator which takes similar jobs having the same requirement and
group them into batches.
Batch Operating System cont..
User Interface: There are different kinds, like touchscreen, GUI, and command-line.
Program Execution: (Execute programs for users)
I/O operations: It is much too difficult for users to operate the I/O hardware correctly
without help.
File System Manipulation: The OS helps us store, organize, manage, and protect our
information.
Communications: Users need their processes to exchange information. OSs help. The
two main ways to do it are with shared memory and by message passing.
Error Detection: An OS continually checks to see if something is going wrong. The OS
is programmed to take appropriate action.
Resource Allocation
Logging:
Records for accounting, fault detection, failure, protection, maintenance, update, security, etc.
Protection and Security.
Program execution 24
Design Goals:
system that is convenient,
reliable,
safe, and
fast.
Implementation: The implementation of the operating system, that is the
manner in which the ideas of the design are written in programming language(s).
Assembly
High Level Language
Earlier assembly could make the code run faster but nowadays high-level are
translated to equivalently good assembly code.
Instead performance of OS will increase if selection data structure and
algorithms are done rather than proper assembly code.
Operating System Structure 26
Simple
Monolithic
Micro-kernel models
Layered (conceptual)
Modular
Kernels may be classified mainly in three categories: -
Monolithic Kernel
Micro Kernel
Hybrid Kernel
Simple 27
Monolithic Kernel
value on speed and efficiency.
Monolithic is a single static
binary file.
It executes in a single address
space.
Keep only necessary component in kernel. Others are implemented as programs (system or user level).
Resulting in a kernel smaller in size.
Minimal process management
Minimal memory management
Main role is that it facilitates communication between the client program and the various services that
are running in user space.
Mach example of microkernel
Mac OS X kernel (Darwin) partly based on Mach
Communication takes place between user modules using message passing
Benefits:
Easier to extend a microkernel
Easier to port the operating system to new architectures
More reliable (less code is running in kernel mode)
More secure
Detriments:
Performance overhead of user space to kernel space communication
31
Microkernel 32
Security If a service crashes, it does effect on If a service crashes, the whole system
working of microkernel. crashes in monolithic kernel.
Code To write a microkernel, more code is To write a monolithic kernel, less code
required. is required.
Typically employs:
dynamic loadable kernel module (LKM). i.e. Different
modules communicate through kernel (core part).
Abstract Machine
Complex details of the hardware are hidden
APIs
Application development becomes simple
Command Interpreter
Part of a OS that understands and executes commands that are
entered interactively by a human being or from a program
Shell
Abstraction 37
OS as an Illusionist:
Remove software/hardware quirks (fight complexity)
Optimize for convenience, utilization, reliability, … (help the programmer)
For any OS area (e.g. file systems, virtual memory, networking, scheduling):
What hardware interface to handle? (physical reality)
What’s software interface to provide? (nicer abstraction)
38
Abstraction
Application
Shell
Operatin
g System
CPU Memory
Video Card Network
Monitor Disk Printer
Operating Systems Provide Abstraction 39
Providing abstraction via system calls 40
Application
System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ...
Operatin
g System
Process
Device Mgmt
Mgmt File Network
ProtectioSystem Comm. Kernel
Security
n
CPU Memory
Video Card Network
Monitor Disk Printer
Why is abstraction important? 41
Applications suffer!
Very complicated maintenance and upgrading
No portability
Concept of Process 42
Process
Program loaded in memory and in execution.
Program is a passive whereas process is an active entity
Process Management Activities 43
R1 P1 R1 P1
R2 P2 R2 P2
Resource 44
Networking and OS
Multimedia OS 47
Demand on the applications 48
References
49