Operating Systems Lecture 1 Crucial hardware concepts review M. Naghibzadeh Reference: M. Naghibzadeh, Operating System Concepts and Techniques, iUniverse.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Components of a computer system
Computer Architecture
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Computer Organization and Architecture
Computer Organization and Architecture
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer Organization and Assembly language
Inside The CPU. Buses There are 3 Types of Buses There are 3 Types of Buses Address bus Address bus –between CPU and Main Memory –Carries address of where.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
MICROPROCESSOR INPUT/OUTPUT
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Operating System Concepts and Techniques Lecture 2 Multiprogramming, Multithreading, Multiprocessing, and Multitasking M. Naghibzadeh Reference M. Naghibzadeh,
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
CHAPTER 4 The Central Processing Unit. Chapter Overview Microprocessors Replacing and Upgrading a CPU.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Modes of transfer in computer
Chapter 4 MARIE: An Introduction to a Simple Computer.
Operating System Concepts and Techniques Lecture 1 Background: hardware concepts review M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Architecture 2 nd year (computer and Information Sc.)
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Chapter 3 : Top Level View of Computer Functions Basic CPU function, Interconnection, Instruction Format and Interrupt.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Structure and Role of a Processor
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Computer Hardware What is a CPU.
OPERATING SYSTEM CONCEPT AND PRACTISE
68HC11 Interrupts & Resets.
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Operating System Concepts and Techniques Lecture 2
Chapter 3 Top Level View of Computer Function and Interconnection
Computer Architecture
ECEG-3202 Computer Architecture and Organization
Chapter 5: Computer Systems Organization
BIC 10503: COMPUTER ARCHITECTURE
COMPUTER PERIPHERALS AND INTERFACES
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Presentation transcript:

Operating Systems Lecture 1 Crucial hardware concepts review M. Naghibzadeh Reference: M. Naghibzadeh, Operating System Concepts and Techniques, iUniverse publisher, To order: or

2 Introduction A computer is a device which runs programs. A program is a set of instructions that is prepared to do a specific job. The operating system is an special program which sits on top of the computer hardware. It acts as an interface between the running programs and the computer hardware to: Provide basic software modules to be used by programs Facilitate efficient use of computer resources Prevent running programs interference

3 Computer Hardware Organization Within every computer there are many hardware devices. Control unit, Arithmetic-logic unit, Cache memory, And main memory are the basic devices. Other devices are usually Input/Output devices. Figure 1 shows essential logical interconnctions of the devices

4 Essential logical interconnctions of a computer’s devices Control Unit Main Memory Output Unit Input Unit Arithmetic-Logic Unit CPU Figure 1: Computer organization model

5 Physical interconnctions of a computer’s devices To reduce internal interconnection wiring, buses are used to connect devices. A bus is similar to a highway via which different parts of a city are connected. There are at least three busses, address bus, data bus and control bus, in every computer. Some computer devices are not directly connected to the computer’s internal bus. In a 32-bit computer, for example, the address bus and data bus are each 32 bits wide. There are mechanisms for possessing the address and data buses, otherwise data and addresses from different devices could become mixed up. A model of the bus-based computer organization is shown in Figure 2.

6 Essential Physical interconnctions of a computer’s devices Figure 2: A bus-based Computer organization model Central Processing Unit (CPU) Main Memory (MM) MonitorMouse Hard Disk (HD) Internet Connection... Control bus Address bus Data bus

7 The Fetch-Execute Cycle The computer reads an instruction from the main memory (RAM) and moves it to a temporary place called the Instruction Register (IR) in the Central Processing Unit (CPU). It then finds out what has to be done with respect to this instruction and performs the actions. It repeats this cycle of moving an instruction from the main memory to the CPU and executing it over and over again. This is called Fetch-Execute Cycle

8 The Details of Fetch-Execute Cycle Figure 3: A simplified functional model of a computer Read the instruction pointed out by the Program Counter (PC) register from main memory and move it to the CPU Find out what this instruction is Adjust PC for the next instruction Fetch cycle Execute the instruction, i.e., perform what is requested by the instruction. Perhaps this may readjust the PC. Execute cycle Move the data upon which the instruction has to be executed from main memory to the CPU.

9 Program Counter (PC) update It is important to understand how the PC is filled. The PC is automatically filled with an initial value when the computer is started or restarted. When a new program is to be executed, the operating system will fill the PC with the first executable instruction of the program. Otherwise, it is updated as shown in the figure 3. When an instruction is executed, the next instruction to be fetched is most likely the one immediately following this instruction. However, this is not always the case. Look at the piece of program below that is written in a pseudo code format. 1.If A > B 2. then print A 3. else print B 4.endif Most of the time, the PC update during the fetch cycle suffices.

10 Interrupt Interrupt is a signal that is sent to the CPU to capture its attention. It may be issued by different sources, like By a fault detecting hardware that is trying to informs the CPU of a circuitry malfunction By a monitoring circuit within the ALU that controls the acceptability of the data size for the operation being performed and, consequently, the operation result size By a user that may press a special key like “break” at any time By an slave processor that wants to inform the CPU of the completion of the assigned task …

11 Interrupt masking Some interrupts are maskable by user programs. Masked interrupts are ignored by the CPU. This is analogous to ignoring a door knock. Some interrupts are not user-maskable. It is not reasonable to let the computer continue in the presence of a hardware failure. However, all interrupts are maskable within the kernel of an operating system.

12 Interrupt Categorization Interrupts are categorized into few classes. Different classes of interrupts require. different handling consideration. Each category of interrupts is represented by a bit in interrupt vector within the CPU. Interrupt categories have priorities. When handling a higher priority interrupt handling any lower priority interrupt is postponed.

13 Program execution suspension A non-masked interrupt causes the suspension of the currently executing program. It is usually possible to resume the execution of the program after the interrupt is handled. Interrupt signals reach the CPU and are stored in the interrupt vector. The interrupt(s) is ignored until the currently executing machine instruction is completed. There are very few exceptions. One example might be the “move” instruction in some computers that is suppose to move a big chunk, say 256 bytes, of data from one location of main memory to another. The CPU always looks for interrupt signals just before fetching a new instruction to execute. If there are any interrupt signals, the system handles them in the order of priorities and urgencies.

14 Fetch-Execute Cycle with interrupt Figure 4: A simplified functional model of a computer with interrupt Read the instruction pointed out by the Program Counter (PC) register from main memory and move it to the CPU Find out what this instruction is Adjust PC for the next instruction Fetch cycle Execute the instruction, i.e., perform what is requested by the instruction. Perhaps this may readjust the PC. Execute cycle Move the data upon which the instruction has to be executed from main memory to the CPU. Handle all non-masked interrupts

15 Privileged instructions Privileged instructions are those which are not usable by assembly application programmers. Privileged instructions are executable only within the operating system kernel Other parts of the OS and application programmers may execute privileged instruction by special means that are provided by the operating system Disable interrupt which disables all interrupts is a sample privileged instruction.

16 CPU speed CPU speed is usually measured by its clock cycle which is around Giga hertz for PCs. A clock cycle is usually the time that takes to move one data (instruction, or address) from one internal register to another. A machine instruction execution takes around 10 clock cycles. There are other units of measuring a CPU speed, like Million instruction per second (MIPS) and Million Floating point instructions per second (MFLOPS).

17 Summary The following subjects were discussed: Computer, Program, and operating system Logical Computer organization model Physical Computer organization model Functional Computer organization model and the Fetch-Execute Cycle Interrupt, Interrupt masking, Interrupt categorization, and interrupt handling. CPU speed.

18 Find out Your computer’s instruction categories based on their length. The benefits of adjusting the PC register during the fetch cycle even though we have to readjust it during the execute cycle for some instructions? You have just bought a new personal computer. No operating system is installed, what software does it have and for what purposes? If your computer is a 32-bit one, what is the maximum memory size that the CPU can directly address (without using a base register)? Your computer’s speed in terms of MIPS. Your computer’s interrupt classes Your computer’s interruptable instructions Your computer’s privileged instructions

19 Thank you!