Lecture 01 AV-323 Introduction
Lecture 01 AV-323 Introduction
Operating Systems
Lecture No 01
Introduction to Operating Systems
August 6, 2024
Number of Slides: 27
1
Course Details
• Credit Hours 2–0
• Assessment System:
Quizzes 10% - 15%
OHTs 30% - 40%
Theory/Instruction
Assignments 5% - 10%
(100%)
ESE 40% - 50%
2
Reading Material
Textbook
• Operating Systems Concepts by Silberschatz, Galvin, and Gagne,
10th Ed, 2018.
References Material:
1. Andrew S Tanenbaum and Herbert Bos. Modern Operating
Systems. 4th Ed, 2014.
2. Operating Systems Principles & Practice by Thomas Anderson
and Michael Dahlin 2nd Ed, 2014.
3. Kay Robbins & Steve Robbins. Unix Systems Programming, 2nd
Ed, 2015.
3
In this lecture
• What is an operating system (OS) and what does it
do?
• Computer-System Organization
• Interrupts
• Storage structure
4
What is an Operating System?
• A software program that acts as an intermediary
between a user of a computer and the computer
hardware
• Operating system goals:
• Execute user programs and make solving user problems
easier
• Make the computer system convenient to use
• Use the computer hardware in an efficient manner
5
What Operating Systems Do?
• Depends on the point of view of different devices
• USER’S VIEW
• Users want convenience, ease of use and good performance
• Here, OS don’t care about resource utilization
• SYSTEM’S VIEW
• Shared computer such as mainframe must keep all users happy
• Here, OS is a resource allocator and control program making efficient use
of HW and managing execution of user programs
• EXAMPLES
1. Mobile devices like smartphones are resource poor,
optimized for usability and battery life
• Mobile user interfaces such as touch screens, voice recognition
2. Some computers have little or no user interface, such as
embedded computers in automobiles 6
Like a government, an OS performs no
useful function by itself. It simply
provides an environment within which
other programs can do useful work
7
Importance of Operating System (OS)
• OS manages all your software applications and
hardware.
• OS allows user to communicate with the computing
hardware.
• Just about every computing device has an operating
system
• desktops and laptops
• enterprise-class server and cloud computers
• cell phone
• iPods, video game consoles, and television set top boxes
• Autonomous cars
8
In the Market
• Some firms develop their own proprietary OS
• e.g., Microsoft, Apple, Google, etc.
• Some firms help others develop an OS for cars,
fighter jets, etc.
• e.g., Wind River for VxWorks, etc.
• Some develop one as open-source
• e.g., Red Hat and Intel for developing Linux, etc.
9
Computer System Structure
• Computer system can be divided into four
components:
• Hardware – provides basic computing resources
• CPU, memory, I/O devices
• Operating system
• Controls and coordinates use of hardware among various
applications and users
• Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users
• Word processors, compilers, web browsers, database systems,
video games
• Users
• People, machines, other computers
10
Source: Wikipedia 11
Why Study Operating Systems?
• Almost all code runs on top of an operating system
• Hence, knowledge of how operating systems work is
crucial to proper, efficient, effective, and secure
programming
• The following is essential to not only the OS
developers but also for the application developers:
• Understanding the fundamentals of OS
• How OS drives computer hardware?
• What OS serves applications?
12
Overview of Computer
System Structure
Section 1.2
13
Computer System Organization
• There are CPUs and device controllers
• CPUs and device controllers can run concurrently
competing for memory cycles
• A device controller is in charge of a particular I/O device
• Each device controller has a local buffer and special-
purpose registers
• The device controller is responsible for moving data between
its peripheral device/s and its buffer
• One or more CPUs and device controllers connect
through common bus providing access to shared
memory
Computer-System Operation
• Each device controller type has an OS device driver to
manage it
• CPU moves data from/to main memory to/from local buffers
• I/O is from the external device to local buffer of device
controller
• Device communicates with CPU through an interrupt
Computer-System Operation
• Some basics should be learned regarding how the
computer systems operate.
• We shall discuss
• Interrupts that alert CPU to events that require attention
• Storage structure
16
Interrupts
• Communication occurs between the managers i.e.,
device controllers and device drivers
• The device controller, after finishing an operation, has
to inform the device drivers
• This is done through the interrupts
• An operating system is interrupt driven
• Interrupt requests CPU to divert its attention to its
interrupt service routine through the interrupt vector
(which is a memory space)
• Interrupt architecture must save the address of the
interrupted instruction
Interrupt Timeline
Interrupt-drive I/O Cycle
I/O device
Device controller
Storage Structure
Storage Structure
• Main memory a.k.a. primary storage (rewritable) – only
large storage media that the CPU can access directly
• Random access
• Typically, volatile
• Typically implemented on a semiconductor technology
called Dynamic Random-access Memory (DRAM)
• Secondary storage – extension of main memory that
provides large nonvolatile storage capacity
• Bootstrap program is loaded at power-up or reboot
• Typically stored in ROM (or EEPROM, generally
known as firmware)
Storage Structure (Cont.)
• Non-volatile memory (NVM) devices– nonvolatile
• Examples: ROM, magnetic storage devices like hard disk
drives and magnetic tapes, optical discs.
• However, in the textbook, NVM refers to a faster storage
device than the hard disk drives e.g., flash memory (USB,
memory cards, SSDs, smartphones).
• Hard Disk Drives (HDD) – rigid metal or glass platters
covered with magnetic recording material
• Disk surface is logically divided into tracks, which are
subdivided into sectors
• The disk controller determines the interaction
between the device and the computer
Storage Definitions and Notation Review
The basic unit of computer storage is the bit. A bit can contain one of two
values, 0 and 1. All other storage in a computer is based on collections of bits.
Given enough bits, it is amazing how many things a computer can represent:
numbers, letters, images, movies, sounds, documents, and programs, to name
a few. A byte is 8 bits, and on most computers, it is the smallest convenient
chunk of storage. For example, most computers don’t have an instruction to
move a bit but do have one to move a byte. A less common term is word,
which is a given computer architecture’s native unit of data. A word is made
up of one or more bytes. For example, a computer that has 64-bit registers and
64-bit memory addressing typically has 64-bit (8-byte) words. A computer
executes many operations in its native word size rather than a byte at a time.
27