Download presentation
Presentation is loading. Please wait.
1
Chapter 1 Introduction to Operating System
Bernard Chen Spring 2007
2
Outline 1.1 What is OS 1.2 Computer System Organization
1.3 Computer System Architecture 1.4 OS Structure 1.5 OS Operations Process, Memory, Storage management 1.9 Protection and Security 1.10~ Systems
3
1.1 What is Operating System?
An operating system is a program that manages the computer hardware. It also provides a basis for application programs and acts as an intermediary between the computer user and computer hardware.
4
What do Operating System do?
The computer system can be divided roughly into four components: The hardware The operating system The application software The Users
6
USER View of OS Ease to use (Home PCs) Efficient resource utilization
(Work stations)
7
SYSTEM view of OS OS is a resource allocator
Manages all resources (CPU time, memory space, storage space, I/O and so on) Decides between conflicting requests for efficient and fair resource use OS is a control program Controls execution of programs to prevent errors and improper use of the computer
8
1.2 Computer System Organization
Basic Organization Storage Structure I/O structure
9
Computer Startup Bootstrap program is loaded at power up or reboot
Typically stored in ROM, generally known as firmware Initialize all aspects of system Loads operating system kernel and starts execution
10
1.2.1 Computer System Organization
11
1.2.1 Computer System Organization
I/O devices and the CPU can execute concurrently. Each device controller is in charge of a particular device type. Each device controller has a local buffer.
12
Interrupt Timeline
13
1.2.2 Storage Structure Main Memory:
Main memory is the only large storage media that the CPU can access directly Main memory is usually too small to store all needed programs and data Main memory is a volatile storage device that loses its contents when power is off
14
1.2.2 Storage Structure Therefore, most computer provide secondary storage as extension to store web browser, compliers, word processors…etc
15
Storage Device Hierarchy
16
1.2.2 Storage Structure Storage systems organized in hierarchy. Speed
Cost Volatility Caching–copying information into faster storage system; main memory can be viewed as a last cache for secondary storage.
17
Performance of Various Levels of Storage
18
Caching Information in use copied from slower to faster storage temporarily Important principle, performed at many levels in a computer (in hardware, operating system, software)
19
Caching Faster storage (cache) checked first to determine if information is there If it is, information used directly from the cache (fast) If not, data copied to cache and used there Cache is usually smaller than storage being cached Cache management is an important design problem Cache size and replacement policy
20
1.3 Computer-System Architecture
1.3.1 Single-Processor Systems 1.3.2 Multiprocessor Systems 1.3.3 Cluster Systems
21
1.3.1 Single-Processor Systems
On a single processor system, there is only one main CPU capable of executing a general purpose instruction set. Some other special-purpose processors may also included. Such as: GPU Disk-controller microprocessor Keyboard microprocessor
22
1.3.2 Multiprocessor Systems
Also called Parallel Systems Advantages: Increase throughput Economy of scale Increase reliability (fault tolerant)
23
1.3.2 Multiprocessor Systems
Two types of multiprocessor systems: 1. Asymmetric multiprocessing (master and slave processors) 2. Symmetric multiprocessing (Shared memory system)
24
1.3.3 Clustered Systems Clustered computers share storage and are closely linked via Local-area network (LAN) or a faster interconnection.
25
1.4 OS Architecture One of the most important aspect of OS is the ability to Multiprogramming Single user cannot keep CPU and I/O devices busy at all times One job selected and run via job scheduling When it has to wait (for I/O for example), OS switches to another job
26
Memory Layout for Multiprogrammed System
27
Multiprogramming Jobs are stored in “Job Pool”
Virtual memory is the useful technique for the limitation size of physical memory
28
1.5 OS operations Interrupt (driven by hardware) vs.
Trap (called by software or error) Trap example: divide by 0; invalid memory access We need to make sure that an error in a user program could cause problems only for the one program that was running (such as infinite loop)
29
Dual Mode Operation Dual-mode operation allows OS to protect itself and other system components It contains user mode (mode bit:1) and Kernel mode (mode bit:0) The operating system loaded user application starts in user mode. Whenever a trap or interrupt occurs, hardware switches to kernel mode.
30
Transition from user to kernel mode
31
C library handling of write()
#include<stdio.h> Int main() { … printf(“hellow world”); } User mode Standard C library Kernel mode Write() system call
32
Dual Mode Operation Privileged instructions: some machine instructions that may cause harm, can only be executed in kernel mode. Such as instruction switch to user mode; I/O control; timer management, and interrupt management.
33
Timer To prevent the OS out of control by CPU
Set interrupt after specific period Operating system decrements counter When counter zero generate an interrupt Set up before scheduling process to regain control or terminate program that exceeds allotted time
34
Process management A process is a program in execution. It is a unit of work within the system. Process needs resources to accomplish its task CPU, Memory, files, I/O devices Process termination requires reclaim of any reusable resources
35
Process management 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
36
Process management The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes (Ch3) Suspending and resuming processes (Ch5) Providing mechanisms for process synchronization (Ch6) Providing mechanisms for process communication (Ch4) Providing mechanisms for deadlock handling(ch7)
37
Memory Management All data in memory before and after processing
All instructions in memory in order to execute Memory management determines what is in memory when optimizing CPU utilization and computer response to users
38
Memory management activities
Keeping track of which parts of memory are currently being used and by whom Deciding which processes and data to move into and out of memory Allocating and deallocating memory space as needed
39
Storage Management OS provides uniform, logical view of information storage file Each medium is controlled by device (i.e., disk drive, tape drive)
40
Storage Management File-System management
Files usually organized into directories Access control on most systems to determine who can access what OS activities include Creating and deleting files and directories Primitives to manipulate files and dirs Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media
41
Mass Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time. OS activities Free-space management Storage allocation Disk scheduling Tertiary storage includes optical storage, magnetic tape Varies between WORM (write-once, read-many-times) and RW (read-write)
42
Protection and Security
Protection–any mechanism for controlling access of processes or users to resources defined by the OS (Ch14) Security–defense of the system against internal and external attacks even when protection is activated (Ch15) (including denial-of-service, worms, viruses, identity theft, theft of service)
43
Protection and Security
Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file Privilege escalation allows user to change to effective ID with more rights
44
Computing Environments
Traditional computer Used to be single system, then modems Now firewalled, networked
45
Client-Server computing
Many system now servers, responding request to clients
46
Peer Peer-to to-Peer Computing
Another model of distributed system P2P does not distinguish clients and servers Instead all nodes are considered peers May each act as client, server or both Node must join P2P network
47
Web-Based computing Web has become ubiquitous
More devices becoming networked to allow web access, such as work stations, PDA, even cell phone
48
Operating System Services
User interface Program execution File-system manipulation Communication Error detection Resource allocation Accounting Protection and security
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.