Due in class at the end of lecture, 20% reduction in the assignment mark for each school day it is late.
The assignments must be your own work. Cheating/copying other people’s files will result in both papers receiving zero.
Course Information (3)
Lab tasks will be demonstrated in the following week lab, and lab reports must be submitted by the end of the lab. You have 1 week to finish the lab task.
Announcements, assignments, lecture handouts, etc.
Check it out at least once per day.
Study to pass
You have to pass both the tests portion and the assignments portion
Demonstrate your task in lab
Answer questions regarding to your own task
Programming style of printouts of your source code, for programming assignments/labs
Introduction to Operating Systems
Role and purpose of the operating system
History of operating system development
Functionality of a typical operating system
Explain the objectives and functions of modern operating systems.
Describe how operating systems have evolved over time from primitive batch systems to sophisticated multiuser systems.
Describe the functions of a contemporary operating system with respect to convenience, efficiency, and the ability to evolve.
Charles Babbage (1791-1871) designed the first true digital computer called the analytical engine .
That was purely mechanical and intended to do math operations
The engine was supposed to be made of brass, and steam powered
He did not actually built the machine but inspired others in the field.
Babbage also thought of the concept of software
And hired the first programmer (Lady Ada , Countess of Lovelace) for his analytical engine
Current Computer Systems
A computer system consists of
What is an Operating System (1)
The software that controls the allocation and usage of hardware resources such as memory, central processing unit (CPU) time, hard disk space, and peripheral devices (like speakers or a mouse).
The operating system is the foundation software on which programs, such as Word or Excel, depend.
An example of an operating system is Microsoft Windows® XP.
What is an Operating System (2)
Provide a service for clients - a virtual machine (top-down view)
An operating system is a layer of the computer system (a virtual machine) between the hardware and user programs.
Multiple address spaces
What is an Operating System (3)
Resource manager (bottom-up view)
An operating system is a resource manager . Resource management includes
Transforming resources - to provide an easier to use version of a resource
Multiplexing resources - create the illusion of multiple resources
Scheduling resources - when and who gets a resource
The hardware resources it manages include
Processors - process management system
Memory - memory management system
I/O devices - I/O system
Disk space - file system
What is an Operating System (4)
The hardware resources are transformed into virtual resources so that an operating system may be viewed as providing a virtual computers , one to each user. A virtual machine (top down view) consists of
Processes - virtualization of the computer including a virtual processor that abstracts the cpu - user mode instruction set + system calls
Virtual memory - virtualization of physical memory
Logical devices - virtualization of physical devices
Files - virtualization of disk space
What is an Operating System (5)
The general functions of an operating system
Allocation - assigns resources to processes needing the resource
Accounting - keeps track of resources - knows which are free and which process the others are allocated to.
Scheduling - decides which process should get the resource next.
Protection - makes sure that a process can only access a resource when it is allowed
History of Operating Systems (1)
First generation 1945 - 1955
Technology: vacuum tubes & plugboards
Programming: setting some switches
Programming language: machine language
Tasks: tables of sine, cosine, logarithms
A Famous Remark
"I think there is a world market for maybe five computers."
Thomas Watson, chairman of IBM - 1943
History of Operating Systems (2)
Second generation 1955 – 1965
Programming: Punched cards
Programming languages: FORTRAN & Assembly
OS: Batch system
Universities started to buy computers (millions $)
bring cards to IBM 1401 machine (good at card reading)
read cards to tape
put tape on IBM 7094 which does computing
put tape on IBM 1401 which prints output offline
Early Batch System
"I have traveled the length and breadth of this country and talked with the best people, and I can assure you that data processing is a fad that won't last out the year.“
The editor in charge of business books for Prentice Hall - 1957
History of Operating Systems (3)
Third generation 1965 – 1980
Programming: Punched cards
Programming languages: FORTRAN & Assembly
Tasks: Scientific & commercial
Computers: IBM 360, DEC PDPs
OS: Multiprogramming/timesharing, spooling
MULTICS (father of all modern OSes)
UNIX (System V, BSD)
POSIX (by IEEE)
MINIX (by Tanenbaum)
Linux (derived from MINIX)
“ There is no reason anyone would want a computer in their home.“
Ken Olson, president, chairman and founder of Digital Equipment Corp. - 1977
History of Operating Systems (4)
Fourth generation 1980-Present
Programming: High level
Programming languages: C/C++, Java, ……
OS: Windows, MacOS, Linux ……
“ We don't see Windows as a long-term graphical interface for the masses.“
A Lotus Software Development official, while demonstrating a new DOS version - 1989
The Operating System Zoo (1)
Mainframe operating systems
High I/O capacity
Batch processing (no interaction, such as large reports)
Transaction processing (large number of small requests)
Timesharing (multiple users sitting in front of clients)
"Computers in the future may weigh no more than 1.5 tons."
Popular Mechanics, forecasting the relentless march of science, 1949
The Operating System Zoo (2)
Server operating systems
Offer services like print, file, or web
UNIX, Windows 2000, Linux
Multiprocessor operating systems
Personal computer operating systems
Single user with a good GUI, such as Windows 98, Windows 2000, Macintosh OS, Linux
The Operating System Zoo (3)
Real-time operating systems
E.g. industrial process control systems where each job must be completed in the specified time.
Hard real-time (nuclear reactor control systems) or soft-real time systems (e.g multimedia systems) depending on the acceptance of missing deadlines
Embedded operating systems:
Real-time systems with some resource constraints like memory, CPU, power.
Smart card operating systems
Extremely primitive OS running on credit card sized devices with a CPU.
Components of a simple personal computer
Brain of the computer
ALU (Arithmetical- Logical Unit)
CU (Control Unit, fetch-execute-decode instructions)
Has a certain set of instructions it can recognize and execute
Basic CPU cycle
Fetch the next instruction
Decode it to determine its type and operands
Programs are list of instructions executed by the CPU
When the computer powers up, CU of CPU starts the fetch-decode-execute cycle
Instructions may be OS instructions or other programs
A bit in PSW controls the mode
Kernel Mode :
CPU can execute every instruction in its instruction set
CPU can use every feature of the hardware
OS runs in kernel mode
User Mode :
Only a subset of instructions can be run
And a subset of hardware features are accessed
Generally all instructions involving I/O and Memory protection are disallowed in that mode
To obtain OS services, a user program must make a system call that traps into kernel mode and invokes the OS
Trap instruction switches from user mode to kernel mode and starts the operating system (system calls and errors such as division by zero causes trap instructions)
Parallelize the fetch, decode, execute sequence
Three stage pipeline : While executing instruction N, decode instruction N+1, and fetch instruction N+2
What happens when a conditional branch occurs in an instruction?
(a) A three-stage pipeline (three instructions processed in 1 cycle)
(b) A superscalar CPU (with multiple execution units)
Pipelining Instruction N+2 Instruction N+3 Instruction N + 4 One CPU Cycle Instruction N + 1 Instruction N Fetch N Decode N Fetch N+1 Execute N Decode N+1 Fetch N+2 Execute N+1 Decode N+2 Fetch N+3 Execute N+2 Decode N+3 Fetch N+4
Memory Hierarchy (1)
Typical memory hierarchy
numbers shown are rough approximations
Magnetic Tape :
Backup purposes and for storing very large data sets.
One dimensional, only sequential access is possible
Reliable (no tape crashes, or time based data corruption)
Was the main data storage medium of the past
Faster than tape
Used for permanent storage (now rewritable)
Are faster than tapes and CDs
They are the main storage medium these days
Data stored in concentric cylinders
Disk head moves in discrete steps
Each position of the disk head identifies a track (divided into multiple sectors, typically 512 bytes)
Rotates continuously with a certain speed (e.g. 7200 rpm)
Disks and tapes are mechanical devices, therefore they are slow compared to (RAM and Cache)
Main Memory (Random Access Memory) :
Much Much faster than magnetic disks but more expensive too
Faster than RAM and more expensive
CPU requests first go to cache, and if they are there (cache hit) then fine, if not there (cache miss) then RAM is accessed
There can be multiple cache levels
Cache is divided into cache lines (usually 64 bytes at each line)
They are the fastest accessible memory locations
Placed at the CPU.
They are usually of size 32 bits, or 64 bits depending on the CPU type
Read Only Memory (ROM)
Write once, read many times
Low level I/O cards
Code for starting the computer
Electrically Erasable Rom (EEPROM)
CMOS (Complementary Metal Oxide Semiconductor)
Volatile but can be sustained with mother board battery for years.
May give checksum errors when being corrupted
Very small, 64 bytes.
Holds the current time and date, configuration parameters (like which disk to boot from etc.)
Yet another famous quote!
"640K ought to be enough for anybody."
Bill Gates, 1981
An input device transfers data from a mechanism like keyboard, mouse, touch screen, or microphone into a CPU register. CPU will then store the data into Main Memory
For output devices , CPU fetches the information from main memory to its registers and transfers this information via the bus to an output device like screen, speaker, or printer.
Communication devices : serial and parallel ports, infrared transmitter/receivers, wireless network cards, network interface cards
CPU DISK CONTROLLER DISK PRINTER PRINTER CONTROLLER MEMORY MEMORY CONTROLLER
Device controllers have microprocessors.
They can work in parallel.
They can tell CPU when they are done.
How I/O Can Be Done
Busy waiting through system call
DMA (Direct Memory Access)
Lab 1: Get Familiar with Linux
Introduction to Linux
Lab material is available on the course webpage
Follow the lab task specifications -- your marks depend on it.