CS 571 Operating Systems

1y ago
33 Views
2 Downloads
907.43 KB
45 Pages
Last View : 17d ago
Last Download : 3m ago
Upload by : Abram Andresen
Transcription

CS 571Operating SystemsProf. Sanjeev SetiaFall 2001Overview? Prerequisites? Computer Architecture (CS 365)? C /C/Java progamming? Textbook? Silbershatz,Galvin,Gagne – Operating Systems Concepts? Grading? One midterm exam (25%), Final Exam (25%)? Assignments (50%)? Three Programming Assignments? Concurrent Programming? RPC/RMI? Distributed File System? First two to be done individually, third may be done in groups oftwo? Late submission penalty – 10% per day? Can “redo”first two assignments to improve grade to someextent (can make up half the difference between old grade andmax grade)Operating Systems1.21

Logistics? Class Web Page? http://www.cs.gmu.edu/ setia/cs571/? Slides, Handouts, Old Exams, Useful Links? Slides? More than 90% of slides taken from slides made available byauthors of textbook? http://www.bell-labs.com/topic/books/os-book/? Office Hrs? Monday, 2 – 4 pm, Room 347, S&T II? setia@cs.gmu.edu? TA? Vamshi Kalakuntla? Office Hrs? Office? Computer Accounts (IT&E or your own machine at home/work)Operating Systems1.3Chapter 1: Introduction? What is an Operating System? Mainframe Systems? Desktop Systems? Multiprocessor Systems? Distributed Systems? Clustered System? Real -Time Systems? Handheld Systems? Computing EnvironmentsOperating Systems1.42

What is an Operating System? A program that acts as an intermediary between a user ofa computer and the computer hardware.? Operating system goals:? Execute user programs and make solving user problemseasier.? Make the computer system convenient to use.? Use the computer hardware in an efficient manner.Operating Systems1.5Computer System Components1. Hardware – provides basic computing resources (CPU,memory, I/O devices).2. Operating system – controls and coordinates the use ofthe hardware among the various application programs forthe various users.3. Applications programs – define the ways in which thesystem resources are used to solve the computingproblems of the users (compilers, database systems,video games, business programs).4. Users (people, machines, other computers).Operating Systems1.63

Abstract View of System ComponentsOperating Systems1.7Operating System Definitions? Resource allocator – manages and allocates resources.? Control program – controls the execution of userprograms and operations of I/O devices .? Kernel – the one program running at all times (all elsebeing application programs).Operating Systems1.84

Mainframe Systems? Reduce setup time by batching similar jobs? Automatic job sequencing – automatically transferscontrol from one job to another. First rudimentaryoperating system.? Resident monitor? initial control in monitor? control transfers to job? when job completes control transfers pack to monitorOperating Systems1.9Memory Layout for a Simple Batch SystemOperating Systems1.105

Multiprogrammed Batch SystemsSeveral jobs are kept in main memory at the same time, and theCPU is multiplexed among them.Operating Systems1.11OS Features Needed for Multiprogramming? I/O routine supplied by the system.? Memory management – the system must allocate thememory to several jobs.? CPU scheduling – the system must choose amongseveral jobs ready to run.? Allocation of devices.Operating Systems1.126

Time-Sharing Systems–Interactive Computing? The CPU is multiplexed among several jobs that are keptin memory and on disk (the CPU is allocated to a job onlyif the job is in memory).? A job swapped in and out of memory to the disk.? On-line communication between the user and the systemis provided; when the operating system finishes theexecution of one command, it seeks the next “controlstatement”from the user’s keyboard.? On-line system must be available for users to access dataand code.Operating Systems1.13Desktop Systems? Personal computers – computer system dedicated to asingle user.? I/O devices – keyboards, mice, display screens, smallprinters.? User convenience and responsiveness.? Can adopt technology developed for larger operatingsystem’often individuals have sole use of computer anddo not need advanced CPU utilization of protectionfeatures.? May run several different types of operating systems(Windows, MacOS, UNIX, Linux)Operating Systems1.147

Parallel Systems? Multiprocessor systems with more than on CPU in closecommunication.? Tightly coupled system – processors share memory and aclock; communication usually takes place through theshared memory.? Advantages of parallel system:? Increased throughput? Economical? Increased reliability? graceful degradation? fail-soft systemsOperating Systems1.15Parallel Systems (Cont.)? Symmetric multiprocessing (SMP)? Each processor runs and identical copy of the operatingsystem.? Many processes can run at once without performancedeterioration.? Most modern operating systems support SMP? Asymmetric multiprocessing? Each processor is assigned a specific task; masterprocessor schedules and allocated work to slaveprocessors.? More common in extremely large systemsOperating Systems1.168

Symmetric Multiprocessing ArchitectureOperating Systems1.17Distributed Systems? Distribute the computation among several physicalprocessors.? Loosely coupled system – each processor has its ownlocal memory; processors communicate with one anotherthrough various communications lines, such as highspeed buses or telephone lines.? Advantages of distributed systems.? Resources Sharing? Computation speed up – load sharing? Reliability? CommunicationsOperating Systems1.189

Distributed Systems (cont)? Requires networking infrastructure.? Local area networks (LAN) or Wide area networks (WAN)? May be either client-server or peer-to-peer systems.Operating Systems1.19General Structure of Client-ServerOperating Systems1.2010

Clustered Systems? Clustering allows two or more systems to share storage.? Provides high reliability.? Asymmetric clustering: one server runs the applicationwhile other servers standby.? Symmetric clustering: all N hosts are running theapplication.Operating Systems1.21Real-Time Systems? Often used as a control device in a dedicated applicationsuch as controlling scientific experiments, medicalimaging systems, industrial control systems, and somedisplay systems.? Well-defined fixed-time constraints.? Real-Time systems may be either hard or soft real-time.Operating Systems1.2211

Real-Time Systems (Cont.)? Hard real-time:? Secondary storage limited or absent, data stored in shortterm memory, or read-only memory (ROM)? Conflicts with time-sharing systems, not supported bygeneral-purpose operating systems.? Soft real-time? Limited utility in industrial control of robotics? Useful in applications (multimedia, virtual reality) requiringadvanced operating-system features.Operating Systems1.23Handheld Systems? Personal Digital Assistants (PDAs)? Cellular telephones? Issues:? Limited memory? Slow processors? Small display screens.Operating Systems1.2412

Migration of Operating-System Concepts and FeaturesOperating Systems1.25Chapter 2: Computer-System Structures? Computer System Operation? I/O Structure? Storage Structure? Storage Hierarchy? Hardware Protection? General System ArchitectureOperating Systems1.2613

Computer-System ArchitectureOperating Systems1.27Computer-System Operation? I/O devices and the CPU can execute concurrently.? Each device controller is in charge of a particular device?Operating Systemstype.Each device controller has a local buffer.CPU moves data from/to main memory to/from localbuffersI/O is from the device to local buffer of controller.Device controller informs CPU that it has finished itsoperation by causing an interrupt.1.2814

Common Functions of Interrupts? Interrupt transfers control to the interrupt service routine?Operating Systemsgenerally, through the interrupt vector, which contains theaddresses of all the service routines.Interrupt architecture must save the address of theinterrupted instruction.Incoming interrupts are disabled while another interrupt isbeing processed to prevent a lost interrupt.A trap is a software-generated interrupt caused either byan error or a user request.An operating system is interrupt driven.1.29Interrupt Handling? The operating system preserves the state of the CPU bystoring registers and the program counter.? Determines which type of interrupt has occurred:? polling? vectored interrupt system? Separate segments of code determine what action shouldbe taken for each type of interruptOperating Systems1.3015

Interrupt Time Line For a Single Process Doing OutputOperating Systems1.31I/O Structure? After I/O starts, control returns to user program only uponI/O completion.? Wait instruction idles the CPU until the next interrupt? Wait loop (contention for memory access).? At most one I/O request is outstanding at a time, nosimultaneous I/O processing.? After I/O starts, control returns to user program withoutwaiting for I/O completion.? System call – request to the operating system to allow userto wait for I/O completion.? Device-status table contains entry for each I/O deviceindicating its type, address, and state.? Operating system indexes into I/O device table to determinedevice status and to modify table entry to include interrupt.Operating Systems1.3216

Two I/O MethodsSynchronousOperating SystemsAsynchronous1.33Device-Status TableOperating Systems1.3417

Direct Memory Access Structure? Used for high-speed I/O devices able to transmitinformation at close to memory speeds.? Device controller transfers blocks of data from bufferstorage directly to main memory without CPUintervention.? Only on interrupt is generated per block, rather than theone interrupt per byte.Operating Systems1.35Storage Structure? Main memory – only large storage media that the CPUcan access directly.? Secondary storage – extension of main memory thatprovides large nonvolatile storage capacity.? Magnetic disks – rigid metal or glass platters covered withmagnetic recording material? Disk surface is logically divided into tracks, which aresubdivided into sectors.? The disk controller determines the logical interactionbetween the device and the computer.Operating Systems1.3618

Moving-Head Disk MechanismOperating Systems1.37Storage Hierarchy? Storage systems organized in hierarchy.? Speed? Cost? Volatility? Caching – copying information into faster storage system;main memory can be viewed as a last cache forsecondary storage.Operating Systems1.3819

Storage-Device HierarchyOperating Systems1.39Caching? Use of high-speed memory to hold recently-accesseddata.? Requires a cache management policy.? Caching introduces another level in storage hierarchy.This requires data that is simultaneously stored in morethan one level to be consistent.Operating Systems1.4020

Migration of A From Disk to RegisterOperating Systems1.41Hardware Protection? Dual-Mode Operation? I/O Protection? Memory Protection? CPU ProtectionOperating Systems1.4221

Dual-Mode Operation? Sharing system resources requires operating system toensure that an incorrect program cannot cause otherprograms to execute incorrectly.? Provide hardware support to differentiate between at leasttwo modes of operations.1. User mode – execution done on behalf of a user.2. Monitor mode (also kernel mode or system mode) –execution done on behalf of operating system.Operating Systems1.43Dual-Mode Operation (Cont.)? Mode bit added to computer hardware to indicate thecurrent mode: monitor (0) or user (1).? When an interrupt or fault occurs hardware switches tomonitor mode.Interrupt/faultmonitoruserset user modePrivileged instructions can be issued only in monitor mode.Operating Systems1.4422

I/O Protection? All I/O instructions are privileged instructions.? Must ensure that a user program could never gain controlof the computer in monitor mode (I.e., a user programthat, as part of its execution, stores a new address in theinterrupt vector).Operating Systems1.45Use of A System Call to Perform I/OOperating Systems1.4623

Memory Protection? Must provide memory protection at least for the interruptvector and the interrupt service routines.? In order to have memory protection, add two registersthat determine the range of legal addresses a programmay access:? Base register – holds the smallest legal physical memoryaddress.? Limit register – contains the size of the range? Memory outside the defined range is protected.Operating Systems1.47Use of A Base and Limit RegisterOperating Systems1.4824

Hardware Address ProtectionOperating Systems1.49Hardware Protection? When executing in monitor mode, the operating systemhas unrestricted access to both monitor and user’smemory.? The load instructions for the base and limit registers areprivileged instructions.Operating Systems1.5025

CPU Protection? Timer – interrupts computer after specified period toensure operating system maintains control.? Timer is decremented every clock tick.? When timer reaches the value 0, an interrupt occurs.? Timer commonly used to implement time sharing.? Time also used to compute the current time.? Load-timer is a privileged instruction.Operating Systems1.51Network Structure? Local Area Networks (LAN)? Wide Area Networks (WAN)Operating Systems1.5226

Local Area Network StructureOperating Systems1.53Wide Area Network StructureOperating Systems1.5427

Chapter 3: Operating-System Structures? System Components? Operating System Services? System Calls? System Programs? System Structure? Virtual Machines? System Design and Implementation? System GenerationOperating Systems1.55Common System Components? Process Management? Main Memory Management? File Management? I/O System Management? Secondary Management? Networking? Protection System? Command-Interpreter SystemOperating Systems1.5628

Process Management? A process is a program in execution. A process needscertain resources, including CPU time, memory, files, andI/O devices, to accomplish its task.? The operating system is responsible for the followingactivities in connection with process management.? Process creation and deletion.? process suspension and resumption.? Provision of mechanisms for:? process synchronization? process communicationOperating Systems1.57Main-Memory Management? Memory is a large array of words or bytes, each with itsown address. It is a repository of quickly accessible datashared by the CPU and I/O devices.? Main memory is a volatile storage device. It loses itscontents in the case of system failure.? The operating system is responsible for the followingactivities in connections with memory management:? Keep track of which parts of memory are currently beingused and by whom.? Decide which processes to load when memory spacebecomes available.? Allocate and deallocate memory space as needed.Operating Systems1.5829

File Management? A file is a collection of related information defined by itscreator. Commonly, files represent programs (bothsource and object forms) and data.? The operating system is responsible for the followingactivities in connections with file management:? File creation and deletion.? Directory creation and deletion.? Support of primitives for manipulating files and directories.? Mapping files onto secondary storage.? File backup on stable (nonvolatile) storage media.Operating Systems1.59I/O System Management? The I/O system consists of:? A buffer-caching system? A general device-driver interface? Drivers for specific hardware devicesOperating Systems1.6030

Secondary-Storage Management? Since main memory (primary storage) is volatile and toosmall to accommodate all data and programspermanently, the computer system must providesecondary storage to back up main memory.? Most modern computer systems use disks as theprinciple on-line storage medium, for both programs anddata.? The operating system is responsible for the followingactivities in connection with disk management:? Free space management? Storage allocation? Disk schedulingOperating Systems1.61Networking (Distributed Systems)? A distributed system is a collection processors that do not?share memory or a clock. Each processor has its ownlocal memory.The processors in the system are connected through acommunication network.Communication takes place using a protocol.A distributed system provides user access to varioussystem resources.Access to a shared resource allows:? Computation speed-up? Increased data availability? Enhanced reliabilityOperating Systems1.6231

Protection System? Protection refers to a mechanism for controlling accessby programs, processes, or users to both system anduser resources.? The protection mechanism must:? distinguish between authorized and unauthorized usage.? specify the controls to be imposed.? provide a means of enforcement.Operating Systems1.63Command-Interpreter System? Many commands are given to the operating system bycontrol statements which deal with:? process creation and management? I/O handling? secondary-storage management? main-memory management? file-system access? protection? networkingOperating Systems1.6432

Command-Interpreter System (Cont.)? The program that reads and interprets control statementsis called variously:? command-line interpreter? shell (in UNIX)Its function is to get and execute the next commandstatement.Operating Systems1.65Operating System Services? Program execution – system capability to load a program intomemory and to run it.? I/O operations – since user programs cannot execute I/Ooperations directly, the operating system must provide somemeans to perform I/O.? File-system manipulation – program capability to read, write,create, and delete files.? Communications – exchange of information between processesexecuting either on the same computer or on different systemstied together by a network. Implemented via shared memory ormessage passing.? Error detection – ensure correct computing by detecting errorsin the CPU and memory hardware, in I/O devices, or in userprograms.Operating Systems1.6633

Additional Operating System FunctionsAdditional functions exist not for helping the user, but ratherfor ensuring efficient system operations. Resource allocation – allocating resources to multiple users Operating Systemsor multiple jobs running at the same time.Accounting – keep track of and record which users use howmuch and what kinds of computer resources for accountbilling or for accumulating usage statistics.Protection – ensuring that all access to system resources iscontrolled.1.67System Calls? System calls provide the interface between a runningprogram and the operating system.? Generally available as assembly-language instructions.? Languages defined to replace assembly language forsystems programming allow system calls to be madedirectly (e.g., C, C )? Three general methods are used to pass parametersbetween a running program and the operating system.? Pass parameters in registers.? Store the parameters in a table in memory, and the tableaddress is passed as a parameter in a register.? Push (store) the parameters onto the stack by the program,and pop off the stack by operating system.Operating Systems1.6834

Passing of Parameters As A TableOperating Systems1.69Types of System Calls? Process control? File management? Device management? Information maintenance? CommunicationsOperating Systems1.7035

MS-DOS ExecutionAt System Start-upOperating SystemsRunning a Program1.71UNIX Running Multiple ProgramsOperating Systems1.7236

Communication Models? Communication may take place using either messagepassing or shared memory.Msg PassingShared MemoryOperating Systems1.73System Programs? System programs provide a convenient environment forprogram development and execution. The can be dividedinto:? File manipulation? Status information? File modification? Programming language support? Program loading and execution? Communications? Application programs? Most users’view of the operation system is defined bysystem programs, not the actual system calls.Operating Systems1.7437

MS-DOS System Structure? MS-DOS – written to provide the most functionality in theleast space? not divided into modules? Although MS-DOS has some structure, its interfaces andlevels of functionality are not well separatedOperating Systems1.75MS-DOS Layer StructureOperating Systems1.7638

UNIX System Structure? UNIX – limited by hardware functionality, the originalUNIX operating system had limited structuring. The UNIXOS consists of two separable parts.? Systems programs? The kernel? Consists of everything below the system-call interfaceand above the physical hardware? Provides the file system, CPU scheduling, memorymanagement, and other operating-system functions; alarge number of functions for one level.Operating Systems1.77UNIX System StructureOperating Systems1.7839

Layered Approach? The operating system is divided into a number of layers(levels), each built on top of lower layers. The bottomlayer (layer 0), is the hardware; the highest (layer N) isthe user interface.? With modularity, layers are selected such that each usesfunctions (operations) and services of only lower-levellayers.Operating Systems1.79An Operating System LayerOperating Systems1.8040

OS/2 Layer StructureOperating Systems1.81Microkernel System Structure? Moves as much from the kernel into “user” space.? Communication takes place between user modules usingmessage passing.? Benefits:- easier to extend a microkernel- easier to port the operating system to new architectures- more reliable (less code is running in kernel mode)- more secureOperating Systems1.8241

Windows NT Client-Server StructureOperating Systems1.83Virtual Machines? A virtual machine takes the layered approach to its logicalconclusion. It treats hardware and the operating systemkernel as though they were all hardware.? A virtual machine provides an interface identical to theunderlying bare hardware.? The operating system creates the illusion of multipleprocesses, each executing on its own processor with itsown (virtual) memory.Operating Systems1.8442

Virtual Machines (Cont.)? The resources of the physical computer are shared tocreate the virtual machines.? CPU scheduling can create the appearance that users havetheir own processor.? Spooling and a file system can provide virtual card readersand virtual line printers.? A normal user time-sharing terminal serves as the virtualmachine operator’s console.Operating Systems1.85System ModelsNon-virtual MachineOperating SystemsVirtual Machine1.8643

Advantages/Disadvantages of Virtual Machines? The virtual-machine concept provides completeprotection of system resources since each virtualmachine is isolated from all other virtual machines. Thisisolation, however, permits no direct sharing of resources.? A virtual-machine system is a perfect vehicle foroperating-systems research and development. Systemdevelopment is done on the virtual machine, instead of ona physical machine and so does not disrupt normalsystem operation.? The virtual machine concept is difficult to implement dueto the effort required to provide an exact duplicate to theunderlying machine.Operating Systems1.87Java Virtual Machine? Compiled Java programs are platform-neutral bytecodesexecuted by a Java Virtual Machine (JVM).? JVM consists of- class loader- class verifier- runtime interpreter? Just-In-Time (JIT) compilers increase performanceOperating Systems1.8844

Java Virtual MachineOperating Systems1.89System Implementation? Traditionally written in assembly language, operatingsystems can now be written in higher-level languages.? Code written in a high-level language:? can be written faster.? is more compact.? is easier to understand and debug.? An operating system is far easier to port (move to someother hardware) if it is written in a high-level language.Operating Systems1.9045

Operating Systems 1.5 What is an Operating System? A 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. Operating Systems 1.6

Related Documents:

Latest API exams,latest API-571 dumps,API-571 pdf,API-571 vce,API-571 dumps,API-571 exam questions,API-571 new questions,API-571 actual tests,API-571 practice tests,API-571 real exam questions Created Date

Aug 05, 2021 · 1 49 CFR 575.104. 2 49 CFR 571.105, 571.121, 571.122, 571.126, 571.135, 571.136, 571.139, 571.500. 3 60 FR 6411, 6415–17 (Feb. 2, 1995). 4 Another reason for adopting the peak braking force related to the variability associated with determining skid number. Th

(19) 49 CFR §571.210 Seat belt assembly anchorages, as amended. (20) 49 CFR §571.121 Air brake systems, as amended. (21) 49 CFR §571.217 Bus emergency exits and window retention and release, as amended. (22) 49 CFR §571.220 School bus rollover protection, as amended. (23) 49 CFR §571

Falls Church, Virginia 22042 Phone 571-423-1010 Fax 571-423-1007 Falls Church City Public Schools Dr. Peter Noonan 800 W. Broad Street, Suite 203 Falls Church, Virginia 22046 Phone 703-248-5601 Fax 703-248-5613 Loudoun County Public Schools Dr. Eric Williams 21000 Education Court Ashburn, Virginia 20148 Phone 571-252-1020 Fax 571-252-1003

§571.121 49 CFR Ch. V (10–1–04 Edition) tires as suitable for use with those tires, in accordance with S5.1 of §571.119, except that vehicles may be equipped with a non-pneu-matic spare tire assembly that meets the re-quirements of §571.129, New non-pneumatic tires for

Code of Federal Regulations: 49 CFR §571.121 S5.1.8 applies to trucks, buses and truck tractors. 49 CFR §571.121 S5.2.2 while identical, applies to trailers. 49 CFR §571.121 (FMVSS 121) is applicable to manufacturers. 49 CFR 571.121 S5.1.8 Brake distribution and automatic adjustment. Each vehicle shall beFile Size: 541KB

Final Exam Answers just a click away ECO 372 Final Exam ECO 561 Final Exam FIN 571 Final Exam FIN 571 Connect Problems FIN 575 Final Exam LAW 421 Final Exam ACC 291 Final Exam . LDR 531 Final Exam MKT 571 Final Exam QNT 561 Final Exam OPS 571

Catalog number Description Function A23167-000 Corbin 60 'O' bitted all except 381 IS, 571 A23167-0KD Corbin 60 'KD' keyed different all except 381 IS, 571 A23168-000 Russwin D1'O' bitted all except 381 IS, 571 A23168-0KD Russwin D1 'KD' keyed different all except 381 IS, 571