
Chapter-1 Introduction to Operating System, System Structures Agenda (classes 1-4) v What Operating Systems Do v Computer-System Organization v Computer-System Architecture v Operating-System Structure v Operating-System Operations v Process Management v Memory Management v Storage Management v Protection and Security v Distributed Systems v Special-Purpose Systems v Computing E nvironments PHE NOM9 What Operating Systems Do v Operating system is a software that controls and manages the computer hardware. v Operating system acts as an interface between user and hardware of a computer system. v Operating system provides an environment for execution of a program in convenient and efficient way. PHE NOM9 What Operating Systems Do v A program that acts as an intermediary between a user of a computer and the computer hardware. PHE NOM9 What Operating Systems Do: Goals v User Computations Execute user programs and make solving user problems easier v Utilization Efficiency To ensure good resource utilization efficiency and provide appropriate corrective actions when it becomes low v User Convenience Make the computer system convenient to use PHE NOM9 Four Components of a Computer System PHE NOM9 Four Components of a Computer System v Hardware provides basic computing resources CPU, memory, I/O devices v Operating system Controls and coordinates use of hardware among various applications and users PHE NOM9 Four Components of a Computer System v 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 v Users People, machines, other computers PHE NOM9 Operating System: Different Views v User view Personal Computer: Ease of use, performance Mainframe: Resource utilization v System view Resource allocator Control program PHE NOM9 System View v OS is a resource allocator Manages all resources Decides between conflicting requests for efficient and fair resource use v OS is a control program Controls execution of programs to prevent errors and improper use of the computer PHE NOM9 Defining Operating System v “The one program running at all times on the computer” is the kernel. v Everything else is either a system program (ships with the operating system) or an application program PHE NOM9 Computer System Organization Computer-system operation Storage Structure I/O Structure PHE NOM9 Computer-System Operation PHE NOM9 Computer-System Operation v bootstrap program is loaded at power-up or reboot It is stored in ROM or EEPROM, generally known as firmware It initializes all aspects of system Loads operating system kernel, starts executing first process ‘init’ and waits for some event to occur. PHE NOM9 Computer-System Operation v One or more CPUs and device controllers are connected through common bus providing access to shared memory I/O devices and the CPU can execute concurrently. v Each device controller is in-charge of a particular device type. v Each device controller has a local buffer. v CPU moves data from/to main memory to/from local buffers PHE NOM9 Computer-System Operation v The occurrence of an event is signaled by an interrupt from either hardware or software. v Hardware may trigger an interrupt by sending a signal through system bus. v Software may trigger an interrupt through system calls. v When the CPU is interrupted, it stops what it is doing and transfers the execution to a fixed location. PHE NOM9 Computer-System Operation v The fixed location contains the interrupt vector, which contains the addresses of all the service routines. v Related interrupt service routine is executed. v On completion, CPU resumes the previous interrupted process. v Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt. v An operating system is interrupt driven. PHE NOM9 Computer-System Operation PHE NOM9 Storage Structure: H ierarchy PHE NOM9 Storage Structure: Hierarchy v Storage systems organized in hierarchy. Speed Cost Volatility v Main memory is only large storage media that the CPU can access directly (semi-conductor) v Secondary storage provides large nonvolatile storage capacity PHE NOM9 Storage Structure: Main Memory It is implemented in a semiconductor technology called Dynamic Random Access Memory (DRAM) which forms an array of words. Each word has its own address and can be interacted through Load and Store Load: moves a word from main memory to internal register Store: moves a word from internal register to main memory PHE NOM9 Storage Structure: Caching v Information in use is copied from slower to faster storage temporarily v Faster storage (cache) is checked first to determine if information is there If it is, information is used directly from the cache (fast) If not, data is copied to cache and used PHE NOM9 Storage Structure v Magnetic disks are 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 logical interaction between the device and the computer. PHE NOM9 Storage Structure: E lectronic Disk v Electronic disks can be volatile or non-volatile v It stores data in large DRAM array which is volatile. v Many electronic disk devices contain a hidden magnetic hard disk and battery for back up. v If power is interrupted, electronic disk controller copies the data from RAM to magnetic disc. v When external power is resumed, controller copies data from magnetic disk back to RAM PHE NOM9 Storage Structure: E lectronic Disk v Another form of Electronic disks is flash memory which is popular in Camera, Robots etc. v NVRAM: DRAM with battery backup PHE NOM9 I/ O Structure v A computer system may have multiple device controller, each device controller is in-charge of a specific type of device. v A device controller maintains some local buffer storage and a set of special purpose registers. v The device controller is responsible for moving data between the device and local buffer. v OS has a device driver for each device controller. PHE NOM9 I/ O Structure v To start an I/O operation, the device driver loads the appropriate registers within the device controller. v Device controller examines the contents of these registers and works accordingly. e.g. if action is read a character from keyboard, device controller transfers the character from device to local buffer of the controller v Data transfer is complete, device controller informs the device driver through interrupt. PHE NOM9 I/ O Structure: Direct Memory Access Structure v DMA is used for high-speed I/O devices which are able to transmit information faster. v Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention. v Only one interrupt is generated per block, rather than the one interrupt per byte. PHE NOM9 I/ O Structure PHE NOM9 Operating System Structure v On the basis of number of general purpose processors used, system can be of two types. Single-processor systems Multiprocessor systems PHE NOM9 Operating System Structure: Single-processor systems v Only one general purpose CPU executing general purpose instructions (user’s or system’s) v Systems may have other specific processors like processor for disk, for keyboard which can not execute user’s processes (not considered for general purpose execution) v These specific processors can execute only limited set of instructions. PHE NOM9 Operating System Structure: Single-processor systems v OS can not communicate with these processors, they do work autonomously. v e.g. A disk-controller microprocessor receives a sequence of requests from the CPU and implements its own disk queue and scheduling algorithm. v Thus CPU is relieved from disk scheduling work. PHE NOM9 Operating System Structure: Multiprocessor systems v These are also known as parallel system or tightly coupled system. v Multiprocessor systems are with more than one CPU in close communication. v These processors share computer bus. v They may share memory and a clock and peripheral devices. v Communication takes place through the shared memory. PHE NOM9 Operating System Structure: Multiprocessor systems v Advantages of parallel system: Increased throughput Economical Increased reliability PHE NOM9 Operating System Structure: Multiprocessor systems v Increased throughput This speeds up the computation, but speed up ratio with N processors is less than N due to communication overhead and contention with shared resources. v Economical These cost less than multiple single-processor systems because they can share peripherals, mass storage, power supplies etc. PHE NOM9 Operating System Structure: Multiprocessor systems v Increased reliability Failure of one processor will not halt the system, it will only slow down. Remaining processors will share the work. v Graceful degradation and fail-soft systems v Fault tolerant v It may have mechanism to allow the failure to be detected, diagnosed and corrected. v e.g. HP NonStop System PHE NOM9 Operating System Structure: Multiprocessor systems v Asymmetric multiprocessing Each processor is assigned a specific task either predefined or instructed by master. Master processor schedules and allocate work to slave processors. This master-slave relationship is more common in extremely large systems PHE NOM9 Operating System Structure: Multiprocessor systems v Symmetric multiprocessing (SMP) Each processor runs an identical copy of the operating system. All processors
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages95 Page
-
File Size-