

























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Review all module that being discuss during this semester
Typology: Lecture notes
1 / 65
This page cannot be seen from the preview
Don't miss anything!
On special offer
Module Number Sub Topic Number Supplementary Level 1 1 1
What is an Operating System? An Operating System (OS) is a program or system software that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs.
Goals of an Operating System?
Execute user programs and make solving user problems easier. Make the computer system convenient to use. Use the computer hardware in an efficient manner.
Components of a Computer System Computer hardware – CPU, memory and I/O devices, provides the basic computing resources. Application programs – are used to solve the computing problems of the users such as word processors, games and business programs. Users – who utilize a computer or network service trying to solve different problems. Operating System – controls and coordinates the use of the hardware among the various application programs for the various users.
What is a Kernel? Kernel is the central part of an OS which manages system resources and is always resident in memory. It also acts like a bridge between application and hardware of the computer. It is also the first program that loads after the bootloader.
Bootloader is a program that loads and starts the boot time tasks and processes of an OS. It also places the OS of a computer into memory.
Common Services Offered By Almost All Operating Systems: User Interface Program Execution File system manipulation Input / Output Operations
Communication Resource Allocation Error Detection Accounting Security and protection
Types of Operating System
Batch operating system Time-sharing operating systems Distributed operating system Network operating system Real-time operating system Handheld operating system
Batch Operating System (BOS) The user of a BOS never directly interacts with the computer. Every user prepares his or her job on an offline device like a punch card and submit it to the computer operator. Examples: Payroll System, Bank Statements etc.
Time-sharing Operating System Time-sharing or multitasking is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing.
Distributed Operating System Distributed systems use multiple central processors to serve multiple real-time applications and multiple users. Data processing jobs are distributed among the processors accordingly.
Network Operating System (NOS) A NOS runs on a server and provides the server the capability to manage data, users, groups, security, applications, and other networking functions. Examples: Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X Server, Novell NetWare, and BSD/OS (Berkeley Software Design)
Real-time Operating System (RTOS) RTOS is an operating system intended to serve real-time systems/applications that process data as it comes in, mostly without buffer delay.
Handheld Operating System It is also known as Mobile OS which is built exclusively for a mobile device, such as a smartphone, personal digital assistant (PDA), tablet, wearable devices or other embedded mobile OS.
It alerts the processor temporarily to a high priority process requiring interruption of the current working process and then return to its previous task.
Types of Interrupts: Hardware interrupt Software interrupt
Hardware interrupt is a signal created and sent to the CPU that is caused by some action taken by a hardware device. Example: When a key is pressed or when the mouse is moved.
Software Interrupt arises due to illegal and erroneous use of an instruction or data. It often occurs when an application software terminates or when it requests the operating system for some service. Example: stack overflow, division by zero, invalid opcode, etc. These are also called traps.
Interrupt Handling The operating system preserves the state of the CPU by storing registers and the program counter Determines which type of interrupt has occurred:
Polling – operating system sends signal to each devices asking if they have a request Vectored interrupt system – requesting device sends interrupt to the operating system. Separate segments of code determine what action should be taken for each type of interrupt.
Operating System Operations Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code(1) or kernel code(0) Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user A system call is a way for programs to interact with the OS. A computer program makes a system call when it makes a request to the OS‘s kernel.
Single-Processor System There is one main CPU capable of executing a general-purpose instruction set, including instructions from user processes.
Multiprocessor System Also known as parallel-system or multicore. First appeared in servers and now in smartphones and tablet computers.
Computer System Architecture
Most systems use a single general-purpose processor (PDAs through mainframes) Most systems have special-purpose processors as well Multiprocessors systems growing in use and importance Also known as parallel systems or tightly-coupled systems
Advantages :
A recent trend in CPU design is to include multiple computing cores on a single chip. Such multiprocessor systems are termed multicore. They can be more efficient than multiple chips with single core. A dual-core design with two cores on the same chip. Each core has its own register set as well as its own local cache.
Clustered System Like multiprocessor systems, but multiple systems working together Usually sharing storage via a storage-area network (SAN) Provides a high-availability service which survives failures Asymmetric clustering has one machine in hot-standby mode Symmetric clustering has multiple nodes running applications, monitoring each other Some clusters are for high-performance computing (HPC).
Computing Environment
Office computing environment o PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing o Now portals allowing networked and remote systems access to same resources
Home computing environment o Used to be single system, then modems o Now firewalled, networked
Mobile computing o Refers to computing on handheld smartphones and tablet computers.
Platform as a service(PaaS) – software stack ready for application use via the Internet Infrastructure as a service(IaaS) – servers or storage available over the Internet
Open-Source Operating System
Open Source operating systems are released under a license where the copyright holder allows others to study, change as well as distribute the software to other people. Counter to the copy protection and Digital Rights Management (DRM) movement Started by Free Software Foundation (FSF), which has “copyleft” GNU Public License (GPL) Examples: GNU( GNU’s N ot U nix)/Linux, BSD UNIX (including core of Mac OS X), and Sun Solaris
Module Number Sub Topic Number Supplementary Level 2 1 1
Example :
As a process executes, it changes state. The current activity of a process party defines its state. Each sequential process may be in one of following states:
Each process is represented in the operating system by a process control block (PCB) – also called a task control block. A PCB is a data block or record containing many pieces of the information associated with a specific process including:
Example of the CPU being switched from one process to another. This is also known as Context Switch Diagram
pointer processstate process number program counter
registers
memory limits list of open files
. . .
save state into PCB 0
reload state into PCB 1
. . .
save state into PCB 1
reload state into PCB 0
. . .
process P 0 operating system process P 1
executing
executing
executing
interrupt or system call
interrupt or system call
idle
idle
idle
Example:
Given two processes, P 0 and P 1.
If the system runs the two processes sequentially, then CPU utilization is only 50%.
Example: Applying multiprogramming to the two processes, P 0 and P 1
Then CPU utilization increases to 100%.
process P 0 start (^) idle; input
idle; input
idle; input
stop
process P 1 start (^) idle; input
idle; input
idle; input
stop
process P 0 start (^) idle; input
idle; input
idle; input
stop
process P 1 start (^) idle; input
idle; input
idle; input
stop
CPU scheduling decisions may take place under the following four circumstances:
periods spent waiting to get into memory, waiting in the ready queue, executing in the CPU, and doing I/O.
A good CPU scheduling algorithm maximizes CPU utilization and throughput and minimizes turnaround time, waiting time and response time.
Non-preemptive:
Preemptive:
Module Number Sub Topic Number Supplementary Level 2 2 1
Example 1:
Given:
Process
Arrival Time
Burst time
Waiting Time
Turnaround Time P1 0 5 0 - 0 = 0 5 - 0 = 5 P2 0 3 5 - 0 =^^5^8 - 0 =^^8 P3 0 8 8 - 0 =^^8^16 - 0 =^16 P4 0 6 16 - 0 = 16 22 - 0 = 22
Average
7.25 ms
12.75 ms
Gantt Chart:
Example 1:
Process Arrival Time
Burst time
Waiting Time
Turnaround Time P1 0 5 3 - 0 = 3 8 - 0 = 8 P2 0 3 0 - 0 = 0 3 - 0 = P3 0 8 14 - 0 = 14 22 - 0 = 22 P4 0 6 8 - 0 = 8 14 - 0 =
Average
6.25 ms
11.75 ms
Gantt Chart:
Example 2 :
Process
Arrival Time
Burst time
Waiting Time
Turnaround Time P1 (^0 5 0) - 0 = 0 5 - 0 = 5 P2 1 3 5 - 1 = 4 8 - 1 = 7 P3 2 8 14 - 2 = 12 22 - 2 = 20 P4 3 6 8 - 3 = 5 14 - 3 = 11
Average
5.25 ms
10.75 ms
Gantt Chart:
Example 1:
Consider the lowest priority value gets the highest priority. In this case, process with priority value (1) is the highest priority.
Process
Arrival Time
Burst time
Priority
Waiting Time
Turnaround Time P1 0 5 1 0 - 0 = 0 5 - 0 = 5 P2 (^0 3 2 13) - 0 = 13 16 - 0 = 16 P3 0 8 1 5 - 0 = 5 13 - 0 = 13 P4 0 6 3 16 - 0 = 16 22 - 0 = 22
Average 34/ 8.5 ms
14 ms
Gantt Chart: