0% found this document useful (0 votes)
47 views

OS Unit 1

The document discusses operating systems and computer system architecture. It defines an operating system as a program that manages a computer's hardware and acts as an intermediary between the user and computer. It describes the different views of an operating system from the user and system perspectives. It then covers computer system organization including components like the CPU, memory, storage, I/O devices, and buses that connect them. It also discusses operating system concepts like interrupts, system calls, and device drivers. Finally, it summarizes different computer system architectures including single-processor, symmetrical multiprocessor, and clustered systems.

Uploaded by

Alwin Hilton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

OS Unit 1

The document discusses operating systems and computer system architecture. It defines an operating system as a program that manages a computer's hardware and acts as an intermediary between the user and computer. It describes the different views of an operating system from the user and system perspectives. It then covers computer system organization including components like the CPU, memory, storage, I/O devices, and buses that connect them. It also discusses operating system concepts like interrupts, system calls, and device drivers. Finally, it summarizes different computer system architectures including single-processor, symmetrical multiprocessor, and clustered systems.

Uploaded by

Alwin Hilton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

OPERATING SYSTEM

UNIT 1
What is OS?

An operating system is a program that manages a computer’s


hardware.

It also provides a basis for application programs and acts as an


intermediary between the computer user and the computer
hardware.

Two view point of OS?

• User view – in view of resource utilization (CPU time, memory, I/O)

• System view – resource allocator (CPU time, memory, I/O)

Computer System Organization:

Computer System Operation:

 A modern general-purpose computer system consists of one or


more CPUs and a number of device controllers connected
through a common bus that provides access to shared
memory.
 Examples: Disk Drives, Audio Devices or Video Displays.
 Bootstrap – when it is powered up or rebooted, it needs to
have an initial program to run.
 ROM - it is stored within the computer hardware in read-only
memory (ROM) or electrically erasable programmable read-
only memory (EEPROM), known by the general term firmware.
 It initializes all aspects of the system, from CPU registers to
device controllers to memory contents.
 Kernel – The kernel is a computer program at the core of a
computer's operating system and generally has complete
control over everything in the system.
 The bootstrap program must locate the operating-system
kernel and load it into memory.

Terminologies in Computer System Operation

 Interrupt – An interrupt is a signal emitted by hardware or


software when a process or an event needs immediate
attention.
 The occurrence of an event is usually signal by an interrupt
from either the hardware or the software.
 Interrupt service routine – An ISR is a specially written
program to service the condition that caused the interrupt.
 Interrupts are an important part of a computer architecture.
Each computer design has its own interrupt mechanism, but
several functions are common.
 Interrupt service routine – An ISR is a specially written
program to service the condition that caused the interrupt.
 System Call - A system call is a method for a computer
program to request a service from the kernel of the operating
system on which it is running.

Storage Definition and Notation:

• Bit (b): The smallest unit of data storage, representing a binary


digit (0 or 1).

• Byte (B): A unit of storage that consists of 8 bits.

• Kilobyte (KB): Approximately 1,000 bytes (2^10 bytes).

• Megabyte (MB): Approximately 1 million bytes (2^20 bytes).


• Gigabyte (GB): Approximately 1 billion bytes (2^30 bytes).

• Terabyte (TB): Approximately 1 trillion bytes (2^40 bytes).

• Petabyte (PB): Approximately 1 quadrillion bytes (2^50 bytes).

• Exabyte (EB): Approximately 1 quintillion bytes (2^60 bytes).

• Zettabyte (ZB): Approximately 1 sextillion bytes (2^70 bytes).

• Yottabyte (YB): Approximately 1 septillion bytes (2^80 bytes).

Storage Structure:

 Storage Structure consisting of registers, main memory and


magnetic disks is only one of many possible storage systems.
 The CPU can load instructions only from memory, so any
programs to run must be stored there.
 General-purpose computers run most of their programs from
rewritable memory, called main memory (also called random-
access memory, or RAM).
 Main memory commonly is implemented in a semiconductor
technology called dynamic random-access memory (DRAM).
 All forms of memory provide an array of bytes. Each byte has
its own address. Interaction is achieved through a sequence of
load or store instructions to specific memory addresses.
 Registers - Registers are a type of computer memory used to
accept, store, and transfer data and instructions used by the
CPU right away. Processor registers refer to the registers used
by the CPU.
 Cache Memory - Cache Memory is a special very high-speed
memory.
 The cache is a smaller and faster memory that stores copies
of the data from frequently used main memory locations
 There are various different independent caches in a CPU,
which store instructions and data The most important use of
cache memory is that it is used to reduce the average time to
access data from the main memory
 ROM - stands for Read-Only Memory.
 It is a non-volatile memory that is used to stores important
information which is used to operate the system.
 Types of ROM are Mask ROM, PROM, EPROM, EEPROM, FLASH
EPROM.
 RAM – stands for Random-Access Memory.
 It is a volatile memory that is used as short-term memory
storage for a computer’s CPU and used to store working data
and machine code.
 Types of RAM are SRAM and DRAM.
 A typical instruction–execution cycle, as executed on a system
with a von Neumann architecture, first fetches an instruction
from memory and stores that instruction in the instruction
register.
 This arrangement usually is not possible for the following two
reasons:
1. Main memory is usually too small to store all needed
programs and data permanently.
2. Main memory is a volatile storage device that loses its
contents when power is turned off or otherwise lost.
Here comes secondary memory,
 Secondary Storage – It acts as an extension of main memory.
It hols large quantities of data permanently. The main
differences among the various storage systems lie in speed,
cost, size, and volatility
 Magnetic Disk - The most common secondary-storage device
is a magnetic disk, which provides storage for both programs
and data.
 Solid-state disks - have several variants but in general are
faster than magnetic disks and are non-volatile.
 Flash Memory - Another form of solid-state disk is flash
memory, which is popular in cameras and personal digital
assistants (PDAs), in robots, and increasingly for storage on
general-purpose computers. Flash memory is slower than
DRAM but needs no power to retain its contents.

I/O Structure:

 Storage is only one of many types of I/O devices within a


computer.
 A general-purpose computer system consists of CPUs and
multiple device controllers that are connected through a
common bus.
 For instance, seven or more devices can be attached to the
small computer-systems interface (SCSI) controller.
 Operating systems have a device driver for each device
controller. This device driver understands the device controller
and provides the rest of the operating system with a uniform
interface to the device.
 This form of interrupt-driven I/O is fine for moving small
amounts of data but can produce high overhead when used for
bulk data movement such as disk I/O. To solve this problem,
direct memory access (DMA) is used.
 Direct Memory Access (DMA) is a method of handling I/O. It is
generally used for high speed I/O devices.

Computer System Architecture:

A computer system may be organized in a number of different ways,


which we can categorize roughly according to the number of
general-purpose processors used.

 Single-Processor Systems
 Multiprocessor Systems
 Clustered Systems
Single-Processor Systems:

 A single processor system, there is one main CPU capable of


executing a general-purpose instruction set, including
instructions from user processes.
 So only one process can be executed at a time and then the
process is selected from the ready queue.

 There are multiple applications that need to be executed.


However, the system contains a single processor and only one
process can be executed at a time.

Multiprocessor Systems:

 Multiprocessor systems (also known as parallel systems or


tightly coupled systems).
 These systems have two or more processors in close
communication, sharing the computer bus and sometimes the
clock, memory, and peripheral devices.
 Multiple CPUs are interconnected so that a job can be divided
among them for faster execution.
 When a job finishes, results from all CPUs are collected and
compiled to give the final output.
 Jobs needed to share main memory and they may also share
other system resources among themselves.
 Multiple CPUs can also be used to run multiple jobs
simultaneously.

Multiprocessor system have three main advantages:

 Increased reliability: Due to the multiprocessing system,


processing tasks can be distributed among several
processors. This increases reliability as if one processor fails;
the task can be given to another processor for completion.
 Increased throughout: As several processors increase, more
work can be done in less
 The economy of Scale: As multiprocessors systems share
peripherals, secondary storage devices, and power supplies,
they are relatively cheaper than single-processor systems.

Types of Multi processing system are:

1. Symmetrical Multiprocessing System.


2. Asymmetrical Multiprocessing System.

Symmetrical Multiprocessing System:

Each processor executes the same copy of the operating system,


takes its own decisions, and cooperates with other processes to
smooth the entire functioning of the system.

Asymmetrical Multiprocessing System:


CPU n1 acts as a supervisor whose function controls other following
processors.

Each processor is assigned a specific task, and there is a


designated master processor that controls the activities of other
processors.

Clustered Systems:

 Another type of multiprocessor system is a clustered system,


which gathers together multiple CPUs. Clustered systems
differ from the multiprocessor systems.
 Clustered systems, in the context of operating systems, refer
to a configuration where multiple computers or servers are
interconnected to work together as a unified system.
 High-Performance Computing (HPC) Clusters: HPC clusters are
commonly used in scientific research, engineering
simulations, and other computationally intensive applications.
 Load Balancing: In a clustered system, the operating system
implements load balancing mechanisms to distribute
workloads evenly among the nodes
 Distributed File Systems: Clustered systems often employ
distributed file systems that enable data to be shared and
accessed across multiple nodes in a transparent manner.

Operating System Structure:

 The main aspect of operating to MULITPROGRAMMING.


 Multiprogramming increases CPU utilization by organizing jobs
(code and data) so that the CPU always has one to execute.
 Multiprogramming – share CPU, memory, peripheral devices.
(System resources)
 Multitasking (Time sharing) – an extension of
multiprogramming.
 CPU executes multiple jobs by switching among them.
 Multitasking is a broader concept that refers to the ability to
run multiple tasks concurrently
 While time sharing is a specific approach to multitasking that
emphasizes fair resource allocation among multiple users
 Time sharing is a mechanism used within multitasking
operating systems to achieve equitable resource utilization.
 A time-shared operating system uses CPU scheduling and
multiprogramming to provide each user with a small portion of
a time-shared computer, with a program for each user.
 And that execution of program from memory is called
PROCESS.
 Time sharing and multiprogramming require that several jobs
be kept simultaneously in memory.
 TO HANDLE ALL THE JOBS RESIDES IN THE MEMORY, WE
NEED A PERSON CALLED JOB SCHEDULER.

Operating-System Operations:

In operating systems, user mode and privileged mode (also known


as kernel mode or supervisor mode) are two distinct execution
modes with different levels of privileges and access to system
resources.

 Dual Mode Operation:


 At the very least, we need two separate modes of operation:
user mode and kernel mode (also called supervisor mode,
system mode, or privileged mode).
 A bit, called the mode bit, is added to the hardware of the
computer to indicate the current mode: kernel (0) or user (1).
 The dual mode of operation provides us with the means for
protecting the operating system from errant users—and errant
users from one another

 We accomplish this protection by designating some of the


machine instructions that may cause harm as privileged
instructions.
 The hardware allows privileged instructions to be executed
only in kernel mode.
 If an attempt is made to execute a privileged instruction in
user mode, the hardware does not execute the instruction but
rather treats it as illegal and traps it to the operating system.

 Timer:
 A timer can be set to interrupt the computer after a specified
period.
 The period may be fixed (for example, 1/60 second) or variable
(for example, from 1 millisecond to 1 second).
 A variable timer is generally implemented by a fixed-rate clock
and a counter.
 The operating system sets the counter. Every time the clock
ticks, the counter is decremented.
 We can use the timer to prevent a user program from running
too long. A simple technique is to initialize a counter with the
amount of time that a program is allowed to run.

Process Management:

 The operating system creates and manages processes, which


are instances of executing programs.
 It schedules processes, allocates resources, and provides
mechanisms for process synchronization and communication.

 Let's consider the scenario of a user working on a computer


with multiple applications open:
 Web Browsing (Process 1): The user is using a web browser to
browse the internet. The web browser runs as a separate
process and has its own memory space and resources. It is
responsible for rendering web pages, handling user
interactions, and managing network connections.
 Word Processing (Process 2): The user is also working on a
word processing application to write a document. The word
processor runs as a separate process and has its own memory
space and resources. It handles text input, formatting, and
saving the document to the storage device.
 Media Player (Process 3): Additionally, the user has a media
player application open to watch a video. The media player
runs as a separate process and has its own memory space and
resources. It decodes and plays the video file, handles audio
output, and allows the user to control playback.

 The operating system is responsible for the following activities


in connection with process management:
o Scheduling processes and threads on the CPUs.
o Creating and deleting both user and system processes.
o Suspending and resuming processes.
o Providing mechanisms for process synchronization.
o Providing mechanisms for process communication.

Memory Management:

 Memory is the important part of the computer that is used to


store the data.
 Its management is critical to the computer system because
the amount of main memory available in a computer system is
very limited.
 At any time, many processes are competing for it. • Moreover,
to increase performance, several processes are executed
simultaneously.
 For this, we must keep several processes in the main memory,
so it is even more important to manage them effectively.
 The operating system is responsible for the following activities
in connection with memory management:
 Keeping track of which parts of memory are currently being
used and who is using them
 Deciding which processes (or parts of processes) and data to
move into and out of memory.
 Allocating and deallocating memory space as needed.
 The operating system is responsible for the following activities
in connection with memory management:

o Keeping track of which parts of memory are currently


being used and who is using them.
o Deciding which processes (or parts of processes) and
data to move into and out of memory.
o Allocating and deallocating memory space as needed.

Storage Management:

 It refers to the management of the data storage equipment’s


that are used to store the user/computer generated data.
 Storage management is a process for users to optimize the
use of storage devices and to protect the integrity of data
across the devices.

 File System-Management:
 File management is one of the most visible components of an
operating system.
 Computers can store information on several different types of
physical media.
 Magnetic disk, optical disk, and magnetic tape are the most
common.
 Each of these media has its own characteristics and physical
organization.
 Each medium is controlled by a device, such as a disk drive or
tape drive, that also has its own unique characteristics.
 These properties include access speed, capacity, data-transfer
rate, and access method (sequential or random).

 The operating system is responsible for the following activities


in connection with file management:

o Creating and deleting files.


o Creating and deleting directories to organize files.
o Supporting primitives for manipulating files and
directories.
o Mapping files onto secondary storage • Backing up files
on stable (non-volatile) storage media.

 Mass Storage Management:


 The operating system is responsible for the following activities
in connection with disk management:
o Free-space management.
o Storage allocation.
o Disk scheduling.

 Magnetic tape drives and their tapes and CD and DVD drives,
external drives and platters are typical tertiary storage
devices.

Caching:

 It is the process of storing data in a cache, which is a


temporary storage area that facilitates faster access to data
with the goal of improving application and system
performance.

 Main memory can be viewed as a fast cache for secondary


storage, since data in secondary storage must be copied into
main memory for use and data must be in main memory before
being moved to secondary storage for safekeeping.
 The file-system data, which resides permanently on secondary
storage, may appear on several levels in the storage hierarchy.
 At the highest level, the operating system may maintain a
cache of filesystem data in main memory.
I/O Systems:

 The I/O subsystem consists of several components:

o A memory-management component that includes


buffering, caching, and spooling.
o A general device-driver interface.
o Drivers for specific hardware devices Only the device
driver knows the peculiarities of the specific device to
which it is assigned.

Protection and Security:

 Protection, then, is any mechanism for controlling the access


of processes or users to the resources defined by a computer
system.
 Protection and security require the system to be able to
distinguish among all its users.
 Most operating systems maintain a list of user names and
associated user identifiers (user IDs).

You might also like