Unformatted text preview:

ICS 143 - Principles of Operating SystemsComputer System StructuresComputer System ArchitectureComputer System OrganizationInterruptsInterrupt HandlingI/O StructureDirect Memory Access (DMA)Storage StructureStorage HierarchyStorage Device HierarchyHardware ProtectionDual-mode operationDual-mode operation(cont.)I/O ProtectionMemory ProtectionHardware Address ProtectionProtection Hardware (cont.)CPU ProtectionGeneral System ArchitectureOperating System StructuresProcess Management (Chapters 4-7)Memory Management (Chapters 8-9)Secondary Storage and I/O Management (Chapter 10)File System Management (Chapters 11-12)Protection and Security (Chapter 14)Networking (Distributed Systems)Command Interpreter SystemOperating System ServicesSystem CallsSystem ProgramsSystem Design and ImplementationSystem GenerationOS Structure - Simple ApproachUNIX System StructureLayered OS StructureVirtual MachinesSummary of OS StructuresICS 143 - Principles of Operating SystemsLecture 2 - Operating System StructuresProf. Nalini [email protected] System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System ArchitectureComputer System ArchitectureComputer System Organization I/O devices and the CPU execute concurrently. Each device controller is in charge of a particular device type Each device controller has a local buffer. I/O is from the device to local buffer of controller CPU moves data from/to main memory to/from the local buffers Device controller interrupts CPU on completion of I/OInterrupts Interrupt transfers control to the interrupt service routine Interrupt Service Routine: Segments of code that determine action to be taken for each type of interrupt. Interrupt vector contains the address of service routines. OS preserves the state of the CPU stores registers and the program counter (address of interrupted instruction). Trap software generated interrupt caused either by an error or a user request.Interrupt Handling Types of interrupt Polling Vectored interrupt system Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt.I/O Structure Synchronous I/O wait instruction idles CPU until next interrupt no simultaneous I/O processing, at most one outstanding I/O request at a time. Asynchronous I/O After I/O is initiated, control returns to user program without waiting for I/O completion. System call Device Status table - holds type, address and state for each device OS indexes into I/O device table to determine device status and modify table entry to include interrupt.Direct Memory Access (DMA) Used for high speed I/O devices able to transmit information at close to memory speeds. Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention. Only one interrupt is generated per block, rather than one per byte (or word).MemoryMemoryCPUCPUI/O devicesI/O devicesI/O instructionsStorage Structure Main memory - only large storage media that the CPU can access directly. Secondary storage - extension of main memory that has large nonvolatile storage capacity. Magnetic disks - rigid metal or glass platters covered with magnetic recording material. Disk surface is logically divided into tracks, subdivided into sectors. Disk controller determines logical interaction between device and computer.Storage Hierarchy Storage systems are organized in a hierarchy based on Speed Cost Volatility Caching - process of copying information into faster storage system; main memory can be viewed as fast cache for secondary storage.Storage Device HierarchyHardware Protection Dual Mode Operation I/O Protection Memory Protection CPU ProtectionDual-mode operation Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly. Provide hardware support to differentiate between at least two modes of operation:1. User mode -- execution done on behalf of a user.2. Monitor mode (supervisor/kernel/system mode) --execution done on behalf of operating system.Dual-mode operation(cont.) Mode bit added to computer hardware to indicate the current mode: monitor(0) or user(1). When an interrupt or fault occurs, hardware switches to monitor mode. Privileged instructions only in monitor mode.UserMonitorSet usermodeInterrupt/faultI/O Protection All I/O instructions are privileged instructions. Must ensure that a user program could never gain control of the computer in monitor mode, for e.g. a user program that as part of its execution, stores a new address in the interrupt vector.Memory Protection Must provide memory protection at least for the interrupt vector and the interrupt service routines. To provide memory protection, add two registers that determine the range of legal addresses a program may address. Base Register - holds smallest legal physical memory address. Limit register - contains the size of the range. Memory outside the defined range is protected.0300040120900Base registermonitorJob1Job 2Job 4Job 302560003000040420940Limit register8800001024000Hardware Address ProtectionProtection Hardware (cont.) When executing in monitor mode, the OS has unrestricted access to both monitor and users’ memory. The load instructions for the base and limit registers are privileged instructions.CPU Protection Timer - interrupts computer after specified period to ensure that OS maintains control. Timer is decremented every clock tick. When timer reaches a value of 0, an interrupt occurs. Timer is commonly used to implement time sharing. Timer is also used to compute the current time. Load timer is a privileged instruction.General System Architecture Given the I/O instructions are privileged, how do users perform I/O? Via system calls - the method used by a process to request action by the operating system.Operating System Structures Operating System Components Process Management, Memory Management, Secondary Storage Management, I/O System Management, File Management, Protection System, Networking, Command-Interpreter. Operating System Services, System calls, System Programs Virtual Machine Structure and Organization A Structural Approach to Operating Systems


View Full Document

UCI ICS 143 - LECTURE NOTES

Download LECTURE NOTES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view LECTURE NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view LECTURE NOTES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?