Unit 1 CHP 1
Unit 1 CHP 1
Systems
Unit 1 - Chapter 1
What is Operating System
Computer System = Hardware + Software
• The User Mode is concerned with the actual interface between the
user and the system.
• It controls things like running applications and accessing files.
• The Kernel Mode is concerned with everything running in the
background.
• It controls things like accessing system resources, controlling
hardware functions and processing program instructions.
• System calls are used to change mode from User to Kernel.
What Operating System can do
• Depends on the point of view
• Users want convenience, ease of use and good
performance
• Don’t care about resource utilization
• But shared computer such as mainframe or
minicomputer must keep all users happy
• Users of dedicate systems such as workstations have
dedicated resources but frequently use shared
resources from servers
• Handheld computers are resource poor, optimized for
usability and battery life
• Some computers have little or no user interface, such
as embedded computers in devices and automobiles
Computer System Organization
• Computer-system operation
• One or more CPUs, device controllers connect through common
bus providing access to shared memory
• Concurrent execution of CPUs and devices competing for memory
cycles
Computer system Operation
• Process Management
• A process is a program in execution.
• A process needs certain resources, including CPU time, memory, files, and I/O devices to
accomplish its task.
• Simultaneous execution leads to multiple processes. Hence creation, execution and
termination of a process are the most basic functionality of an OS
• If processes are dependent, than they may try to share same resources. thus task of process
synchronization comes to the picture.
• If processes are independent, than a due care needs to be taken to avoid their overlapping in
memory area.
• Based on priority, it is important to allow more important processes to execute first than
others.
Functions of Operating System 22
• Memory Management
• Memory is a large array of words or bytes, each with its own address.
• It is a repository of quickly accessible data shared by the CPU and I/O devices.
• Main memory is a volatile storage device. When the computer made turn off
everything stored in RAM will be erased automatically.
• In addition to the physical RAM installed in your computer, most modern operating
systems allow your computer to use a virtual memory system. Virtual memory allows
your computer to use part of a permanent storage device (such as a hard disk) as
extra memory.
• The operating system is responsible for the following activities in connections with
memory management:
Keep track of which parts of memory are currently being used and by whom.
Decide which processes to load when memory space becomes available.
Allocate and de-allocate memory space as needed.
Functions of Operating System 23
• File Management
• A file is a collection of related information defined by its creator.
• File systems provide the conventions for the encoding, storage and management of data on a storage
device such as a hard disk.
FAT12 (floppy disks)
FAT16 (DOS and older versions of Windows)
FAT32 (older versions of Windows)
NTFS (newer versions of Windows)
EXT3 (Unix/Linux)
HFS+ (Max OS X)
• The operating system is responsible for the following activities in connections with file management:
✦ File creation and deletion.
✦ Directory creation and deletion.
✦ Support of primitives for manipulating files and directories.
✦ Mapping files onto secondary storage.
✦ File backup on stable (nonvolatile) storage media.
Functions of Operating System 24
• Device Management
• Device controllers are components on the motherboard (or on expansion cards) that act as an interface
between the CPU and the actual device.
• Device drivers, which are the operating system software components that interact with the devices
controllers.
• A special device (inside CPU) called the Interrupt Controller handles the task of receiving interrupt
requests and prioritizes them to be forwarded to the processor.
• Deadlocks can occur when two (or more) processes have control of different I/O resources that are
needed by the other processes, and they are unwilling to give up control of the device.
• It performs the following activities for device management.
Keeps tracks of all devices connected to system.
Designates a program responsible for every device known as Input/output controller.
Decides which process gets access to a certain device and for how long.
Allocates devices in an effective and efficient way.
Deallocates devices when they are no longer required.
Functions of Operating System 25
• Security and Protection
• The operating system uses password protection to protect user data and similar
other techniques.
• It also prevents unauthorized access to programs and user data by assigning
access right permission to files and directories.
• The owners of information stored in a multiuser or networked computer system
may want to control use of that information, concurrent processes should not
interfere with each other.
Functions of Operating System 26
• A user interface (UI) controls how you enter data and instructions and how
information is displayed on the screen
• There are two types of user interfaces
• Command Line Interface
• Graphical user Interface
Functions of Operating System 27
Secondary-Storage Management:-
Systems have several levels of storage which includes primary storage, secondary storage, and
cache storage. Instructions and data must be stored in primary storage or cache so that a
running program can reference it.
Command interpretation:- This module is interpreting commands given by and acting system
resources to process that commands.
Networking:- A distributed system is a group of processors which do not share memory,
hardware devices, or a clock. The processors communicate with one another through the
network.
Job accounting:- Keeping track of time & resource used by various job and users.
Communication management:- Coordination and assignment of compilers, interpreters, and
another software resource of the various users of the computer systems.
Resource Abstraction
What is Resource?
The OS treats any entity as a resource if it satisfies following
characteristics:
A process must request that entity from the OS.
A process must suspend its operation until the entity is allocated
to it.
Anything like CPU cycle, Main memory, printer…..
Similar resources can be abstracted to a common abstract resource
interface (i.e. system software may abstract floppy disks, hard-disks
and CD-ROMs into a single abstract disk interface).
Abstraction generalizes the hardware behaviour but restricts the
flexibility.
With abstraction, certain operations become easier to perform, other
may become impossible (such as specific hardware control).
Different hardware components that a program may use are referred
to as resources.
Any particular resource, such as a HDD has a generic interface that
defines how the programmer can make the resource perform a desired
operation.
An abstraction can be made to be much simpler than the actual
resource interface.
Resource Abstraction
2.Multiprogramming Operating System
• This type of OS is used to execute more than one jobs simultaneously by a single processor.
• It increases CPU utilization by organizing jobs so that the CPU always has one job to execute.
• Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling.
Types of Operating System 34
2.Multiprogramming System