1 / 10

Part 2

Part 2. Chapter 1: Introduction. 1.5 Computer-System Architecture. Chapter 1: Introduction. Part 2. A computer system may be organized in a number of different ways, which we can categorize roughly according to the number of general-purpose processors used. 1.5.1 Single-Processor Systems

gfeliciano
Download Presentation

Part 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Part 2 Chapter 1: Introduction

  2. 1.5 Computer-System Architecture Chapter 1: Introduction Part 2 A computer system may be organized in a number of different ways, which we can categorize roughly according to the number of general-purpose processors used. 1.5.1 Single-Processor Systems • Most systems use a single general-purpose processor • Most systems have special-purpose processors as well • The use of special-purpose microprocessors is common and does not turn a single-processor system into a multiprocessor. If there is only one general-purpose CPU, then the system is a single-processor system.

  3. 1.5.2 Multiprocessor systems • Multiprocessorssystems growing in use and importance • Also known as parallel systems, tightly-coupled systems • Advantages include: • Increased throughput • Economy of scale • Increased reliability – graceful degradation or fault tolerance • Two types: • Asymmetric Multiprocessing - Each processor is assigned a specific task. - A master processor controls the system; the other processors either look to the master for instruction or have predefined tasks. - This scheme defines a Master-Slave relationship. - The master processor schedules and allocates work to the slave processors.

  4. Symmetric Multiprocessing Architecture 2. Symmetric Multiprocessing • Each processor performs all tasks. • SMP means that all processors are peers; • No master-slave relationship exists between processors. • A recent trend in CPU design is to include multiple computing cores on a single chip. Such multiprocessor systems are termed multicore. They can be more efficient than multiple chips with single cores because on-chip communication is faster than between-chip communication. In addition, one chip with multiple cores uses significantly less power than multiple single-core chips.

  5. It is important to note that while multicore systems are multiprocessor systems, not all multiprocessor systems are multicore. In the figure, we show a dual-core design with two cores on the same chip. In this design, each core has its own register set as well as its own local cache. A Dual-Core Design • Multi-chip and multicore • Systems containing all chips • Chassis containing multiple separate systems

  6. 1.6 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 One job selected and run via job scheduling When it has to wait (for I/O for example), OS 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 Each user has at least one program executing in memory process If several jobs ready to run at the same time  CPU scheduling If processes don’t fit in memory, swapping moves them in and out to run

  7. Memory Layout for Multiprogrammed System

  8. 1.7 Operating-System Operations Interrupt driven (hardware and software) Hardware interrupt by one of the devices Software interrupt (exception or trap): 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 1.7.1 Dual-mode operation allows OS to protect itself and other system components • User mode • kernel mode • Mode bit is added to the hardware of the computer to indicate the current mode; kernel (0) or user (1). With the mode bit, we are able to distinguish between a task that is executed on behalf of the operating system and one that is executed on behalf of the user.

  9. At system boot time, the hardware starts in kernel mode. The operating system is then loaded and starts user applications in user mode. Whenever a trap or interrupt occurs, the hardware switches from user mode to kernel mode (that is, changes the state of the mode bit to 0). Thus, whenever the operating system gains control of the computer, it is in kernel mode. • The dual mode of operation provides us with the means for protecting the operating system from: errant users—and errant users from one another. We accomplish this protection by designating some of the machine instructions that may cause harm as privileged instructions. Transition from user to kernel mode

  10. 1.7.2 Timer Timer to prevent infinite loop / process hogging resources Timer is set to interrupt the computer after some time period Keep a counter that is decremented by the physical clock. Operating system set the counter (privileged instruction) When counter zero generate an interrupt Set up before scheduling process to regain control or terminate program that exceeds allotted time. We can use the timer to prevent a user program from running too long. A simple technique is to initialize a counter with the amount of time that a program is allowed to run. A program with a 7-minute time limit, for example, would have its counter initialized to 420. Every second, the timer interrupts, and the counter is decremented by 1. As long as the counter is positive, control is returned to the user program. When the counter becomes negative, the operating system terminates the program for exceeding the assigned time limit.

More Related