Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Understanding Computer Hardware: Processors, Memory, and I/O Devices, Study notes of Operating Systems

An overview of computer hardware components, including processors, memory hierarchy, buses, and i/o devices. It covers topics such as processor architecture, clocks, caching, and buffering. Students will gain a solid foundation in computer hardware concepts.

Typology: Study notes

Pre 2010

Uploaded on 02/13/2009

koofers-user-jp4
koofers-user-jp4 🇺🇸

10 documents

1 / 25

Toggle sidebar

Related documents


Partial preview of the text

Download Understanding Computer Hardware: Processors, Memory, and I/O Devices and more Study notes Operating Systems in PDF only on Docsity! 1  2004 Deitel & Associates, Inc. All rights reserved. Chapter 2 – Hardware and Software Concepts Outline 2.1 Introduction 2.2 Evolution of Hardware Devices 2.3 Hardware Components 2.3.1 Mainboards 2.3.2 Processors 2.3.3 Clocks 2.3.4 Memory Hierarchy 2.3.5 Main Memory 2.3.6 Secondary Storage 2.3.7 Buses 2.3.8 Direct Memory Access (DMA) 2.3.9 Peripheral Devices 2.4 Hardware Support for Operating Systems 2.4.1 Processor 2.4.2 Timers and Clocks  2004 Deitel & Associates, Inc. All rights reserved. Chapter 2 – Hardware and Software Concepts Outline (continued) 2.4.3 Bootstrapping 2.4.4 Plug and Play 2.5 Caching and Buffering 2.6 Software overview 2.6.1 Machine Language and Assembly Language 2.6.2 Interpreters and Compilers 2.6.3 High-Level Languages 2.6.4 Structured Programming 2.6.5 Object-Oriented Programming 2.7 Application Programming Interfaces (APIs) 2.8 Compiling, Linking and Loading 2.8.1 Compiling 2.8.2 Linking 2.8.3 Loading 2.9 Firmware 2.10 Middleware 2  2004 Deitel & Associates, Inc. All rights reserved. Objectives • After reading this chapter, you should understand: – hardware components that must be managed by an operating system. – how hardware has evolved to support operating system functions. – how to optimize performance of various hardware devices. – the notion of an application programming interface (API). – the process of compilation, linking and loading.  2004 Deitel & Associates, Inc. All rights reserved. 2.1 Introduction • An operating system is primarily a resource manager – Design is tied to the hardware and software resources the operating system must manage • processors • memory • secondary storage (such as hard disks) • other I/O devices • processes • threads • files • databases 5  2004 Deitel & Associates, Inc. All rights reserved. 2.3.2 Processors • A processor is hardware that executes machine- language – CPU executes the instructions of a program – Coprocessor executes special-purpose instructions • Ex., graphics or audio coprocessors – Registers are high-speed memory located on processors • Data must be in registers before a processor can operate on it – Instruction length is the size of a machine-language instruction • Some processors support multiple instruction lengths  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.2 Processor components. 2.3.2 Processors 6  2004 Deitel & Associates, Inc. All rights reserved. 2.3.3 Clocks • Computer time is measured in cycles – One complete oscillation of an electrical signal – Provided by system clock generator – Processor speeds are measured in GHz (billions of cycles per second) • Modern desktops execute at hundreds of megahertz or several GHz  2004 Deitel & Associates, Inc. All rights reserved. 2.3.4 Memory Hierarchy • The memory hierarchy is a scheme for categorizing memory – Fastest and most expensive at the top, slowest and least expensive at the bottom • Registers • L1 Cache • L2 Cache • Main Memory • Secondary and tertiary storage (CDs, DVDs and floppy disks) – Main memory is the lowest data referenced directly by processor • Volatile – loses its contents when the system loses power 7  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.3 Memory hierarchy. 2.3.4 Memory Hierarchy  2004 Deitel & Associates, Inc. All rights reserved. 2.3.5 Main Memory • Main memory consists of volatile random access memory (RAM) – Processes can access data locations in any order – Common forms of RAM include: • dynamic RAM (DRAM) – requires refresh circuit • static RAM (SRAM) – does not require refresh circuit – Bandwidth is the amount of data that can be transferred per unit of time 10  2004 Deitel & Associates, Inc. All rights reserved. 2.3.9 Peripheral Devices • Peripheral devices – Any device not required for a computer to execute software instructions – Internal devices are referred to as integrated peripheral devices • Network interface cards, modems, sound cards • Hard disk, CD and DVD drives – Character devices transfer data one bit at a time • Keyboards and mice – Can be attached to a computer via ports and other buses • Serial ports, parallel ports, USB, IEEE 1394 ports and SCSI  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.5 Peripheral devices (1 of 2). 2.3.9 Peripheral Devices 11  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.5 Peripheral devices (2 of 2). 2.3.9 Peripheral Devices  2004 Deitel & Associates, Inc. All rights reserved. 2.4 Hardware Support for Operating Systems • Computer architectures contain: – Features that perform operating system functions quickly in hardware to improve performance – Features that enable the operating system to rigidly enforce protection 12  2004 Deitel & Associates, Inc. All rights reserved. 2.4.1 Processor • A processor implements operating system protection mechanisms – Prevents processes from accessing privileged instructions or memory – Computer systems generally have several different execution modes: • User mode (user state or problem state) – User may execute only a subset of instructions • Kernel mode (supervisor state) – Processor may access privileged instructions and resources on behalf of processes  2004 Deitel & Associates, Inc. All rights reserved. 2.4.1 Processor • Memory protection and management – Prevents processes from accessing memory that has not been assigned to them – Implemented using processor registers modified only by privileged instructions • Interrupts and Exceptions – Most devices send a signal called an interrupt to the processor when an event occurs – Exceptions are interrupts generated in response to errors – The OS can respond to an interrupt by notifying processes that are waiting on such events 15  2004 Deitel & Associates, Inc. All rights reserved. 2.5 Caching and Buffering • Caches – Relatively fast memory – Maintain copies of data that will be accessed soon – Increase program execution speed – Examples include: • L1 and L2 processor caches • Main memory can be viewed as a cache for hard disks and other secondary storage devices  2004 Deitel & Associates, Inc. All rights reserved. 2.5 Caching and Buffering • Buffers – Temporary storage area that holds data during I/O transfers – Primarily used to: • Coordinate communications between devices operating at different speeds • Store data for asynchronous processing • Allow signals to be delivered asynchronously • Spooling – Buffering technique in which an intermediate device, such as a disk, is interposed between a process and a low-speed I/O device – Allows processes to request operations from a peripheral device without requiring that the device be ready to service the request 16  2004 Deitel & Associates, Inc. All rights reserved. 2.6 Software Overview • Programming languages – Some are directly understandable by computers, others require translation – Classified generally as either: • Machine language • Assembly language • High-level language  2004 Deitel & Associates, Inc. All rights reserved. 2.6.1 Machine Language and Assembly Language • Machine language – Defined by the computer’s hardware design – Consists of streams of numbers (1s and 0s) that instruct computers how to perform elementary operations – A computer can understand only its own machine language • Assembly language – Represents machine-language instructions using English-like abbreviations – Assemblers convert assembly language to machine language – Speeds programming, reduces potential for bugs 17  2004 Deitel & Associates, Inc. All rights reserved. 2.6.2 Interpreters and Compilers • High-level languages – Instructions look similar to everyday English – Accomplish more substantial tasks with fewer statements – Require compilers and interpreters • Compiler – Translator program that converts high-level language programs into machine language • Interpreter – Program that directly executes source code or code that has been reduced to a low-level language that is not machine code  2004 Deitel & Associates, Inc. All rights reserved. 2.6.3 High-level languages • Popular high-level languages – Typically are procedural or object-oriented – Fortran • Used for scientific and engineering applications – COBOL • For business applications that manipulate large volumes of data – C • Development language of the UNIX OS – C++/Java • Popular object-oriented languages – C# • Object-oriented development language for the .NET platform 20  2004 Deitel & Associates, Inc. All rights reserved. 2.8 Compiling, Linking and Loading • Before a high-level-language program can execute, it must be: – Translated into machine language – Linked with various other machine-language programs on which it depends – Loaded into memory  2004 Deitel & Associates, Inc. All rights reserved. 2.8.1 Compiling • Translating high-level code to machine code – Accepts source code as input and returns object code – Compilation phases include: • Lexer – Separates the characters of a program’s source into tokens • Parser – Groups tokens into syntactically correct statements • Intermediate code generator – Converts statements into a stream of simple instructions • Optimizer – Improves code execution efficiency and memory requirements • Code generator – Produces the object file containing the machine-language 21  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.8 Compiler phases. 2.8.1 Compiling  2004 Deitel & Associates, Inc. All rights reserved. 2.8.2 Linking • Linkers – Create a single executable unit – Integrate precompiled modules called libraries referenced by a program – Assign relative addresses to different program or data units – Resolve all external references between subprograms – Produce an integrated module called a load module – Linking can be performed at compile time, before loading, at load time or at runtime 22  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.9 Object module. 2.8.2 Linking  2004 Deitel & Associates, Inc. All rights reserved. Figure 2.10 Linking process. 2.8.2 Linking
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved