Operating Systems Midterm Chapter 1-2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Computer-System Architecture

- Most systems use a single general-purpose processor - Most systems have a *special-purpose* processor as well (a) Multiprocessors

Communications

Processes may exchange information, on the same computer or between computers over a network - Communications may be via shared memory or through message passing (packets moved by the OS)

Resource Allocation

When multiple users or multiple jobs running concurrently, resources must be allocated to each of them - Many types of resources (a) CPU cycles (b) Main memory (c) File storage (d) I/O devices

Storage Management

*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) (a) Varying properties include *access speed, capacity, data-transfer rate, access method* (sequential or random) *File-System management* - Files usually organized into directories - Access control on most systems to determine who can access what - OS activities include: (a) Creating and deleting files and directories (b) Primitives to manipulate files and directories (c) Mapping files onto secondary storage (d) Backup files onto stable (non-volatile) storage media

Types of System Calls

- *Information maintenance* (a) get time or date, set time or date (b) get system data, set system data (c) get and set process, file, or device attributes - *Communications* (a) create, delete communication connection (b) send, receive messages if *message passing model* to *host name* or *process name* (a) From *client* to *server* - *Shared-memory model* create and gain access to memory regions - transfer status information - attach and detach remote devices

Virtualization

- Allows operating systems to run applications with other OSes (a) Vast and growing industry - *Emulation* used when source CPU type different from target type (i.e. PowerPC to Intel x86) (a) Generally slowest method (b) When computer language not compiled to native code - *interpretation* - *Virtualization* - OS natively compiled for CPU, running *guest* OSes also natively compiled (a) Consider VMware running WinXP guests, each running applications all on native WinXP *host* OS (b) *VMM* (virtual machine Manager) provides virtualization services

Common Functions of Interrupts

- Interrupt *transfers control* to the interrupt service routine generally, through the *interrupt vector*, which contains the addresses of all the service routines - Interrupt architecture must *save the address* of the interrupted instruction - A *trap* or *exception* is a software-generated interrupt caused either by an error or a user request - An operating system is *interrupt driven*

I/O Subsystem

- One purpose of OS is to *hide peculiarities of hardware devices* from users - I/O subsystem responsible for: (a) Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs) (b) General device-driver interface (c) Drivers for specific hardware devices

System Calls

- Programming interface to the services provided by the OS - Typically written in a high-level language (C or C++) - Mostly accessed by programs via a high-level *Application Programming Interface (API)* rather than direct system call use - Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)

Process Management Activities

- The operating system is responsible for the following activities in connection with process management: (1) Creating and deleting both user and system processes (2) Suspending and resuming processes (3) Providing mechanisms for process synchronization (4) Providing mechanisms for process communication (5) Providing mechanisms for deadlock handling

Memory Management

- 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 (a) Optimizing CPU utilization and computer response to users - *Memory management activities* (a) Keeping track of which parts of memory are currently being used and by whom (b) Deciding which processes (or parts thereof) and data to move into and out of memory (c) Allocating and deallocating memory space as needed

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 - *Proper management* is of central importance - Entire speed of computer operation hinges on disk subsystem and its algorithms - *OS activities* (a) Free-space management (b) Storage allocation (c) Disk scheduling - Some storage need not be fast (a) Tertiary storage includes optical storage, magnetic tape (b) Still must be managed - by OS or applications (c) Varies between WORM (write-once, read-many-times) and RW (read-write)

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 an *active entity* - Process needs resources to accomplish its task (a) CPU, memory, I/O, files (b) Initialization data - Process termination requires reclaim of any reusable resources - Single-threaded process has one *program counter* specifying location of next instruction to execute (a) Process executes instructions sequentially, one at a time, until completion - Multi-threaded process has one program counter per thread - Typically system has many processes, some user, some operating system running concurrently on one or more CPUs (a) Concurrency by multiplexing the CPUs among the processes / threads

Multiprogramming (Batch System)

A single user cannot keep CPU and I/O busy at all times. Jobs are organized and executed one at a time by the CPU. A subset of total jobs is kept in memory, and when there is a wait, the OS switches to another job. -Needed for efficiency

Multiprocessors

Also known as *parallel systems, tightly-coupled system* ADVANTAGES: (1) Increased throughput (2) Economy of scale (in order to get the same amount of power from single processor, you would need *multiple* of them. Less economic.) (3) Increased reliability (Even if one fails, yous till have the remaining processors to work) TWO TYPES: (a) *Asymmetric Multiprocessing* - Each processor is assigned to a specific task (b) *Symmetric Multiprocessing* - Each processor performs all tasks

Protection

Any mechanism for controlling access of processes or users to resources defined by the OS

Security

Defense of the system against internal and external attacks - Huge range, including *denial-of-service*, *worms*, *viruses*, *identity theft*, *theft of service*

Caching

Important principle, performed at *many levels* in a computer (in hardware, operating system, software) - Information in use copied from *slower to faster* storage temporarily - Faster storage (cache) *checked first* to determine if information is in there (a) If it is, information used directly from cache (fast) (b) If not, data copied to cache and used there - Cache *smaller than storage* being cached (a) Cache management important design problem (b) Cache size and replacement policy

Timesharing (multitasking)

Logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating *interactive* computing - *response time* should be <1 second - each user has at least one program executing in memory -> *process* - If several jobs ready to run at the same time -> *CPU scheduling* - If processes don't fit in memory, *swapping* moves them in and out to run - *Virtual memory* allows execution of processes not completely in memory

Operating System

OS is a *resource allocator* - manages all resources - 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 - Contains resources like CPU, Memory, I/O Devices

Error detection

OS needs to be constantly aware of possible errors - May occur in the CPU and memory hardware, in I/O devices, in user program - For each type of error, OS should take the appropriate action to ensure correct and consistent computing - Debugging facilities can greatly enhance the user's and programmer's abilities to efficiently use the system

Interrupt Driven Operation (hardware and software)

OS-System Operation - Hardware interrupt by one of the devices - Software interrupt (*exception* or *trap*): (a) Software error (e.g. division by zero) (b) Request for operating system service (c) Other process problems include infinite loop, processes modifying each other or the operating system

Dual-Mode Operation

Operating-System Operation - *Dual-mode* operation allows OS to protect itself and other system components - *User mode* and *kernel mode* - *Mode bit* provided by hardware (a) Provides ability to distinguish when system is running user code or kernel code (b) Some interactions designated as *privileged*, only executable in kernel mode (c) *System call* changes mode to kernel, return from call resets it to user - Increasigly CPUs support multi-mode operations (a) I.e. *virtual machine manager (VMM)* mode for guest *VMs*

Protecting and Security

Systems generally first distinguish among users, to determine who can do what - User identifies (*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

Throughput

The amount of data that can be transferred from one node to another node in a specified amount of time. - Measures the performance of the system - Increased throughput = increased performance

File-system manipulation

The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file information, permission management

Protection and security

The owners of information stores in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other - *Protection* involves ensuring that all access to system resources is controled - *Security* of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts

Accounting

To keep track of which users use how much and what kinds of computer resources


Set pelajaran terkait

What is Ecology? (Miller & Levine Chapter 3.1)

View Set

NCTI: Troubleshooting Advanced Services

View Set

Mitosis and Meiosis Questions Test 3

View Set

Psych - Ch. 13 Social - Prep: Learning Curve

View Set

Intro to Latin American Studies Exam 3

View Set

Patients Care with Esophageal Problems

View Set

Lección 13 : Estructura: 13.1 Escoger

View Set

NCLEX Women's Health and Maternity/Newborn Drugs

View Set