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

POS Short Notes Ch1 & 2

Uploaded by

yaqeen.yaqub
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)
4 views

POS Short Notes Ch1 & 2

Uploaded by

yaqeen.yaqub
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/ 9

Chapter 1

Operating System Definition Operating System Examples


It is an intermediate between computer hardware and the user.

interface

Goals of an Operating System:


1. Optimum and efficient use
2. Convenience and user-friendliness
3. Hide the complexity

Interface of Operating Systems


⚫The way the user is interacting or using the OS is called the interface.
⚫OS have two types of interfaces:
1. Character User Interface (CUI).
2. Graphical User Interface (GUI).

1- Character User Interface (CUI) 2- Graphical User Interface (GUI)


⚫ Commands must be typed to give instructions to the ⚫ It is made up of mainly of five primary components:
computer hardware.
windows, icons, menu bars, pointing devices, and graphics.
⚫ The user needs to remember the commands for the
⚫ When a GUI is present, the user is interacting with one of
proper use of computer system.
these components at all times.
⚫ Example: Disk Operating System (DOS)
⚫ Examples: Windows, MAC
4 Computer System Components?

What Operating Systems Do?


Depends on the point of view (User OR System)

A- User View of OS Computer-System Architecture


1- Ease of use
Don’t care about resource utilization

2- Efficient Resource Utilization


Shared computers such as mainframe or Home PCs
minicomputers must keep all users
happy

B- System View of OS
Computer-System Architecture Symmetric Vs Asymmetric Multiprocessing
1- Single Processor Systems
• There is one main CPU capable of executing a general purpose instruction
set ,including instructions from user processes.
4- Multiprogramming (Batch system)
• Most systems use a single general-purpose processor (PDAs through • Single user cannot keep CPU and I/O devices busy at all times
mainframes). • Multiprogramming organizes jobs (code and data) so CPU always has one to
• Most systems have special-purpose processors as well. execute
• Such as: Disk-controller microprocessor and Keyboard microprocessor • A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When it has to wait (for I/O for example), OS switches to another job
2- Multiprocessor Systems
(parallel systems, tightly-coupled systems) 5- Timesharing (multitasking)
Advantages include: • logical extension where CPU switches jobs so users can interact with each job
while it is running, creating interactive computing
1. Increased throughput
2. Economy of scale • Response time should be < 1 second
3. Increased reliability ( graceful degradation or fault tolerance) • Each user has at least one program executing in the memory 🢡 process

Two types: • If several jobs ready to run at the same time 🢡 CPU scheduling

1- Asymmetric Multiprocessing (Shared memory system) • If processes don’t fit in memory, swapping moves them in and out to run
each processor is assigned a specific task. • Virtual memory allows execution of processes not completely in memory
2- Symmetric Multiprocessing (Master processors)
6- Distributed / Network systems
each processor performs all tasks
• Network is a communications path, TCP/IP (Transmission Control
Protocol/Internet Protocol) most common
3- Clustered Systems • Local Area Network (LAN)
• Like multiprocessor systems, but multiple systems working together • Wide Area Network (WAN)
• Usually sharing storage via a storage-area network (SAN) • Metropolitan Area Network (MAN)
• Provides a high-availability service that survives failures • Personal Area Network (PAN)
• Some clusters are for high-performance computing (HPC) • Network OS provides features between systems across a network
• Applications must be written to use parallelization
• Some have distributed lock manager (DLM) to avoid conflicting operations 7- Special Purpose/ Real-time systems
Two types:
• Real-time embedded systems most prevalent form of computers,
1- Asymmetric clustering: one machine in hot-standby mode these devices are found everywhere,
2- Symmetric clustering: multiple nodes running applications, • Real-time OS has well-defined fixed time constraints
monitoring each other • Processing must be done within constraint
• Correct operation only if constraints met
Process Management
 A process is a program in execution. It is a unit of work
within the system. Program is a passive entity, process is 5 Activities
an active entity.
 Process needs resources to accomplish its task (CPU, memory, I/O,
files) & Initialization data)
 Process termination requires reclaim of any reusable resources

 Single-threaded process has one program counter(PC)specifying


location of next instruction to execute (Process executes instructions
sequentially, one at a time, until completion)
 Multi-threaded process has one program counter per thread

Memory Management 3 Activities


 To execute a program all (or part) of the instructions must be in memory

 All (or part) of the data that is needed by the program must be in memory.

 Memory management determines what is in memory and when

 Optimizing CPU utilization and computer response to users

Storage Management
4 Activities
 OS provides uniform, logical view of information storage
 Abstracts physical properties to logical storage unit- file
 Each medium is controlled by device (i.e., disk drive, tape drive)

 File-System management
 Files usually organized into directories
 Access control on most systems to determine
who can access what
OS Key Functions / Services

Operating-System Structure

Virtual Machines
• It takes the layered approach to its logical conclusion. It treats hardware and
the operating system kernel as though they were all hardware.
• It provides an interface identical to the underlying bare
hardware.
• The operating system host creates the illusion that a
process has its own processor and (virtual memory).
• Each guest is provided with a (virtual) copy of underlying computer.
Chapter 2: Process Management

Process Concepts Process Control Block (PCB)


• In the past, computers could only run one program at a time. • A data structure stores the information about a process.
• Today, they can handle multiple programs at once. • Each process is represented in OS by PCB
• This required better organization and separation of programs, • PCB is also known as a Task Control Block.
leading to the concept of a "process,“. • OS keeps all process information from its creation until its
• Process = a program actively running / in execution. termination in PCB.
• When a process finishes, its process control block is released from
the main memory.

Process State
• As a process executes, it changes state
• Process Transition: When a process goes
Various contents of PCB
from one state to another state.

Remember
New = created.
1.New State: When a process is created. Ready = waiting for CPU
2.Ready State: When process are waiting for CPU
3.Running State: When a process is being executed. Running = executed.
4.Wait State: When a process is waiting for some resource. Wait waiting for resource.
5.Terminate State: When a process finishes its execution. Terminate = finishes
Threads

• A thread is a basic unit of CPU utilization


Multithreading Models
• Relationship between user threads and Kernel threads is supported by:
• It contains:
1- a thread ID, 1- Many-to-One Model

2- a program counter Maps many user-level threads to one kernel thread.


3- a register set, 2- One-to-One Model
Maps each user thread to a kernel thread. Provides concurrency?
4- a stack allowing another thread to run when a thread makes a blocking
• It shares with other threads belonging to the same process its code system call
section, data section, and other operating-system resources, such 3- Many-to-Many Model
as open files and signals Multiplexes many user-level threads to a smaller / equal
number of kernel threads.

Benefits of Multithreaded Programming Interprocess Communication (IPC)


• Processes executing in OS may be either:
1- Independent Process: A process that does not share data with any
other process.
2- A Cooperating Processes: processes that share data with other
processes.
Inter-Process Communication (IPC): A technique, that allows
Cooperating Processes to exchange data and information

2 Fundamental models of IPC


1- Shared memory: requires that two
Types of Multithreading Models (2) or more processes agree to remove this
1- User Level restriction.
Supported above the kernel / Managed without kernel support 2- Message passing: provides a
mechanism to allow processes to
2- Kernel Threads
communicate and synchronize their
Supported & Managed by Operating System actions without sharing the same address
space.
Cooperating processes & IPC

4 reasons for allowing process cooperation 2 Fundamental models of IPC


1- Information sharing
1- Shared memory
2- Computation speedup Exchange information by reading
3- Modularity and writing data in the shared
4- Convenience areas.

2- Message passing
Mechanism allow processes to
communicate and synchronize
without sharing the same
address space.

Examples of IPC

1- Pipes: pipes are a one-way communication channel for IPC


2- FIFO: A FIFO (First In First Out) is a one-way flow of data. FIFO is a
named pipe
3- Shared Memory: Shared Memory is an efficeint means of passing
data between programs
4- Message Queue: IPC message queues are transient memory areas,
typically provided by the underlying operating system, used for
communication between clients and servers
5- Semaphores: IPC technique is commonly use for two purposes: to
share a common memory space and to share access to files.

You might also like