IFT 103 OS Architecture PDF

Document Details

OticCanyon5455

Uploaded by OticCanyon5455

Arizona State University

Tags

operating systems computer architecture storage management computer science

Summary

This document provides an overview of operating system concepts. It covers learning objectives, components of an operating system, computer system operations, I/O, and storage functionalities. The document is suitable for an undergraduate-level computer science course at Arizona State University.

Full Transcript

IFT 103: OS Architecture Module Overview: Operating System Concepts |Module Learning Objectives |1. What is an Operating System? Module Overview |Module Learning Objectives |2. Components of an Operating System Module Ove...

IFT 103: OS Architecture Module Overview: Operating System Concepts |Module Learning Objectives |1. What is an Operating System? Module Overview |Module Learning Objectives |2. Components of an Operating System Module Overview |Module Learning Objectives |3. Computer System Operation Module Overview |Module Learning Objectives |4. Operating System Functions and Structure Module Overview |Module Learning Objectives |5. Operating System Storage Module Overview |Module Learning Objectives |6. Operating System Cache/Memory Module Overview |Module Learning Objectives |7. Operating System Management Module Overview |Module Learning Objectives |8. Open Source Operating Systems Module Overview |Operating System |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 System Operating system tasks: Controls and coordinates use of hardware among various applications and users Operating system is a resource allocator that manages conflicting requests of resources Operating system is a control program that controls execution of programs |Operating System |When does an Operating System start running? Bootstrap program is loaded at power-up or reboot Typically stored in BIOS/UEFI on ROM (Read-Only Memory) or EPROM (erasable programmable read-only memory), generally known as firmware Operating System The BIOS is a set of computer instructions in firmware which control input/output operations Loads operating system kernel and starts execution of computer system operation “The one program running at all times on the computer” is the kernel. |Computer System |Components of a Computer System Computer System Computer Hardware Operating System System/Application Programs Users |Computer System |Operation of a Computer System One or more CPUs, device controllers connect through common bus providing access to shared memory Concurrent execution of CPUs and devices competing for memory cycles Computer System |Computer System |Operation of a Computer System I/O (input/output) 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 Computer System CPU moves data from/to main memory to/from local buffers I/O (input/output) is from the device to local buffer of controller Device controller informs CPU that it has finished its operation by causing an interrupt |I/O Structure and Operation After I/O starts, control returns to user program only upon I/O completion Wait instruction idles the CPU until the next interrupt I/O Structure and Operation Wait loop (contention for memory access) At most one I/O request is outstanding at a time, no simultaneous I/O processing After I/O starts, control returns to user program without waiting for I/O completion System call – request to the Operating System to allow user to wait for I/O completion Device-status table contains entry for each I/O device indicating its type, address, and state Operating System indexes into I/O device table to determine device status and to modify table entry to include interrupt |Computer Storage The basic unit of computer storage is the bit. A bit can contain one of two values, 0 and 1. All other storage in a computer is based on collections of bits. Given enough bits, it is amazing how many things a computer can represent: numbers, letters, images, movies, sounds, documents, processes, and programs, etc. Computer Storage A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage. For example, most computers don’t have an instruction to move a bit but do have one to move a byte. A less common term is word, which is a given computer architecture’s native unit of data. A word is made up of one or more bytes. For example, a computer that has 64-bit registers and 64-bit memory addressing typically has 64-bit (8-byte) words. A computer executes many operations in its native word size rather than a byte at a time. |Computer Storage Computer storage, along with most computer throughput, is generally measured and manipulated in bytes and collections of bytes. A kilobyte, or KB, is 1,024 bytes A megabyte, or MB, is 1,0242 bytes A gigabyte, or GB, is 1,0243 bytes A terabyte, or TB, is 1,0244 bytes A petabyte, or PB, is 1,0245 bytes Computer Storage |Computer Storage Structure Main memory – only large storage media that the CPU can access directly Random access Computer Storage Structure Typically volatile Secondary storage – extension of main memory that provides large nonvolatile storage capacity Hard disks – 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 Solid-state disks – faster than hard disks, nonvolatile Various technologies Becoming more popular |Storage Device Hierarchy Storage Device Hierarchy |Storage Performance Levels |Performance of various levels of storage Storage Performance Levels |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 there If it is, information used directly from the cache (fast) If not, data copied to cache and used there Cache smaller than storage being cached Caching Cache management important design problem Cache size and replacement policy |DMA Structure |(DMA) Direct Memory Access 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 DMA Structure memory without CPU intervention Only one interrupt is generated per block, rather than the one interrupt per byte |Operating System Structure Multiprogramming (Batch system) needed for efficiency Single user cannot keep CPU and I/O devices busy at all times Multiprogramming organizes jobs (code and data) so CPU always has one to execute A subset of total jobs in system is kept in memory Operating System Structure One job selected and run via job scheduling When it has to wait (for I/O for example), Operating System switches to another job Timesharing (multitasking) is 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 Process: Each user has at least one program executing in memory CPU Scheduling: If several jobs ready to run at the same time 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 Operations Interrupt driven (hardware and software) Hardware interrupt by one of the devices Software interrupt (exception or trap): Operating System Operations Software error (e.g., division by zero) Request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system Dual-mode operation allows Operating System to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user |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 CPU, memory, I/O, files Initialization data Process termination requires reclaim of any reusable resources Process Management Single-threaded process has one program counter 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 Typically a system has many processes, some user, some Operating System running concurrently on one or more CPUs Concurrency by multiplexing the CPUs among the processes / threads |Storage Management Operating System 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) Varying properties include access speed, capacity, data-transfer rate, access method (sequential or Storage Management random) File-System management Files usually organized into directories Access control on most systems to determine who can access what Operating System activities include Creating and deleting files and directories Primitives to manipulate files and directories Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media |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. Operating System performs memory management and Memory Management determines what should be in memory and when Optimizing CPU utilization and computer response to users Memory management activities Keeping track of which parts of memory are currently being used and by whom Deciding which processes (or parts thereof) and data to move into and out of memory Allocating and deallocating memory space as needed |Kernel Data Structures |What is the Kernel in the OS? A kernel is a central component of an (OS) operating system that manages the operations of computers and hardware. It is Kernel Data Structures the core part of an (OS) operating system. It is the bridge between software applications and the hardware of a computer. |Kernel Data Structures |What is the Kernel in the OS? Kernel Data Structures |Kernel Data Structures |Singly Linked List It is the commonly used linked list in programs. If we are talking about the linked list, it means it is a singly linked list. The singly linked list is a data structure that contains two Kernel Data Structures parts, i.e., one is the data part, and the other one is the address part, which contains the address of the next or the successor node. The address part in a node is also known as a pointer. |Kernel Data Structures |Doubly Linked List As the name suggests, the doubly linked list contains two pointers. We can define the doubly linked list as a linear data structure with three parts: the data part and the other Kernel Data Structures two address part. In other words, a doubly linked list is a list that has three parts in a single node, includes one data part, a pointer to its previous node, and a pointer to the next node. |Kernel Data Structures |Circular Linked List A circular linked list is a variation of a singly linked list. The only difference between the singly linked list and a circular linked list is that the last node does not point to any node in Kernel Data Structures a singly linked list, so its link part contains a NULL value. On the other hand, the circular linked list is a list in which the last node connects to the first node, so the link part of the last node holds the first node's address. The circular linked list has no starting and ending node. |Open Source |Open Source OS (Operating Systems) Operating Systems made available in source-code format rather than just binary closed-source Counter to the copy protection and Digital Rights Management (DRM) movement Open Source OS Started by Free Software Foundation (FSF), which has “copyleft” GNU Public License (GPL) Examples include GNU/Linux and BSD UNIX (including core of Mac OS X), and many more Can use VM like Hyper-V, Vmware, Virtualbox (open source and free on many platforms - http://www.virtualbox.com), etc Can be used to run guest operating systems |To Dos for this module |Quiz: Operating System Basics |Essay: Operating System Basics To Dos for this module |Assignment: Data and OS Architecture Binary Math |Discussion: Learning Reflection

Use Quizgecko on...
Browser
Browser