Chapter 1 - Introduction (System Software Technology & Hardware Technology) 1. Computer System Components
Chapter 1 - Introduction (System Software Technology & Hardware Technology) 1. Computer System Components
. Computer System Components (i) Hardware Provides basic computing resources (CPU, memory, Input/output (I/O) devices). (ii) Operating System (OS) Controls and coordinates the use of the hardware among the various application programs for the various users. (iii)Applications Programs /Application Software Define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs). (iv)Users Include people, machines, and other computers. 1.1 Common operating system platforms include: Windows(NT, Vista, Window 7 etc) Unix, Linux (RedHat, SuSE, and Ubuntu) MS DOS SYSTEM SOFTWARE TECHNOLOGY 2. Overview of Operating Systems Operating System It is a set of system software routines that sits between the application program and the hardware. It is a program that acts as an intermediary between the user of a computer and the computer hardware. It is part of the computing system that manages all of the hardware and all of the software which controls every file, device, section of main memory and every nanosecond of processing time It is the one program which is running at all times (all else being application programs).
User
Application program
Operating system
Hardware
Note: System software contributes to the performance of the computer system while application software does a specific job for the user.
AACS2284 Operating Systems Page 1 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 3. Functions of an Operating System: Make the computer system convenient to use. Use the computer hardware in an efficient manner. Allocate resources (e.g. CPU time, memory space, file storage space, I/O devices) to specific programs thus increasing efficiency of computer system. Controls the execution of user programs and the operations of I/O devices.
4. Characteristics of an operating system Concurrency Concurrency is the existence of several simultaneous or parallel activities such as overlapping of I/O operations with computation. Sharing Concurrent activities may be required to share resources or information. Long-term storage The need for sharing of programs and data implies the need for long-term storage of information. Long-term storage allows users the convenience of keeping their programs or data in the computer rather than on some external medium. Non determinacy An operating system must be determinate in the sense that the same program that runs today or tomorrow with the same data, should produce the same results. On the other hand it is indeterminate in that it must respond to events which will occur in an unpredictable manner. These events include resource requests, run-time errors in programs, and interrupts from peripheral devices.
Page 2 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 5. An operating system consists of the following essential managers: Memory manager Processor manager Device manager File manager
The following diagram is an abstract representation of an operating system demonstrating how its major components work together in a non-networked operating system with its four sub-system managers supporting the user command interface User Command Interface
Device Manager
File Manager
Page 3 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 6. Tasks Performed by Each Subsystem Monitor its resources continuously Enforce the policies that determine who gets what, when and how much Allocate the resource when appropriate Deallocate the resource (reclaim it) when appropriate
Note: Networked systems have a Network Manager that assumes responsibility for networking tasks while working harmoniously with every other manager) Processor Manager (CPU) Memory Manager (main memory)
Network Manager (network communications, protocols, etc) File Manager (program files, data files, compilers, etc)
Page 4 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) Example: If someone types a command to execute a program, the following major steps must occur in sequence a) The Device Manager must receive the electrical impulses from the keyboard, decode the keystrokes to form the command, and send the command to the User Command Interface, where the Processor Manager validates the command. b) The Processor Manager then sends an acknowledgement message to be displayed on the video monitor so the user realizes the command has been sent. c) When the Processor Manager receives the command, it determines whether the program must be retrieved from the storage or is already in memory, and then notifies the appropriate manager. d) If the program is in storage, the File Manager must calculate its exact location on the disk and pass this information to the Device Manager, which retrieves the program and sends it to the Memory Manager. e) The Memory Manager then finds space for it and record its exact location in memory. Once the program is in memory (even its moved) as well as its progress as its executed by the Processor Manager. Processor Manager Allocates CPU time Keeps track of each process status - waiting, executing Sets up necessary registers and tables Reclaims processor when job is finished and/or time for job has expired Two levels of responsibility 1. Accepts or rejects the incoming jobs (handled by Job Scheduler) 2. Decides which process gets the CPU and for how long (Handled by the Process Scheduler) Memory Manager Checks validity of each request for memory space and if it is a legal request, allocates a portion of memory that isnt already in use Sets up a table to keep track of who is using which section of memory. Deallocates memory blocks once program completes execution Protects OS memory space so that it cannot be altered by other programs Device Manager Monitors every device, channel, and control unit. Allocate in the most efficient manner all of the systems devices (e.g. printers, devices, ports, disk drives) based on a scheduling policy chosen by the systems designers. Functions include: Allocation of devices Starting operation of devices Deallocation of devices once job completes
Page 5 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) File Manager Keeps track of each file in the system (e.g. data files, program files, compilers, application programs) Allocate resources (e.g. opening files) and deallocate resources (e.g. closing files) Uses predetermined access policies to enforce restrictions on who has access to which files Example: Restrictions on each file system only, user only, group only, general access User restriction read only, read/write only, allowed to create file, allowed to delete file 7. Types of Operating Systems Operating systems can be divided into five categories based on their response time and how data is entered into the system: a. Batch Systems Jobs processed serially without user interaction Efficiency is measured in throughput ,i.e. the number of jobs completed in a given a mount of time (e.g. 550 jobs per hour)
Example: Preparation of a weekly payroll for an organization whereby time cards are collected, data entered and processed, paychecks and reports are then printed b. Interactive Systems (also sometimes referred to as time-sharing systems) User interacts directly with the operating system via commands entered from the keyboard Operating system provides immediate feedback to the user. Response time can be measured in fractions of a second.
Example: Banks automatic teller machines (ATMs) which provides immediate cash and transaction details for its users. c. Real-Time Systems Extremely fast systems which are used in time-critical environments where reliability is a major factor and data must be processed within a strict time limit. Usually a real-time system is a dedicated system which spends all or most of its time on a single job. Must be 100% responsive 100% of the time.
Example: Air traffic control system used by the airport authority such as the radar system
Page 6 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) d. Hybrid Systems A combination of batch and interactive systems. Appear to be interactive because individual users can access the system and get fast responses but actually accepts and runs batch programs in eh background when the interactive load is light. Takes advantage of the free time between high-demand usage of the system and lowdemand times. Many large computer systems are hybrids. e. Embedded Systems Embedded systems are computers placed inside other products to add features and capabilities.
Example: In automobiles, embedded computers can help with engine performance, braking and navigation. f. Utility Programs Most operating systems use a set of utility routines such as : linkage editors loaders line editors disk formatting modules sort routines debugging features library management routines
Page 7 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) HARDWARE TECHNOLOGY 8. Basic unit of data representation Bits are grouped to form bytes, which in turn are grouped to form words. Bit: one binary digit (0 or 1). Byte: eight bits (1 character). Word: a group of bytes.
Word 0
Byte 0 11111111
Byte 1 11111111
Byte 2 11111111
Byte 3 11111111
9. Basic elements of computer system - I/O Unit, Memory and Processor 9.1 Memory Memory holds active programs and data. A program must be stored in memory before it can be executed. Data must be stored in memory before the computer can manipulate them. Memory write is a destructive operation. Memory read is not destructive. Addressing Memory Memory capacity is usually measured in megabytes. To distinguish them, each byte (or word) is assigned a unique address. The bytes (or words) are numbered sequentially 0,1, 2 , etc. Bytes (or words) are the basic addressable units of memory. The processor accesses a specific memory location by referencing its address. Example: If the processor needs the data stored in byte 1048, is asks memory for the contents of byte 1048. Since there is only one byte 1048, the processor gets the right data. Depending on the computer, bytes or words are the basic addressable units of memory. Data move between the processor and memory one byte or one word at a time.
Memory Addresses
Page 8 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) Memories consist of a number of locations (cells) each of which can store a piece of information. Each location has a number called address. If a memory has n locations (cells), they will have addresses 0 to n-1. All locations in the memory contain the same number of bits. If a location of k bits, it can hold any one of 2 different bit combinations ( k bits => can holding 2k combinations)
The Operation of Memory The Memory Address Register (MAR) and Memory Data Register (MDR) act as an interface between the CPU and Memory, whereby each cell in the memory unit holds one bit of data. The cells in Figure 1 are organized in rows. Each row consists of a group of one or more bytes. Each group represents the data cells for one of more consecutive memory addresses. (AD is Address Decoder) One or more bytes 000 001 M A R bit n 2n -1 Aaddress line D
bit 0
MDR Figure 1. The relationship between the MAR, MDR and Memory
The memory address register holds the address in the memory that to be opened for data. The MAR is connected to decoder that interprets the address and activates a single address line into memory.
There is separate line for each group of cells in the memory; thus if there are n bit of addressing there will be 2 address lines. The memory data register is designed such that it is effectively connected to every cell in the memory unit. Each bit of the MDR is connected in a column to
Page 9 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) corresponding bit of every location in memory. However, the addressing method assures that only a single row of cells is activated at any given time. If a machine has a 4GB memory data register (MDR), then 32 bits are used for the value of that memory buffer. 4GB = 22 230 = 232 Therefore 32 bits are used If a machine use 33 bits for memory data register, then the capacity of memory buffer is 8GB ( 23 230) Because 233 is equivalent to 8GB Note: (1KB is 210, 1MB is 220, and 1GB is 230) If a machine has a 64-bit memory address register (MAR), then the machine can address 264 addresses and 264 1 is the last memory address location. If the memory address register value is 1000101 then the memory location is 69 If the memory address register value is 1100111 then the memory location is 103, If the memory location is 65 and assume 7 bits are used in memory address register (MAR) then the binary content of MAR is 1000001
Page 10 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 9.2 Cache Memory Cache memory is a staging area for the processor.
Main memory
Cache memory
The processor
The program is stored in standard RAM. As the program executes, the active instructions and the active data are transferred to high-speed cache memory. From there, individual instructions and data referenced by those instructions move from cache to the processor, consequently, the processor waits for high-speed cache instead of slower RAM and that increases processing speed. Note: ROM (Read-Only Memory) is a non-volatile form of storage while RAM (Random Access Memory) is a volatile type of storage.
Page 11 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 9.3 The Processor The processor manipulates data stored in memory under the control of a program stored in memory.
Processor
Memory
Program
Data
A program is a series of instructions. Each instruction has an operation code and one or more operands.
Operands 1000,1004
Note: An operation code specifies the function to be performed while an operand is the portion of an instruction that specifies the memory locations or registers holding the data to be manipulated.
Page 12 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) The processor contains four key components.
Clock
Registers
The instruction control unit (ICU) fetches instructions from memory. The arithmetic and logic unit (ALU) consists of the circuits that add, subtract, multiply, and so on (the computers instruction set). It executes instructions. Registers are temporary storage devices in the processor that hold control information, key data and intermediate results. The clock generates precisely timed electronic pulses that synchronize the other components.
9.4 Input and Output Input The act of transferring data into memory from a peripheral device. Output The act of transferring data from memory to a peripheral device. Input and Output Support human interaction with a computer.
Page 13 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) The input/output control system (IOCS) communicates directly with the computers peripheral devices.
Operating system
Command processor
(The command processor is the operating system module that accepts, interprets and carries out commands) The input/output control system generates the primitive commands that control the peripheral device.
Application program
Primitive commands
Peripheral device
(Primitive command a low-level operation that causes a peripheral device to perform a single task) Logical I/O the programmers view-one logical record Physical I/O the transfer of a physical record between memory and a peripheral device
Page 14 of 15
Chapter 1 Introduction (System Software Technology & Hardware Technology) 9.5 Memory Capacity and Processor Speed On most systems, the internal components are designed around a common word size. Example: On a 32-bit computer, the processor manipulates 32-bit numbers, memory and the registers store 32-bit words, and data and instructions move between the components over a 32-bit bus. A computers word size affects its processing speed, memory capacity, precision, instruction set size, and cost. Example of how word-size can affect processing speed A 32-bit bus contains 32 wires and thus can carry 32 bits at a time. A 16-bit bus has only 16 parallel wires and thus can carry only 16 bits at a time. Because the bus moves twice as much data in the same amount of time, the 32-bit machine is clearly faster. Generally, the bigger the word size the faster the computer is. Example of how memory capacity can be affected by word size To access memory, the processor must transmit over a bus the address of desired instruction or data element. On a 32-bit machine, a 32-bit address can be transmitted. The biggest 32-bit number is roughly 4 billion in decimal terms, so the processor can access as many as 4 billion different memory locations. A 16-bit computer transmits a 16-bit address, limiting it to roughly 64,000 memory locations. Generally, the bigger its word size, the more memory a computer can address.
Page 15 of 15