Operating System Concepts Lecture Notes PDF
Document Details
Uploaded by Deleted User
Dr. Nouran Radwan
Tags
Summary
These lecture notes provide an introduction to operating systems, including a overview of computer system organization, details on storage structures (like main memory and other storage types) and a simplified explanation of interrupts. The materials cover fundamental concepts for a computer science course.
Full Transcript
1 Operating System Dr. Nouran Radwan 2 Introduction. Operating-system Course Structures. Processes. Syllabus Threads. CPU Scheduling. Process Synchronization....
1 Operating System Dr. Nouran Radwan 2 Introduction. Operating-system Course Structures. Processes. Syllabus Threads. CPU Scheduling. Process Synchronization. Deadlocks. Main Memory Management. 3 Lecture 1: Introduction Operating System Dr. Nouran Radwan Course Objectives To describe the basic organization of computer systems. To describe the services an operating system provides to users, processes, and other systems. To discuss the various ways of structuring an operating system. To introduce the notion of a process and a thread. To introduce CPU scheduling, whichis the basis for multiprogrammed operating systems. To develop a description of deadlocks. To provide a detailed description of various ways of organizing memory hardware. Operating Systems 4 Lecture 1: Introduction Computer System Structure. What is an Operating System? What Operating Systems Do? Computer System Organization. Storage Structure. Operating Systems 5 Computer System Structure (1/2) Computer system can be divided into four components: Hardware – provides basic computing resources CPU, memory, I/O devices Operating system Controls and coordinates use of hardware among various applications and users Application programs define the ways in which the system resources are used to solve the computing problems of the users. Ex. Word processors, compilers, web browsers, database systems, video games. Users People, machines, other computers Operating Systems 6 Computer System Structure (2/2) Operating Systems 7 What is an Operating System? (1/2) An operating system is a program that manages a computer’ hardware It also provides a s. basis for and acts application programs as the an intermediary between the computer user and computer hardware. Operating Systems 8 What is an Operating System? (2/2) 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 9 What Operating Systems Do? (1/4) User View Users wantconvenience, ease of use Good performance. and Don’t care about resource utilization. mainframe But shared computer such or as minicomputer must keep all users happy. Operating Systems 1 0 What Operating Systems Do? (2/4) System View From the computer’s point of view, the operating system is the program most intimately involved with the hardware. In this context, we can view an operating system as a resource allocator. A computer system has many resources that may be required to solve a problem: CPU time, memory space, file-storage space, I/O devices, and so on. The operating system acts as the manager of these resources. Operating Systems 1 1 What Operating Systems Do? (3/4) OS is a resource allocator Manages all resources. Decides between conflicting requests for efficient and fair resource use. OS is a control program Controls executionof programsto prevent errors and improper use of the computer. Operating Systems 1 2 What Operating Systems Do? (4/4) A more common definition, and the one that we usually follow, is that the operating system is the one program running at all times on the computer—usually called the kernel. (Along with the kernel, there are two other types of programs: system programs, which are associated with the operating system but are not necessarily part of the kernel, and application programs, which include all programs not associated with the operation of the system.) Operating Systems 1 3 Computer System Organization (1/3) A modern general-purpose computer system consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory. Operating Systems 1 4 Computer System Organization (2/3) Computer Startup (1/2) bootstrap program is loaded at power-up or reboot Typically stored in ROM or electrically erasable programmable read-only memory (EPROM), generally known as firmware. Initializes all aspects of system. Loads operating system kernel and starts execution. Operating Systems 1 5 Computer System Organization (2/3) Computer Startup (2/2) Operating Systems 1 6 Computer System Organization (2/3) Computer Startup (2/2) Operating Systems 1 7 Computer System Organization (3/3) Interrupts (1/2) The occurrence of an event is usually signaled by an interrupt from either the hardware or the software. Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus. Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call). Interrupts are an important part of a computer architecture. Each computer design has its own interrupt mechanism, but several functions are Operating Systems 1 common. 8 Computer System Organization (3/3) Interrupts (2/2) 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. Operating Systems 1 9 Storage Structure (1/4) The basic unit of computer storage is the bit. A bit can contain one of two Revie values, 0 and 1. All other storage in a computer is based on collections of bits. w Given enough bits, it is amazing how many things a computer can represent: numbers, letters, images, movies, sounds, documents, and programs, to name a few. 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, 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 manufacturers often round off these numbers and say that a megabyte is 1 million bytes and a gigabyte is 1 billion bytes. Networking measurements are an exception to this general rule; they are given in bits (because networks move data a bit at a time). Operating Systems 2 0 Storage Structure (2/4) Main memory – only large storage media that the CPU can access directly. Random access Typically volatile Secondary storage – extension of main memory that provides large nonvolatile storage capacity. Operating Systems 2 1 Storage Structure (3/4) 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. Operating Systems 2 2 Storage Structure (4/4) Storage systems organized in hierarchy Speed Cost Volatility Operating Systems 2 3 24 References Silberschatz, A., Galvin, P. B., & Gagne, G. (2018). Operating System Concepts, 10e Abridged Print Companion. John Wiley & Sons. Operating Systems 2 5 Think What are the three main purposes of an operating system? What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user program? If so, for what purpose? Rank the following storage systems from slowest to fastest: a. Hard-disk drives 3 b. Registers 7 c. Optical disk 2 d. Main memory 5 e. Nonvolatile memory 4 f. Magnetic tapes 1 g. Cache6 Operating Systems 2 6 2 “ 7 Thank you ”