computer fundamentals

February 13, 2017 | Author: Paritosh Parmar | Category: N/A
Share Embed Donate


Short Description

Download computer fundamentals...

Description

Handout: Fundamentals of Computer Technology Version: FCT/Handout/1107/1.0 Date: 08-11-07

Cognizant 500 Glen Pointe Center West Teaneck, NJ 07666 Ph: 201-801-0233 www.cognizant.com

Handout - Fundamentals of Computer Technology

TABLE OF CONTENTS Introduction ...................................................................................................................................7  About this Document ....................................................................................................................7  Target Audience ...........................................................................................................................7  Objectives .....................................................................................................................................7  Pre-requisite .................................................................................................................................7  Session 1: Introduction to Computer Fundamentals .................................................................8  Learning Objectives ......................................................................................................................8  Computer Generations .................................................................................................................8  A typical Computer System ........................................................................................................11  Computer Types .........................................................................................................................15  What is an Operating System .....................................................................................................15  OS Objectives .............................................................................................................................16  OS Functions ..............................................................................................................................17  Evolution of OS ...........................................................................................................................18  Types of Operating Systems ......................................................................................................22  OS Layers ...................................................................................................................................25  Summary ....................................................................................................................................25  Test your Understanding ............................................................................................................25  Session 2: Introduction to Computer Networking ....................................................................27  Learning Objectives ....................................................................................................................27  Introduction to Computer Networks ............................................................................................27  Why Networking..........................................................................................................................27  Network Goals ............................................................................................................................28  Components of a Computer Network .........................................................................................29  Network Types ............................................................................................................................31  Classification of computer networks ...........................................................................................32  Network Services ........................................................................................................................38  Summary ....................................................................................................................................41  Test your Understanding ............................................................................................................41  Session 3: CPU Structure ............................................................................................................42  Learning Objectives ....................................................................................................................42  Major Components of CPU.........................................................................................................42  U

Page 2 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Overview of CPU Behavior .........................................................................................................43  Instruction Execution ..................................................................................................................44  Instruction types..........................................................................................................................45  Fetching a word from Memory ....................................................................................................45  Storing Word in Memory .............................................................................................................46  Register Transfers ......................................................................................................................46  Arithmetic Logic Unit ...................................................................................................................46  Register Gating ...........................................................................................................................47  Timing of Data Transfers ............................................................................................................47  Control Unit .................................................................................................................................47  Hardwired Control .......................................................................................................................48  Micro programmed Control .........................................................................................................48  Control Sequence .......................................................................................................................49  Microinstructions .........................................................................................................................50  Intel, AMD ...................................................................................................................................50  Summary ....................................................................................................................................51  Test your Understanding ............................................................................................................51  Session 4: Operating Systems Management.............................................................................52  Learning Objectives ....................................................................................................................52  Operating System Components .................................................................................................52  Processes and Process management ........................................................................................54  Process States............................................................................................................................55  Process Control Block (PCB) .....................................................................................................56  Scheduling: A Few Scenarios.....................................................................................................59  Process Scheduling Algorithms ..................................................................................................60  Session 5: Operating Systems Management.............................................................................66  Learning Objectives ....................................................................................................................66  Memory Management .................................................................................................................66  Memory hierarchy .......................................................................................................................67  Memory Organization .................................................................................................................70  Placement Algorithm ..................................................................................................................74  Page Replacement Algorithms ...................................................................................................82  File System Management ...........................................................................................................84  File Operations ...........................................................................................................................86  Summary ....................................................................................................................................96  Session 6: I/O Interfacing ............................................................................................................97 

Page 3 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Learning Objectives ....................................................................................................................97  Overview .....................................................................................................................................97  Accessing I/O Devices ................................................................................................................98  Hardware to connect I/O Device to BUS ....................................................................................98  Implementation of I/O operations ...............................................................................................99  Programmed I/O .........................................................................................................................99  Isolated I/O ...............................................................................................................................100  Interrupt –Driven I/O .................................................................................................................100  How to achieve better Speed of Execution? ............................................................................101  Direct Memory Access (DMA) ..................................................................................................101  Block diagram of a computer with Input-Output Processor ......................................................103  I/O Management .......................................................................................................................103  MS-DOS ...................................................................................................................................104  Windows Family........................................................................................................................105  Summary ..................................................................................................................................105  Session 7: Network Protocols and Cognizant Network System............................................106  Learning Objectives ..................................................................................................................106  Protocol Definition.....................................................................................................................106  The Open Systems Interface (OSI) Reference Model..............................................................107  The OSI Layers.........................................................................................................................108  The Application Layer ...............................................................................................................110  The Presentation Layer ............................................................................................................111  The Session Layer ....................................................................................................................112  The Transport Layer .................................................................................................................112  The Network Layer ...................................................................................................................117  The Data Link Layer .................................................................................................................119  The Physical Layer ...................................................................................................................121  Introduction to TCP/IP ..............................................................................................................122  The Four Layers of TCP/IP .......................................................................................................123  Transmission Control Protocol .................................................................................................126  Cognizant Network System ......................................................................................................137  Summary ..................................................................................................................................138  Session 8: Internetworking and Network Management..........................................................139  What Is an Internetwork?..........................................................................................................139  Repeaters: ................................................................................................................................140  Bridges......................................................................................................................................141  Types of Bridges .......................................................................................................................143 

Page 4 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Transparent Bridge ...................................................................................................................144  Routers .....................................................................................................................................145  Gateways ..................................................................................................................................147  What is a network firewall? .......................................................................................................148  Why would I want a firewall? ....................................................................................................148  What can a firewall protect against?.........................................................................................148  What can't a firewall protect against? .......................................................................................149  What about viruses? .................................................................................................................149  Network Management ..............................................................................................................151  Summary: .................................................................................................................................152  Session 9: Advanced Computing Concepts – A Survey ........................................................153  Learning Objective ....................................................................................................................153  Pipelining ..................................................................................................................................153  Effect of operation that takes more than 1 clock cycle .............................................................155  Why can’t the pipeline operate at its maximum theoretical speed? .........................................155  Parallelism ................................................................................................................................155  Flynn’s Classification ................................................................................................................156  Client – Server ..........................................................................................................................158  Architecture...............................................................................................................................159  Client Server Model ..................................................................................................................159  Server .......................................................................................................................................160  Server Types ............................................................................................................................160  File Server ................................................................................................................................162  Compute Server........................................................................................................................162  Database Server .......................................................................................................................162  Communication Server .............................................................................................................163  Multiprocessor Organization .....................................................................................................163  Summary ..................................................................................................................................164  Test your Understanding ..........................................................................................................164  Session 10: Case Study – UNIX ................................................................................................165  Learning Objectives ..................................................................................................................165  What is UNIX? ..........................................................................................................................165  Types of UNIX ..........................................................................................................................165  Layered Architecture ................................................................................................................166  Kernel .......................................................................................................................................166  UNIX System Calls ...................................................................................................................167  UNIX User Interface .................................................................................................................168 

Page 5 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology UNIX Shell ................................................................................................................................168  Basic Form of UNIX Commands ..............................................................................................170  UNIX Process Management .....................................................................................................173  UNIX CPU Scheduling ..............................................................................................................177  UNIX Memory Management .....................................................................................................178  UNIX File System .....................................................................................................................179  UNIX I/O Subsystem ................................................................................................................181  UNIX IPC ..................................................................................................................................182  Network Support in UNIX .........................................................................................................184  Session 11: Case Study – WINDOWS XP .................................................................................185  Learning Objectives ..................................................................................................................185  Windows XP .............................................................................................................................185  History.......................................................................................................................................186  Design Principles ......................................................................................................................186  System Components — Kernel ................................................................................................186  Kernel — Process and Threads ...............................................................................................186  Kernel — Scheduling ................................................................................................................187  Executive — Object Manager ...................................................................................................187  Executive — Virtual Memory Manager .....................................................................................187  Executive — Process Manager ................................................................................................188  Executive — Local Procedure Call (LPC) Facility ....................................................................188  Executive — I/O Manager ........................................................................................................188  Executive — Security Reference Monitor .................................................................................188  File System ...............................................................................................................................189  File System — Security ............................................................................................................189  Networking ................................................................................................................................189  Summary ..................................................................................................................................190  Test Your Understanding..........................................................................................................190  References ..................................................................................................................................191  Websites ...................................................................................................................................191  Books ........................................................................................................................................191  STUDENT NOTES: ......................................................................................................................192 

Page 6 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Introduction

About this Document This module discusses Fundamental concepts of Computer system, Operating System and Networks Target Audience Entry Level Trainees Objectives ‰

Get an Insight into the Computer Technologies

‰

Obtain Basic Knowledge of Operating Systems

‰

Understand Computer Networking Principles

Pre-requisite This module requires that the trainee meet the following prerequisites: ‰

Basic knowledge of Computer Fundamentals and Digital Electronics

‰

Basic Structure of Computer Hardware and Software

Page 7 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Session 1: Introduction to Computer Fundamentals

Learning Objectives After completing this chapter, you will be able to: ‰

List various Generations of Computers

‰

Explain a typical Computer System

‰

Differentiate Types of Computers

‰

Define an Operating System

‰

Identify Operating Systems available today

Computer Generations The Computer Evolution over the period of time has resulted in development of various generations and devices. Different technologies have been used for manufacturing the computer hardware. Based on the component technology, computers are classified into five generations. Each computer generation is characterized by a major technological development that fundamentally changed the way computers operate, architectural structure, resulting in increasingly smaller, cheaper, more powerful and more efficient and reliable devices. The study of these aspects, helps one to distinguish between past and the present dimensions of the computer.

First Generation Computers (1937-1953) ‰

These computers were pure hardware machines which contained no Operating System.

‰

Programming was done in the machine language which differs from one computer to another.

‰

The user deals with several switches in the front panel to start, run or halt the computer.

‰

The internal status of the computer is displayed on several lights on the front panel.

‰

Invariably only a designer or programmer could operate the computer due to the complexities involved.

‰

These machines used electronic switches, in the form of vacuum tubes, instead of electromechanical relays.

‰

In principle, the electronic switches would be more reliable, since they would have no moving parts that would wear out, but the technology was still new at that time and the vacuum tubes were comparable to relays in reliability.

‰

Electronic components had one major benefit, they could "open" and "close" about 1,000 times faster than mechanical switches.

‰

The earliest attempt to build an electronic computer was by J.V. Atanasoff, a Professor of Physics and Mathematics at Iowa State, in 1937. Atanasoff set out to build a machine that would help his graduate students solve systems of partial differential equations.

Page 8 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

By 1941, he and his graduate student Clifford Berry had succeeded in building a machine that could solve 29 simultaneous equations with 29 unknowns. However, the machine was not programmable, and was more of an electronic calculator.

‰

Electronic Numerical Integrator and Calculator(ENIAC) was the first general purpose electronic computer. It was an enormous machine weighing about 30 tons and containing more than 18,000 vacuum tubes.

Second Generation Computers (1954-1962) ‰

Transistor Invention by Bell Labs was a boon to second generation computers.

‰

Smaller in size and also consumes less power.

‰

Several companies such as IBM, NCR, RCA etc. quickly introduced transistor technology which also improved reliability of computers.

‰

Instead of ‘wiring’ circuits, photo printing was used to build Printed Circuit Boards (PCB).

‰

Both computer production and maintenance of computers became easier.

‰

The second generation saw several important developments at all levels of computer system design, from the technology used to build the basic circuits to the programming languages used to develop scientific applications

‰

Electronic switches in this era were based on discrete diodes and transistors technology with a switching time of approximately 0.3 microseconds.

‰

The first machines to be built with this technology include TRADIC (TRAnsistor DIgital Computer) at Bell Laboratories in 1954 and TX-0 at MIT's Lincoln Laboratory.

‰

Memory technology was based on magnetic cores, which could be accessed in random order, as opposed to mercury delay lines, in which data was stored as an acoustic wave that passed sequentially through the medium and could be accessed only when the data moved by the I/O interface.

‰

Important innovations in Computer Architecture were index registers for controlling loops and floating point units for calculations based on real numbers.

‰

Floating-point operations were performed by libraries of software routines in early computers, but were done in hardware in second generation machines.

Third Generation Computers (1963-1972) ‰

Integrated Circuit(IC) chip Invention is a great event for electronics field giving rise to microelectronics.

‰

IC has multiple advantages over discrete components: smaller size, higher speed, lower hardware cost, improved reliability etc.

‰

Digital computer design became more attractive and interesting.

‰

The use of computers in a continuous processing and manufacturing sectors such as petroleum refining and electrical power distribution became popular.

‰

The computer families by leading companies such as IBM, UNIVAC, HP,ICL and DEC dominated the computer industry.

‰

The third generation brought huge gains in computational power:

‰

Integrated Circuits, or ICs (semiconductor devices with several transistors built into one physical component), semiconductor memories instead of magnetic cores, microprogramming for efficiently designing complex processors, pipelining and other forms of parallel processing techniques. Page 9 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

Operating System software allowed efficient sharing of a computer system by several user programs.

‰

The first ICs were based on Small-Scale Integration (SSI) circuits, which had around 10 devices per circuit (or "chip"), and evolved to the use of Medium-Scale Integrated (MSI) circuits, which had up to 100 devices per chip.

‰

Multilayered printed circuits were developed and core memory was replaced by faster, solid state memories.

‰

Computer designers began to take advantage of parallelism by using multiple functional units, overlapping CPU and I/O operations, and pipelining (internal parallelism) in both the instruction stream and the data stream.

‰

In 1964, Seymour Cray developed the CDC 6600, which was the first architecture to use functional parallelism. By using 10 separate functional units that could operate simultaneously and 32 independent memory banks, the CDC 6600 was able to attain a computation rate of 1 million floating point operations per second (1 MFlops).

Fourth Generation Computers (1972- 1984) ‰

Computers built after 1972, called Fourth Generation computers were based on LSI (Large Scale Integration) of circuits (such as microprocessors) - typically 500 or more transistors on a chip.

‰

Later developments included VLSI (Very Large Scale Integration) integrated circuits typically 10,000 transistors.

‰

Modern circuits may now contain millions of components. This has led to very small, yet incredibly powerful computers.

‰

The fourth generation is generally viewed as running right up until the present, since, although computing power has increased, the basic technology has remained virtually the same.

‰

By the late 1990’s many people began to suspect that this technology was reaching its limit, further miniaturization could only achieve so much.

‰

1 GB RAM chips have circuitry so small that it can be measured in terms of atoms. Such small circuits pose many technical problems like the increase in temperature and radiation.

Fifth Generation Computers (1984-1990) ‰

The use of VLSI and artificial intelligence concept is used in this generation of computers.

‰

Expert systems, pattern recognition, voice recognition, signature capturing and recognition, microprocessor controlled robots etc. are some of the sophisticated developments in the field of computers.

‰

They will be able to take commands in a audio visual way and carry out instructions.

‰

Many of the operations which require low human intelligence will be performed by these computers.

‰

The development of the next generation of computer systems is characterized mainly by the acceptance of parallel processing.

‰

Until this time, parallelism was limited to pipelining and vector processing, or at most to a few processors sharing jobs.

Page 10 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

The fifth generation saw the introduction of machines with hundreds of processors that could all be working on different parts of a single program.

‰

The scale of integration in semiconductors continued at an incredible pace - by 1990, it was possible to build chips with a million components - and semiconductor memories became standard on all computers.

‰

Other new developments were the widespread use of Computer Networks and the increasing use of single-user workstations.

‰

Large scale parallel processing was employed in commercial products.

A typical Computer System We will see a real life situation. In a college, Principal is the person who instructs the others to do their corresponding work. But he will not do all the work by himself. The fig. shows the structure of above. Government or Management

Principal

Teaching& Non – Teaching Staff

Student Fig 1.1: College Management Hierarchy

In the above structure, principal is instructed by the management or government. Without any knowledge of the management or government he does not take any action. Principal has to depend upon the management or government. But principal has to instruct the staff working under him to carryout the administrative activity in a satisfactory manner. The staff members can interact with the students and vice-versa.

Page 11 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology From the above example we know what the work of principal is. Now we will compare this with the computer system. A Computer system may be divided into four major components 1. Hardware( Principal ) 2. Operating System (Management) 3. Application Programs ( Teaching & Non- Teaching Staff ) 4. Users (Students)

User

User

User

1

2

3

Compiler

Assembler

……..…….

Text Editor

User n

Database System

Application Programs

Operating System

Computer Hardware

Fig 1.2: Abstract View of the Components of a Computer System

The computer is an electronic machine with built-in intelligence to execute the instructions. A Computer System is an arrangement of hardware and software. The term hardware generally refers to the electronic circuits in the computer. The main hardware modules are keyboard, CRT monitor, Disk Drive, Printer, and other peripherals. In practice, the term hardware is used for all physical items in a computer including mechanical, electrical and electronic assemblies and components. The Electrical components are Motors, power supplies, Transformers, Relays, Fans, PCBs, Wires, and Cables. The Mechanical components are Switches, Panels, Covers, Chassis, Nuts and Screws. The Electronic components are Resistors, Capacitors, Coils, Diodes, Transistors, ICs, Crystals, LED, Speakers, and CRT. Fig 1.3 Shows Components of a Typical Computer System

Page 12 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Fig 1.3: Components of a Typical Computer System

Any program is software. The software is developed to solve a problem and it controls the hardware when the program is executed. The hardware can be seen visually whereas the software is a logical action plan that is not visually noticeable. Computer Software is classified into two types: Application and System Software. An application program is a program solving users problems. Typical examples are: Payroll program, Inventory control program, tax calculator, class room scheduler, library management software, train reservation software, billing software and game programs. A system program is a program which helps in efficient utilization of the system by other programs and the users. It is generally developed for a given type of computer and it is not concerned with specific application or user. Operating system and compiler are examples of system software.

Page 13 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

M

Secondary Memory

a CPU

Video

Keyboard

Communication

I/O Devices

Network

Monitor

IO

i

expansion

n

Hard Disk

Video

Keyboard

Network

M

Control

Control

Control

Control

slots

e Cache

m o

Bus Interface

r

Unit

y

I/O (local) bus Peripheral I/O Interface control unit

System Bus

Fig 1.4: A Typical Personal Computer System

Another way of looking into a typical personal computer is as shown Fig 1.4. At the core of this computer is a single-chip microprocessor such as the Pentium – Dual Core or AMD. The microprocessor’s internal (micro) architecture usually contains a number of speedup features not found in its earlier version. A system bus connects the microprocessor to a main memory based on semiconductor DRAM technology and to an I/O subsystem. The widely used I/O bus (peripheral bus) used in computers of all sizes, provides a shared data path between the Central Processing Unit (CPU) and peripheral controllers, such as network, display, SCSI and RAID cards.

A separate I/O bus, such as the industry standard PCI Express (Peripheral Component Interconnect Express) ‘local” bus, connects the I/O devices and their controllers. The I/O bus is linked to the system bus via a special bus-to-bus control unit sometimes referred to as a Bridge. The I/O devices of a personal computer include the traditional keyboard, a TFT-based or flat-panel video monitor, USB and disk drive units for the hard and flexible (floppy) disk storage devices that constitute secondary memory. More recent additions to the I/O devices include drive units for DVD (Digital Versatile Disk), which have extremely high capacity and allow sound and video images to be stored and retrieved efficiently. Other common audiovisual I/O devices in personal computers are microphones, loudspeakers, LCD projectors, video scanners, and webcam which are referred to as multimedia equipments.

Page 14 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Computer Types Mainframe: Mainframes are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry/consumer statistics, ERP, financial transaction processing. They require large power and storage capacity.

Desktop: Is a personal computer made for use on a desk in an office or home. Desktop systems are normally set up in a permanent location. Most desktops offer more power, storage and versatility for less cost than their portable counter parts. Desktops are currently the most affordable computers; Nearly all desktop computers are modular, with components that can easily be replaced or upgraded.

Portable: Is a computer that is designed to be moved from one place to another. Also called notebooks/laptops - are portable computers that integrate the display, keyboard, a pointing device or trackball, processor, memory and hard disk drive all in a battery-operated package slightly larger than an average hardcover book.

Workstation: A desktop computer that has a more powerful processor, additional memory and enhanced capabilities for performing a special group of tasks, such as 3D Graphics or game development.

Supercomputer: This type of computer usually costs hundreds of thousands or even millions of dollars. Although some supercomputers are single computer systems, most are comprised of multiple high performance computers working in parallel as a single system. Supercomputers are used for the large-scale numerical calculations required in applications such as weather forecasting and aircraft design and simulation. The best-known supercomputers are built by Cray Supercomputers. What is an Operating System An Operating System is a software program or set of programs that acts as a central control program for the computer. It mediates access between physical devices (such as keyboard, mouse, monitor, disk drive or network connection) and application programs (such as word processor, World-Wide Web browser or electronic mail client).

An operating system (sometimes abbreviated as "OS") is the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer. The other programs are called applications or application programs. The application programs make use of the operating system by making requests for services through a defined Application Program Interface (API).

Page 15 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology A set of routines, protocols, and tools for building software applications, which provides all the building blocks for the programmer to put together. Most operating environments, such as MSWindows, provide an API so that programmers can write applications consistent with the operating environment. Although APIs are designed for programmers, they are ultimately good for users as their similar interfaces make it easier for users to learn new programs.

In addition, users can interact directly with the operating system through a user interface such as a command language or a graphical user interface (GUI). The basic resources of a computer system are provided by its hardware, software and data. The operating system provides the means for the proper use of these resources in the operation of the computer system. It simply provides an environment within which other programs can do useful work. We can view an operating system as a resource allocator. A computer system has many resources (hardware and software) that may be required to solve a problem: CPU time, memory space, files storage space, input/output devices etc.

The operating system acts as the manager of these resources and allocates them to specific programs and users, as necessary for their tasks. An operating system is a control program i.e, it acts as a controller. This program controls the execution of user programs to prevent errors and improper use of the computer. OS Objectives The primary goal of an operating system is convenience for the user. A secondary goal is the efficient operation of a computer system. This goal is particularly important for large, shared multiuser systems. It is known that sometimes these two goals, convenience and efficiency, are contradictory.

Fig 1.5: Operating System Interfaces

Page 16 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

OS Functions A computer’s operating system (OS) is a group of programs designed to serve two basic purposes: ‰

To control the allocation and use of the computing system’s resources among the various users and tasks, and.

‰

To provide an interface between the computer hardware and the programmer that simplifies and makes feasible the creation, coding, debugging, and maintenance of application programs.

An Operating System do the following: ‰

Facilitate creation and modification of program and data files through an editor program,

‰

Provide access to compilers to translate programs from high-level languages to machine language,

‰

Provide a loader program to move the complied program code to the computer’s memory for execution,

‰

Provide routines that handle the intricate details of I/O programming,

‰

Assure that when there are several active processes in the computer, each will get fair and non interfering access to the central processing unit for execution,

‰

Take care of storage and device allocation,

‰

Provide for long term storage of user information in the form of files, and

‰

Permit system resources to be shared among users when appropriate, and be protected from unauthorized or mischievous intervention as necessary.

An operating system performs these services for applications: ‰

In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before giving another application a turn.

‰

It manages the sharing of internal memory among multiple applications.

‰

It handles input and output to and from attached hardware devices, such as hard disks, printers, and dial-up ports.

‰

It sends messages to each application or interactive user (or to a system operator) about the status of operation and any errors that may have occurred.

‰

On computers that can provide parallel processing, an operating system can manage how to divide the program so that it runs on more than one processor at a time.

All major computer platforms (hardware and software) require and sometimes include an operating system. Linux, Windows 2000, VMS, OS/400, AIX, and z/OS are all examples of operating systems.

Page 17 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Evolution of OS ‰

The History of OS is linked with the development of various computer generations.

‰

By tracing that evolution we can identify the common elements of operating systems, and see how, and why they evolved as they are now.

‰

Operating systems and computer architecture have a great deal of influence on each other.

‰

To facilitate the use of the hardware, operating systems were designed, developed and simplified.

Since operating systems have historically been closely tied to the architecture of the computers on which they run. The mapping of operating systems to computer generations is admittedly crude, but it does provide some structure where there would otherwise be none. Because the history of computer operating systems parallels that of computer hardware, it can be generally divided into five distinct time periods, called generations, that are characterized by hardware component technology, software development, and mode of delivery of computer services. The Zeroth Generation ‰

The term Zeroth Generation is used to refer to the period of development of computing, which predated the commercial production and sale of computer equipment.

‰

In particular, this period witnessed the emergence of the first electronic digital computers on the Atanasoff-Berry Computer (ABC), designed by John Atanasoff in 1940; the Mark I, built by Howard Aiken and a group of IBM engineers at Harvard in 1944; and the Electronic Numerical Integrator And Computer (ENIAC), designed and constructed at the University of Pennsylvania by Wallace Eckert and John Mauchly. Perhaps the most significant of these early computers was the Electronic Discrete Variable Automatic Computer(EDVAC), developed in 1944-46 by John von Neumann, Arthur Burks, and Herman Goldstine, since it was the first to fully implement the idea of the stored program and serial execution of instructions.

‰

The development of EDVAC set the stage for the evolution of commercial computing and operating system software. The hardware component technology of this period was electronic vacuum tubes. The actual operation of these early computers took place without be benefit of an operating system. Early programs were written in machine language and each contained code for initiating operation of the computer itself.

The First Generation, 1951-1956 ‰

‰ ‰

The first generation marked the beginning of commercial computing, including the introduction of Eckert and Mauchly’s UNIVersal Automatic Computer I (UNIVAC I) in early 1951, and a bit later, The IBM 701 which was also known as the Defense Calculator. Operation continued without the benefit of an operating system for a time. Application programs were run one at a time, and were translated with absolute computer addresses that bound them to be loaded and run from these pre assigned storage addresses set by the translator, obtaining their data from specific physical I/O device.

Page 18 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

There was no provision for moving a program to a different location in storage for any reason. Similarly, a program bound to specific devices could not be run at all if any of these devices were busy or broken down.

‰

The inefficiencies inherent in the above methods of operation led to the development of the mono programmed operating system, which eliminated some of the human intervention in running a job and provided programmers with a number of desirable functions.

‰

The OS consisted of a permanently resident kernel in main storage, and a job scheduler and a number of utility programs kept in secondary storage.

‰

User application programs were preceded by control or specification cards (in those days, computer program were submitted on data cards) which informed the OS of what system resources (software resources such as compilers and loaders and hardware resources such as tape drives and printer) were needed to run a particular application.

‰

The systems were designed to be operated as batch processing system. These systems continued to operate under the control of a human operator who initiated operation by mounting a magnetic tape that contained the operating system executable code onto a “boot device”, and then pushing the IPL (initial program load) or “boot” button to initiate the bootstrap loading of the operating system.

‰

Once the system was loaded, the operator entered the date and time, and then initiated the operation of the job scheduler program which read and interpreted the control statements, secured the needed resources, executed the first user program, recorded timing and accounting information, and then went back to begin processing of another user program, and so on, as long as there were programs waiting in the input queue to be executed.

‰

At the same time, the development of programming languages was moving away from the basic machine languages; first to assembly language, and later to procedure oriented languages, the most significant being the development of FORTRAN by John W. Backus in 1956.

‰

Several problems remained, however. The most obvious was the inefficient use of system resources, which was most evident when the CPU waited while the relatively slower, mechanical I/O devices were reading or writing program data.

‰

In addition, system protection was a problem because the operating system kernel was not protected from being overwritten by an erroneous application program. Moreover, other user programs in the queue were not protected from destruction by executing programs.

The second Generation, 1956-1964 (Batch Operating Systems): ‰

The second generation of computer hardware was most notably characterized by transistors replacing vacuum tubes as the hardware component technology.

‰

In addition, some very important changes in hardware and software architectures occurred during this period.

‰

For the most part, computer systems remained card and tape-oriented systems. Significant use of random access devices, that is, disks, did not appear until towards the end of the second generation.

‰

Program processing was, for the most part, provided by large centralized computers operated under mono programmed batch processing operating systems.

Page 19 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

The most significant innovations addressed the problem of excessive central processor delay due to waiting for input/output operations.

‰

Recall that programs were executed by processing the machine instructions in a strictly sequential order.

‰

As a result, the CPU, with its high speed electronic component, was often forced to wait for completion of I/O operations which involved mechanical devices (card readers and tape drives) that were order of magnitude slower.

‰

This problem led to the introduction of the data channel, an integral and specialpurpose computer with its own instruction set, registers, and control unit designed to process input/output operations asynchronously from the operation of the computer’s main CPU, near the end of the first generation, and its widespread adoption in the second generation.

‰

The data channel allowed some I/O to be buffered. That is, a program’s input data could be read “ahead” from data cards or tape into a special block of memory called a buffer. Then, when the user’s program came to an input statement, the data could be transferred from the buffer locations at the faster main memory access speed rather than the slower I/O device speed. Similarly, a program’s output could be written in another buffer and later moved from the buffer to the printer, tape, or cardpunch. What made this all work was the data channel’s ability to work asynchronously and concurrently with the main processor. Thus, the slower mechanical I/O could be happening concurrently with main program processing. This process was called I/O overlap.

‰

The data channel was controlled by a channel program set up by the operating system I/O control routines and initiated by a special instruction executed by the CPU. Then, the channel independently processed data to or from the buffer. This provided communication from the CPU to the data channel to initiate an I/O operation.

‰

It remained for the channel to communicate to the CPU such events as data errors and the completion of a transmission. At first, this communication was handled by polling-the CPU stopped its work periodically and polled the channel to determine if there was any massage.

‰

Polling was obviously inefficient (imagine stopping your work periodically to go to the post office to see if an expected letter has arrived) and led to another significant innovation of the second generation - the interrupt. The data, channel was now able to interrupt the CPU with a message- usually “I/O complete.”

‰

In fact, the interrupt idea was later extended from I/O to allow signaling of number of exceptional conditions such as arithmetic overflow, division by zero and time-run-out. Of course, interval clocks were added in conjunction with the latter, and thus operating system came to have a way of regaining control from an exceptionally long or indefinitely looping program.

‰

Towards the end of this period, as random access devices became available, tapeoriented operating systems began to be replaced by disk-oriented systems. With the more sophisticated disk hardware and the operating system supporting a greater portion of the programmer’s work, the computer system that users saw was more and more removed from the actual hardware - users saw a virtual machine.

Page 20 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

The second generation was a period of intense operating system development. Also it was the period for sequential batch processing. But the sequential processing of one job at a time remained a significant limitation. Thus, there continued to be low CPU utilization for I/O bound jobs and low I/O device utilization for CPU bound jobs. This was a major concern, since computers were still very large (room-size) and expensive machines.

‰

Researchers began to experiment with multiprogramming and multiprocessing in their computing services called the time-sharing system. A noteworthy example is the Compatible Time Sharing System (CTSS), developed at MIT during the early 1960s.

The Third Generation, 1964-1979 (Multiprogramming and Time Sharing Systems): ‰

The third generation officially began in April 1964 with IBM’s announcement of its System/360 family of computers.

‰

Hardware technology began to use integrated circuits (ICs), which yielded significant advantages in both speed and economy.

‰

Operating system development continued with the introduction and widespread adoption of multiprogramming.

‰

These systems worked by introducing two new systems programs, a system reader to move input jobs from cards to disk, and a system writer to move job output from disk to printer, tape, or cards. Operation of spooling system was, as before, transparent to the computer user who perceived input as coming directly from the cards and output going directly to the printer.

‰

The idea of taking fuller advantage of the computer’s data channel, I/O capabilities continued to develop. That is, designers recognized that I/O needed only to be initiated by a CPU instruction - the actual I/O data transmission could take place under control of separate and asynchronously operating channel program.

‰

Thus, by switching control of the CPU between the currently executing user program, the system reader program, and the system writer program, it was possible to keep the slower mechanical I/O device running and minimize the amount of time the CPU spent waiting for I/O completion.

‰

The net result was an increase in system throughput and resource utilization, to the benefit of both user and providers of computer services.

‰

This concurrent operation of three programs (more properly, apparent concurrent operation, since systems had only one CPU, and could, therefore executes just one instruction at time) required that additional features and complexity be added to the operating system.

The Fourth Generation, 1980 - 1994(Personal Computers and Workstations): ‰

The fourth generation is characterized by the appearance of the personal computer and the workstation.

‰

Miniaturization of electronic circuits and components continued and large-scale integration (LSI), the component technology of the third generation, was replaced by very large scale integration (VLSI), which characterizes the fourth generation.

‰

VLSI with its capacity for containing thousands of transistors on a small chip, made possible the development of desktop computers with capabilities exceeding those that filled entire rooms and floors of building just twenty years earlier.

Page 21 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

The microprocessor brought the fourth generation of computers, as thousands of integrated circuits were built onto a single silicon chip. What in the first generation filled an entire room could now fit in the palm of the hand. The Intel 4004 chip, developed in 1971, located all the components of the computer – from the central processing unit and memory to input/output controls - on a single chip.

‰

In 1981 IBM introduced its first computer for the home user, and in 1984 Apple introduced the Macintosh. Microprocessors also moved out of the realm of desktop computers and into many areas of life as more and more everyday products began to use microprocessors.

‰

As these small computers became more powerful, they could be linked together to form networks, which eventually led to the development of the Internet. Fourth generation computers also saw the development of GUIs, the mouse and handheld devices.

Fifth Generation - Present and Beyond: Artificial Intelligence ‰

Fifth generation computing devices, based on artificial intelligence, are still in development, though there are some applications, such as voice recognition, that are being used today.

‰

The use of parallel processing and superconductors is helping to make artificial intelligence a reality.

‰

Quantum computation and molecular and nanotechnology will radically change the face of computers in years to come.

‰

The goal of fifth-generation computing is to develop devices that respond to natural language input and are capable of learning and self-organization.

Types of Operating Systems Modern computer operating systems may be classified into three groups, which are distinguished by the nature of interaction that takes place between the computer user and his or her program during its processing. The three groups are called batch, time-shared and real time operating systems.

In a batch processing operating system environment, users submit jobs to a central place where these jobs are collected into a batch, and subsequently placed on an input queue at the computer where they will be run. In this case, the user has no interaction with the job during its processing, and the computer’s response time is the turnaround time-the time from submission of the job until execution is complete, and the results are ready for return to the person who submitted the job.

Another mode for delivering computing services is provided by time sharing operating systems. In this environment a computer provides computing services to several or many users concurrently on-line. Here, the various users are sharing the central processor, the memory, and other resources of the computer system in a manner facilitated, controlled, and monitored by the operating system. The user, in this environment, has nearly full interaction with the program during its execution, and the computer’s response time may be expected to be no more than a few second.

Page 22 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology The third classes of operating systems, real time operating systems, are designed to service those applications where response time is of the essence in order to prevent error, misrepresentation or even disaster. Examples of real time operating systems are those, which handle airlines reservations, machine tool control, and monitoring of a nuclear power station. The systems, in this case, are designed to be interrupted by external signal that require the immediate attention of the computer system.

In fact, many computer operating systems are hybrids, providing for more than one of these types of computing services simultaneously. It is especially common to have a background batch system running in conjunction with one of the other two on the same computer. A number of other definitions are important to gaining an understanding of operating systems:

A multiprogramming operating system is a system that allows more than one active user program (or part of user program) to be stored in main memory simultaneously. Thus, it is evident that a time-sharing system is a multiprogramming system, but note that a multiprogramming system is not necessarily a time-sharing system. A batch or real time operating system could, and indeed usually does, have more than one active user program simultaneously in main storage. Another important, and all too similar, term is ‘multiprocessing’. A multiprocessing system is a computer hardware configuration that includes more than one independent processing unit. The term multiprocessing is generally used to refer to large computer hardware complexes found in major scientific or commercial applications.

A networked computing system is a collection of physically interconnected computers. The operating system of each of the interconnected computers must contain, in addition to its own stand-alone functionality, provisions for handing communication and transfer of program and data among the other computers with which it is connected.

A distributed computing system consists of a number of computers that are connected and managed so that they automatically share the job processing load among the constituent computers, or separate the job load as appropriate particularly configured processors. Such a system requires an operating system, which in addition to the typical stand-alone functionality provides coordination of the operations and information flow among the component computers.

The networked and distributed computing environments and their respective operating systems are designed with more complex functional capabilities. In a network operating system the users are aware of the existence of multiple computers, and can log in to remote machines and copy files from one machine to another. Each machine runs its own local operating system and has its own user (or users).

A distributed operating system, in contrast, is one that appears to its users as a traditional uniprocessor system, even though it is actually composed of multiple processors. In a true distributed system, users should not be aware of where their programs are being run or where their files are located; that should all be handled automatically and efficiently by the operating system.

Page 23 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Network operating systems are not fundamentally different from single processor operating systems. They obviously need a network interface controller and some low-level software to drive it, as well as programs to achieve remote login and remote files access, but these additions do not change the essential structure of the operating systems.

What OSs Are Available Today The list of different types of operating systems and a few examples of Operating Systems that fall into each of the categories. Many computer Operating Systems will fall into more then one of the below categories given below.

GUI - Short for Graphical User Interface, a GUI Operating System contains graphics and icons and is commonly navigated using a computer mouse. Below are some examples of GUI Operating Systems. ‰

System 7.x

‰

Windows 98

‰

Windows CE

Multi-user - A multi-user Operating System allows for multiple users to use the same computer at the same time and/or different times. Below are some examples of multi-user Operating Systems. ‰

Linux

‰

UNIX

‰

Windows 2000

‰

VMS

‰

MVS

Multiprocessing - An Operating System capable of supporting and utilizing more than one computer processor. Below are some examples of multiprocessing Operating Systems. ‰

Linux

‰

UNIX

‰

Windows 2000

Multitasking - An Operating systems that is capable of allowing multiple software processes to be run at the same time. Below are some examples of multitasking Operating Systems. ‰

UNIX

‰

Windows 2000

Multithreading - Operating systems that allow different parts of a software program to run concurrently. Operating systems that would fall into this category are: ‰

Linux

‰

UNIX

‰

Windows 2000

Page 24 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Networking OS: ‰

Windows 2000

‰

Novell Netware

OS Layers An operating system provides the environment within which programs are executed. To construct such an environment, the system is partitioned into small modules with a well-defined interface. The design of a new operating system is a major task. It is very important that the goals of the system be well defined before the design begins. The type of system desired is the foundation for choices between various algorithms and strategies that will be necessary. The important modules for an operating system are listed below. ‰

Process Management

‰

Memory Management

‰

Secondary Storage Management

‰

I/O System

‰

File Management

‰

Protection System

‰

Networking

‰

Command Interpreter System

Obviously, not all systems have the same structure. Summary ‰

Computers have been classified into five generations

‰

The various components of a typical computer system

‰

The Computer types are determined based on size, speed and cost.

‰

The Definition of an OS, Objectives, Functions, Evolution, Types, Layers

‰

A few examples of Operating Systems that fall into each of the categories.

Test your Understanding 1. Which component, if missing, will keep the Personal Computer from not functioning? a. Scanner b. Printer c. Camera d. Processor 2. Today’s fastest computers are called: a. C.P.U. b. Mega computers c. Supercomputers d. Terminals

Page 25 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology 3. What is multitasking and Multiprogramming? 4. Why Operating System is called a resource manager? 5. Which of the following is not an Operating System? a. Linux b. Solaris c. MVS (Multiple Virtual Storage) d. Sun OS

Answer: 1. d 2. c 5. c

Page 26 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Session 2: Introduction to Computer Networking

Learning Objectives After completing this session, you will be able to ‰

Explain computer networks

‰

Describe the need for a computer network

‰

Identify the classification of computer networks

‰

Differentiate network topologies

‰

List network services

Introduction to Computer Networks Networks are changing the way we do business and the way we live. Business decisions have to be made ever more quickly, and the decision makers require immediate access to accurate information. But before we ask how quickly we can get hooked up, we need to know how networks operate, what types of technology are available and which design best fits which set of needs. When a company adds a new division, the technology has to be flexible enough to reflect changing configurations. Is a particular design robust enough to handle the growth? Understanding what it does and when to use each type of technology is essential for providing the right system in today’s dynamically changing information management. Why Networking Computer networking is the scientific and engineering discipline concerned with communication between computer systems. Such communicating computer systems constitute a computer network and these networks generally involve at least two devices capable of being networked with at least one usually being a computer. The devices can be separated by a few meters (e.g. via Bluetooth) or thousands of kilometers (e.g. via the Internet). The public Internet is a world-wide computer network, that is, a network that interconnects millions of computing devices throughout the world. Most of these computing devices are traditional desktop PCs, UNIX based workstations, and so called servers that store and transmit information such as Web (WWW) pages and e-mail messages. Increasingly, non-traditional computing devices such as Web TVs, mobile computers, pagers and toasters are being connected to the Internet. In the internet jargon, all of these devices are called hosts or end systems.

A network is a set of devices (often referred to as nodes) connected by links. A node can be a computer, printer, or any other device capable of sending and/or receiving data generated by other nodes on the network. The links connecting the devices are often called communication channels. A computer network is two or more computers connected together using a telecommunication system for the purpose of communicating and sharing resources.

Page 27 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Network Goals If we connect all PCs in a network, each PC can share information from other PCs. In effect, this signifies what is known as information sharing. A company with many factories may have a computer at each location to keep track of inventories, monitor productivity, and do the local payroll. Initially, each of these computers may have worked in isolation from others. But at some point, management might have decided to connect them to be able to extract and correlate information about the entire company.

In Cognizant HR department, one person looks after the resumes of the employees, another takes care of leaves availed (balance) by the employees, a third person may administer the HR policies. They would all have to take printouts for various purposes. In case, the computers are not connected, each of them would need a separate printer. This would be expensive and probably it would take some time for the company to provide a separate printer to every machine. This would lead to delay in work. This problem can be overcome; if all the machines are connected in a network in which case, there will be only one printer required which can cater to everybody’s needs. This is what is known as Resource Sharing. This is a slightly more general form of information sharing and the goal is to make all programs, data and equipment available to anyone on the network without regard to the physical location of the resource and the user. In other words, the mere fact that a user happens to be 1000 km away from his data should not prevent him from using the data as if they were local. This goal may be summarized by saying that it is an attempt to end the “tyranny of geography”.

The Finance department takes 2-3 days to process the salaries of the employees, as the number of employees is as large as 80-90 thousand. This is mainly because the Finance department uses only one machine to do the entire task of payroll processing as only this machine has the database of employees. If we can make this database available to more machines this would result in faster generation of pay slips. A database, which can be accessed by a number of machines, is called a central database and this aspect of network is called Load Sharing.

Another advantage of network is to provide high reliability by having alternative sources of supply. For example, all files could be replicated on two or three machines, so if one of them is unavailable (due to hardware failure), the other copies could be used. In addition, the presence of multiple CPUs means that if one goes down, the others may be able to take over its work, although at reduced performance. For military, banking, air traffic control, and many other applications, the ability to continue operating in the face of hardware problem is of great importance.

Another advantage of a network is that it is cost effective. Small computers have a much better Price/Performance ratio than large ones. Mainframes are roughly a factor of ten faster than the fastest single chip microprocessor, but they cost a thousand times more.

This imbalance has compelled many systems designers to build systems consisting of powerful personal computers, one per user, with data kept on one or more shared file server machines.

Page 28 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology So, we can list down the benefits of network as: ‰

Information sharing

‰

Resource sharing

‰

Load sharing

‰

High reliability

‰

Cost effective

Components of a Computer Network Many of the components of which an average computer network is composed are individual computers, which are generally either workstations or servers.

Types of Workstations There are many types of workstations that may be incorporated into a particular network, some of which have high-end displays, multiple CPUs, large amounts of RAM, large amounts of hard drive storage space, or other enhancements required for special data processing tasks, graphics, or other resource intensive applications.

Types of Servers The following is a list of some of the more common types of servers and their purpose. ‰

File Server - Stores various types of files and distributes them to other clients on the network.

‰

Print server - Controls and manages one or more printers and accepts print jobs from other network clients, and performing most or all of the other functions that a workstation would perform to accomplish a printing task if the printer were connected directly to the workstation's printer port.

‰

Mail Server - Stores, sends, receives, routes, and performs other email related operations for other clients on the network.

‰

Fax Server - Stores, sends, receives, routes, and performs other functions necessary for the proper transmission, reception, and distribution of faxes.

‰

Telephony Server - Performs telephony related functions such as answering calls automatically, performing the functions of an interactive voice response system, storing and serving voice mail, routing calls between the Public Switched Telephone Network (PSTN) and the network or the Internet (e.g., Voice-over IP (VoIP) gateway), etc.

‰

Proxy Server - Performs some type of function on behalf of other clients on the network to increase the performance of certain operations (e.g., prefetching and caching documents or other data that is requested very frequently) or as a security precaution to isolate network clients from external threats.

‰

Remote Access Server (RAS) - Monitors modem lines or other network communications channels for requests to connect to the network from a remote location, answers the incoming telephone call or acknowledges the network request, and performs the necessary security checks and other procedures necessary to log a user onto the network.

Page 29 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology ‰

Application Server - Performs the data processing or business logic portion of a client application, accepting instructions for what operations to perform from a workstation and serving the results back to the workstation, while the workstation performs the user interface or GUI portion of the processing (i.e., the presentation logic) that is required for the application to work properly.

‰

Web Server - Stores HTML documents, images, text files, scripts, and other Web related data (collectively known as content), and distributes this content to other clients on the network on request.

‰

Backup Server - Has network backup software installed and have large amounts of hard drive storage or other forms of storage (tape, etc.) available to it to be used for the purpose of insuring that data loss does not occur in the network.

Printers Many printers are capable of acting as part of a computer network without any other device, such as a print server, to act as an intermediary between the printer and the device that is requesting a print job to be completed.

Dumb Terminals Many networks use dumb terminals instead of workstations either for data entry and display purposes or in some cases where the application runs entirely on the server. Is a computer terminal that has limited functionality?

Other Devices There are many other types of devices that may be used to build a network, many of which require an understanding of more advanced computer networking concepts before they are able to be easily understood (e.g., hubs, routers, bridges, switches, hardware firewalls, etc.).

A Simple Network A simple computer network may be constructed from two computers by adding a network adapter (Network Interface Controller (NIC)) to each computer and then connecting them together with a special cable called a crossover cable. This type of network is useful for transferring information between two computers that are not normally connected to each other by a permanent network connection or for small home networking applications.

Practical Networks Practical networks generally consist of more than two interconnected computers and generally require special devices in addition to the Network Interface Controller that each computer needs to be equipped with.

Page 30 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Network Types Below is a list of the more common types of computer networks, although there are other types that are not listed.

Local Area Network (LAN) A network that is limited to a relatively small spatial area such as a room, a single building, a ship, or an aircraft. For administrative purposes, large LANs are generally divided into smaller logical segments called workgroups. A workgroup is a group of computers that share a common set of resources within a LAN. Campus Area Network (CAN) A network that connects two or more LANs but that is limited to a specific (possibly private) geographical area such as a college campus, industrial complex, or a military base. Note: A CAN is generally limited to an area that is smaller than a Metropolitan Area Network (MAN).

Metropolitan Area Network (MAN) A network that connects two or more LANs or CANs together, but that does not extend beyond the boundaries of the immediate town, city, or metropolitan area.

Wide Area Network (WAN) A network that covers a broad geographical area (i.e., any network whose communications links cross metropolitan, regional, or national boundaries) or, less formally, a network that uses routers and public communications links.

Types of WANs: ‰

Centralized: A centralized WAN consists of a central computer that is connected to dumb terminals and / or other types of terminal devices.

‰

Distributed: A distributed WAN consists of two or more computers in different locations and may also include connections to dumb terminals and other types of terminal devices.

Internet work Two or more networks or network segments connected using devices that operate at layer 3 (the 'network' layer) of the OSI Basic Reference Model(a layered abstract description for communication and computer network protocol design) , such as a router or layer 3 switch.

Note: Any interconnection among or between public, private, commercial, industrial, or governmental networks may also be defined as an internet work.

Page 31 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Internet: A specific internet work, consisting of a worldwide interconnection of governmental, academic, public, and private networks based upon the Advanced Research Projects Agency Network (ARPANET) developed by ARPA of the U.S. Department of Defense – also known as the World Wide Web (WWW) or the 'Internet' with a capital 'I' to distinguish it from other generic internet works.

Intranet A network or internet work that is limited in scope to a single organization or entity or a network or internet work that is limited in scope to a single organization or entity and which uses one kind network protocol called Transmission Control Protocol/Internet Protocol(TCP/IP) protocol suite, Hyper Text Transfer Protocol (HTTP), File Transfer Protocol (FTP), and other network protocols and software commonly used on the Internet. Note: Intranets may also be categorized as a Local Area Network(LAN), Campus Area Network(CAN), Metropolitan Area Network(MAN), Wide Area Network(WAN), or other type of network.

Extranet A network or internet work that is limited in scope to a single organization or entity but which also has limited connections to the networks of one or more other usually, but not necessarily, trusted organizations or entities (e.g., a company's customers may be provided access to some part of its intranet creating an extranet while at the same time the customers may not be considered 'trusted' from a security standpoint).

Note: Technically, an extranet may also be categorized as a CAN, MAN, WAN, or other type of network, although, by definition, an extranet cannot consist of a single LAN, since an extranet must have at least one connection with an outside network.

It is interesting to note that Intranets and extranets may or may not have connections to the Internet, but if they are connected to the Internet, the intranet or extranet is normally protected from being accessed from the Internet without proper authorization, and the Internet itself is not considered to be a part of the intranet or extranet, although the Internet may serve as a portal for access to portions of an extranet. Classification of computer networks

By network layer Computer networks may be classified according to the network layer at which they operate according to some basic reference models that are considered to be standards in the industry such as the seven layer OSI reference model and the five layer TCP/IP model.

Page 32 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology By scale Computer networks may be classified according to the scale or extent of reach of the network, for example as a Personal area network (PAN), Local Area Network, Wireless local area network (WLAN), Campus area network (CAN), Metropolitan area network (MAN), or Wide area network (WAN).

Note: WLAN is also known as PAN (Personal Area Networking) with wireless connection technologies such as Bluetooth (which has a limited range of approximately 15 meters).

By connection method Computer networks may be classified according to the technology that is used to connect the individual devices in the network such as HomePNA, Power line communication, Ethernet, or WiFi.

By functional relationship Computer networks may be classified according to the functional relationships which exist between the elements of the network, for example Active Networking, Client-server and Peer-to-peer (Workgroup) architectures.

By network topology Computer networks may be classified according to the network topology upon which the network is based, such as Bus network, Star network, Ring network, Mesh network, Star-bus network, Tree topology network, etc. We will study different network topologies in detail.

Bus Network A bus network is a network architecture in which a set of clients are connected via a shared communications line, called a bus. There are several common instances of the bus architecture, including one in the motherboard of most computers, and those in some versions of Ethernet networks.

Bus networks are the simplest way to connect multiple clients, but often have problems when two clients want to transmit at the same time on the same bus. Thus systems which use bus network architectures normally have some scheme of collision handling or collision avoidance for communication on the bus, quite often using Carrier Sense Multiple Access or the presence of a bus master which controls access to the shared bus resource.

A true bus network is passive – the computers on the bus simply listen for a signal; they are not responsible for moving the signal along. However, many active architectures can also be described as a "bus", as they provide the same logical functions as a passive bus; for example, switched Ethernet can still be regarded as a logical bus network, if not a physical one. Indeed, the hardware may be abstracted away completely in the case of a software bus.

Page 33 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology With the dominance of switched Ethernet over passive Ethernet, passive bus networks are uncommon in wired networks. However, almost all current wireless networks can be viewed as examples of passive bus networks, with radio propagation serving as the shared passive medium.

Nodes/Computers

Bus Fig 2.1: Bus Network

Advantages ‰

Easy to implement and extend

‰

Well suited for temporary networks (quick setup)

‰

Initially less expensive than other topologies

Disadvantages ‰

Difficult to administer / troubleshoot.

‰

Limited cable length and number of stations.

‰

If there is a problem with the cable, the entire network goes down.

‰

Maintenance costs may be higher in the long run.

‰

Performance degrades as additional computers are added or on heavy traffic.

‰

Low security (all computers on the bus can see all data transmissions).

‰

One virus in the network will affect all of them (but not as badly as a star or ring network).

‰

Proper termination is required.(loop must be in closed path).

‰

Entire network shuts down if there is a break in the main cable

‰

If many computers are attached, the amount of data flowing causes the network to slow down.

Star network Node

Central Station/hub/Computer

Fig 2.2: Star Network Layout

Page 34 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Star networks are one of the most common computer network topologies. In its simplest form, a star network consists of one central switch, hub or computer which acts as a router to transmit messages. If the central node is passive, the originating node must be able to tolerate the reception of an echo of its own transmission, delayed by the two-way transmission time (i.e. to and from the central node) plus any delay generated in the central node. An active star network has an active central node that usually has the means to prevent echo-related problems. The star topology reduces the chance of network failure by connecting all of the systems to a central node. When applied to a bus-based network, this central hub rebroadcasts all transmissions received from any peripheral node to all peripheral nodes on the network, sometimes including the originating node. All peripheral nodes may thus communicate with all others by transmitting to, and receiving from, the central node only. The failure of a transmission line linking any peripheral node to the central node will result in the isolation of that peripheral node from all others, but the rest of the systems will be unaffected. Strictly speaking only networks that use switches have a true star topology. If the network uses a hub, the network topology has the physical appearance of a star, but is actually a bus.

Advantages ‰

Good performance

‰

Easy to set up and to expand. Any non-centralized failure will have very little effect on the network, whereas on a ring network it would all fail with one fault

Disadvantages ‰

Expensive to install

‰

Extra hardware required

Ring network

Fig 2.3: Ring network layout

A ring network is a topology of computer networks where each node is connected to two other nodes, so as to create a ring. Ring networks tend to be inefficient when compared to Star networks because data must travel through less no. of points before reaching its destination. For example, if a given ring network has eight computers on it, to get from computer one to computer four, data must travel from computer one, through computers two and three, and to its destination at computer four. It could also go from computer one through eight, seven, six, and five until reaching four, but this method is slower because it travels through more computers. Ring networks also

Page 35 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology carry the disadvantage that if one of the nodes in the network breaks down then the entire network will break down with it as it requires a full circle in order to function. The token ring network is a ring topology only at the logical level; it runs on a physical star network, using central devices called MSAUs or MAUs. Advantages ‰

Data is quickly transferred without a ‘bottle neck’. (very fast, all data traffic is in the same direction)

‰

The transmission of data is relatively simple as packets travel in one direction only.

‰

Adding additional nodes has very little impact on bandwidth

‰

It prevents network collisions because of the media access method or architecture required.

Disadvantages ‰

Data packets must pass through every computer between the sender and recipient therefore this makes it slower.

‰

If any of the nodes fail then the ring is broken and data cannot be transmitted successfully.

‰

It is difficult to troubleshoot the ring.

‰

Because all stations are wired together, to add a station you must shut down the network temporarily.

‰

In order for all computers to communicate with each other, all computers must be turned on.

‰

Total dependence upon the one cable.

Mesh networking

Fig 2.4: Mesh network layout Mesh networking is a way to route data, voice and instructions between nodes. It allows for continuous connections and reconfiguration around broken or blocked paths by "hopping" from node to node until the destination is reached. A mesh network whose nodes are all connected to each other is a fully connected network. Mobile ad-hoc networking (MANET), featured in many consumer devices, is a subsection of mesh networking. Mesh networks are self-healing: the network can still operate even when a node breaks down or a connection goes bad. As a result, a very reliable network is formed. This concept is applicable to wireless networks, wired networks, and software interaction.

Page 36 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology A mesh network is a networking technique which allows inexpensive peer network nodes to supply back haul services to other nodes in the same network. It effectively extends a network by sharing access to higher cost network infrastructure.

Mesh networks differ from other networks in that the component parts can all connect to each other via multiple hops, and they generally are not mobile.

An MIT project developing Children's Machines for under-privileged schools in developing nation’s plans to use mesh networking to create a robust and inexpensive infrastructure for the students who will receive the laptops. The instantaneous connections made by the laptops are claimed by the project to reduce the need for an external infrastructure such as the internet to reach all areas, because a connected node could share the connection with nodes nearby. A technology similar to the one used in the Children's Machines is available for use on netgear/x86/Meraki nodes. In Cambridge, UK, on the 3rd June 2006, mesh networking was used at the "Strawberry Fair" to run mobile live television, radio and internet services to an estimated 80,000 people.

Local Area Network (LAN) LAN is a computer network covering a local area, like a home, office or small group of buildings such as a college. A LAN at its simplest consists of two or more computers connected through cables and a Network Operating Software (NOS), which is responsible for all the computers to talk to each other through the cables. The computers can spread across in the same building or the nearby buildings, hence the name “local area” network.

One of the main drawbacks of a LAN is its physical limitation. It is restricted to inside a floor or at the most a building. Another disadvantage is that a particular LAN technology may only work with specific computers. A NIC (Network Interface Card) may not be compatible to all types of LANs. Also, LAN performance determines cost: higher the performance required, higher would be the cost. This is obvious, because the hardware that transmits data faster costs more money.

Metropolitan Area Network (MAN) MANs are large computer networks usually spanning a campus or a city. They typically use wireless infrastructure or optical fiber connections to link their sites. Two or more LANs in the same metropolitan area connected together are called MANs. Using high-speed (1.544 Mbps to 155 Mbps) transmission, MANs connect smaller networks within a campus, a city, and/or neighboring suburbs. For instance, a university or a college may have a MAN that joins together many of their local area networks (LANs) situated around the site of a fraction of a square kilometer. Then from their MAN they could have several Wide Area Network (WAN) links to other universities or the Internet. MAN links between LANs have been built without cables using either microwave, radio, or infra-red free-space optical communication links.

Wide Area Network (WAN) WANs are used to connect Local Area Networks (LANs) together, so that users and computers in one location can communicate with users and computers in other locations. Many WANs are built for one particular organization and are private. Others, built by Internet Service Providers (ISP), provide connections from an organization's LAN to the Internet.Usually, LANs are connected through phone company’s data transmission services. A WAN provides other LAN users in distant Page 37 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology locations with the same information and services that are available to the local LAN users. As Cognizant has several offices across the country and they need to be linked together. Then, we need to connect all the individual LANs of this company in a WAN. If you maintain a central database or other application like shared documents that all personnel should use, you are required to set up a WAN, especially if you want to expand your offices into other cities.

There are several WAN types possible. A very basic WAN can be two computers communicating between each other over a Modem connection. A more complicated one may consist of hundreds of offices connected with high capacity digital circuits. Generally, a WAN takes up a form in between these two extremes.

The main advantage of a WAN is its wide span, geographically. Many incompatible LANs are linked in a WAN, thus making different LANs being able to talk to each other. It recovers the physical limitation of the LAN. It can cater to the common user needs in different widespread locations. Managing the resources becomes more effective. The resources are utilized properly. Actually, the concept of a WAN came into existence for the desirability of a single network and WAN was the foundation of the Internet. This is different from Personal Area Networks (PANs), Metropolitan Area Networks (MANs) or Local Area Networks (LANs) that are usually limited to a room, building or campus. The best example of a WAN is the Internet. Network Services The basic LAN services include sharing of directories and files, printers. LAN technologies also allow access to other common resources like modems and faxes. Most important of them are File Serving, Print Sharing, or Mail Serving. We will have a brief look at these services.

File Services: It is the heart of the LAN. It has applications that the users need and the files that are being used by all or some of the users (i.e., shared). It is generally divided into two distinct parts; one is their own directories or shared directories and other being restricted for administrative purposes, such as the security directories or system files. There can be more than one file server, and is generally the case. The users may or may not have access permission to all of them.

Print Services: These are the servers that have a printer or more than one printer being attached to them. In a LAN environment, a computer prints to a network printer over the LAN cabling. A print server accepts the print jobs in the order they were sent and stores the files. This is known as spooling a job. The print jobs are kept in a place called the Print Queue. The queue is typically located in a file server and is used to stage the print jobs prior to printing. Since a computer can transmit data faster than a printer is capable of putting this information on paper, a staging area is required, in case someone tries to print while the printer is busy printing some other print job. If this case occurs, the second print job will be retained in the print queue until the first print job is completed. The print server provides the processing power required to poll the queue and determines if there is a job pending to be printed. If one is found, the job is sent out of the print server’s LPT port to the printer.

Page 38 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Application Services: An application server is a software that runs on a NOS and provides direct connectivity to a software program. Application servers usually require that a portion of the software be running on both the server and the workstation at the same time. For example, Lotus Notes is a kind of application server. It includes a server portion maintaining the data files and a workstation portion, which is used to access and manipulate information stored in the Lotus Notes server. Message Services: Announce a call or meeting with a quick message to a colleague or coworker’s computer screen and get a quick reply. The messaging facility is also customizable. Each user can define their own group to simplify sending messages to several users. Broadcasting an important message to a select group or everyone is possible.

Database Services: Access to remote data is possible because of Computer Networks. Distributed computer networks consist of computers connected in such a way that any system can potentially communicate with any other system. The platform for distributed systems has been the enterprise network linking workgroups, departments, branches, and divisions of an organization. Data is not located in one server, but in many servers. These servers might be at geographically diverse areas, connected by WAN links. Remote Access to LAN: Another important service in LAN is the remote access of the LAN resources. You can access a LAN (by a modem) from a remote location to share files or even perform administrative tasks. The concept of remote access has long been an integral part of LAN, but with recent advancement of speed of modems and phone company services, such as ISDN, the remote access functionally has largely improved.

Today, a remote user can log into the LAN and perform virtually all types of transactions as if he/she was actually sitting in the office.

Security Features The most important part about a LAN is its security. As all resources are available to everyone in the LAN, careful measures should be taken to secure it. To maintain a secure system, users have to prove their identity at least a couple of times. There are various authentication procedures for a secure LAN.

Username: In this method, the system has a secure list of users already fed in. When a user types in his/her name, the system checks the list names. If the name is already there, the user is given access to the LAN resources. There are many resources, such as security directories, operating system files, employee database, which are very sensitive and needed to be very secured. The username authentication method can also be set for these particular files.

Username and Password: This is even a more secure model than the previous one. In this model, the user is required to enter a username and password combination. Then the same procedure is followed as in the above model.

Peer-to-Peer Network A LAN typically consists of several computers connected to one another, usually located in close proximity such as a computer lab. LANs are the most common form of networks found in most small businesses and schools. A LAN is often created for several computers to share an Page 39 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology intermittently used resource such as a laser printer. In earlier days of networking, most LANs used peer-to-peer networking to facilitate communication. A peer-to-peer network is built without the use of a central server, a computer used as the central storage unit for data. Each peer computer can share its resources with the other computers on the network independently. Today, LANs often include central server computers. Special software protocols, such as Microsoft NetBEUI, and Apple’s Local Talk, are used for establishing communication across a peer-to-peer network. Also known as a P2P network, a peer-to-peer network is a network that does not have a central computer or dedicated server, in other words all computers are independent. This type of network is the type of network you would most likely find in home networks or small networks comprised of a dozen or less computers.

Advantages: ‰

Low cost as expensive software and hardware are not required.

‰

Easy to implement

‰

Resource sharing controlled by users

‰

No need of a dedicated network administrator

Disadvantages: ‰

Low level of security

‰

Heavy load on computers because of increased communication traffic

‰

Resource sharing

‰

Resource sharing controlled by users

‰

Size of network limited to approx. 10

‰

Constant attack by people with a variety of motives.

Client-Server Network In more complex networks client/server networking is usually employed. A centralized computer is used to facilitate the sharing of data and hardware with other computers on the network. These central computers are called file servers. The computers using the file server are called clients. Most client/server networks are the type of networks you would find in a corporate or business environment.

Advantages: ‰

Strong central security

‰

Central file storage

‰

Resource sharing controlled by administrators

‰

Easy management of large number of users

Disadvantages: ‰

High cost of server hardware and software

‰

Need for a dedicated and well trained network administrator

Page 40 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Summary ‰

Computer networking provides communication tools to allow computers to share information and abilities

‰

Networks can be of the following forms: LAN, MAN and WAN

‰

The common network services offered by servers are: o File Services o Print Services o Message Services o Application Services o Database Services

Test your Understanding 1. What are the advantages of computer networks? a. Efficient management of resources b. Reduced costs c. Sharing of applications d. All of the above 2. A tree topology is a variation of ________ topology a. mesh b. star c. bus d. ring

Answers: 1. d 2. c

Page 41 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Session 3: CPU Structure

Learning Objectives After completing this module, you will be able to: ‰

Explain the major components of CPU

‰

Define Registers, ALU and Control Unit

Major Components of CPU A central processing unit (CPU), simply processor, is the component in a digital computer that interprets computer program instructions and processes data. A CPU that is manufactured as a single integrated circuit is usually known as a microprocessor.

The phrase "central processing unit" is a description of a certain class of logic machines that can execute computer programs. The form, design and implementation of CPUs have changed dramatically since the earliest examples, but their fundamental operation has remained same.

Register set

Control

Arithmetic logic Unit (ALU)

Fig 3.1: Major Components of CPU The major components of the CPU are depicted in Fig 3.1, while Table 3.1 describes the purpose of the various special purpose registers

Page 42 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Table 3.1 List of special purpose registers for the basic computer Register symbol

Register name

MDR MAR AC IR PC TEMP INPR OUTR

Memory Data Register Memory Address Register Accumulator Instruction Register Program Counter Temporary Register Input Register Output Register

Function Holds memory operand Holds address for memory Processor register Holds instruction code Holds address of the instruction Holds Temporary data Holds Input data Holds output data

Overview of CPU Behavior Central Processing Unit

CPU bus

PC Address lines

Instruction Decoder

MAR IR

Memory lines Data lines

MDR R0 Y R(n-1)

ALU control lines

Add Sub

AL U

Carry-in

TEMP

XOR

Z

Fig 3.2: Interaction between components of CPU

Fig 3.2 shows the components that are likely to interact in the process of executing an instruction. Depending on the instruction, at any given time, one of the ALU controls, like Add, Sub would be made active.

Page 43 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Instruction Execution Begin

No Are there instructions waiting? Yes Fetch the next instruction

Execute the instruction

No

Yes Are there interrupts waiting?

Transfer to interrupthandling program

Fig 3.3: Behavior Flow of CPU

Fig 3.3 describes the typical flow of the ways by which the CPU behaves. The phases of the instruction execution are as follows. ‰

Fetch the instruction from memory. The contents of the memory location pointed by PC are stored in IR IR

[[PC]]

‰

The instruction is decoded

‰

The content of the PC will be incremented so as to point to the next instruction [PC]

[PC] + x

‰

The operands are fetched from memory.

‰

The specified operation is performed.

‰

The result is stored

Page 44 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Instruction types ‰

Data transfer instructions: Transfers the data from one location to another without changing the contents o o o

‰

Register - Register Register - Memory / Memory –Register Memory - Memory

Data Manipulation instructions: Performs arithmetic, logic and shift operations o o o

Arithmetic instruction: Operates on numeric data Logical instruction: Performs Boolean operations Shift instructions: Shifts to the right or left

‰

Program Control instructions: Changes the sequence of instructions o Branch, Jump instructions: Conditional / Unconditional

‰

I/O instructions: Transfers information between CPU or Memory to and from I/O devices

Fetching a word from Memory ‰

For fetching a word from Memory, CPU transfers address of the required word to MAR

‰

MAR is connected to Address lines of Memory

‰

Address is transferred to Memory

‰

CPU has to specify the type of operation: READ/ WRITE. Here it is a READ operation

‰

CPU waits until Memory unit signals the completion of READ operation

‰

MFC (Memory Function Completed) Signal becomes ACTIVE, as soon as the operation is through.

‰

DATA is then available on Data Lines

‰

The DATA will be loaded into MDR

Example 3.1 describes the various steps involved in the process of fetching a data word pointed to, by register R1.

Example 3.1 R1 -: Address of the Memory location R2 -: Data fetched from Memory Step 1: MAR [R1] Step 2: Read Step 3: Wait for MFC signal (WMFC) Step 4: [R2] [MDR] The duration of step 3 depends on the speed of memory Time for READ from memory is more than the time for performing single operation within the CPU Functions, which do not need MAR, MDR can be carried out during WAIT period e.g. PC can be incremented

Page 45 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Storing Word in Memory Storing Word in Memory ‰

The address of the data to be written is loaded into MAR

‰

The data is loaded into MDR

‰

Write command is issued

‰

Wait for MFC signal

‰

Steps 1 and 2 can be carried out simultaneously for Multiple Bus Structure only

Example 3.2 describes the various steps involved in the process of writing a data word pointed to, by register R1.

Example 3.2 R1: - Memory address of the data R2: - Data to be stored in Memory Step 1 MAR [R1] Step 2 MDR [R2] Step 3 Write Step 4 Wait MFC Register Transfers ‰

To enable data transfer between various blocks connected to BUS, Input &Output gating is required.

‰

Transfer of data from R1 to R4 needs the following action. o o

R1out = 1, Content of R1 will be on Bus R4in = 1, this Loads Data from Bus to R4

Arithmetic Logic Unit ‰

Performs the required micro operations (operations that are executed in a clock tick) for executing the instructions.

‰

Performs arithmetic and logical functions

‰

The function performed by ALU depends on signal applied to ALU control lines

‰

Can be realized with combinational circuits

‰

Does not have internal storage

‰

To add 2 numbers, both the numbers have to be available at the ALU simultaneously

Page 46 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Example 3.3 talks about the micro-steps involved in adding the contents of the registers R1 and R2 and placing the sum in the register R3.

Example 3.3 R1out, Yin R2out, Add Z in Z out, R3in

In example 3.3, ‰

Register Y contains 1 number

‰

The other number is gated onto the BUS

‰

Add-line is set to 1, to specify the add operation

‰

The SUM of the two numbers is stored in the Temporary Register Z

Register Gating ‰

Electronic Switches are connected to gates of the Register

‰

Functions like Mechanical On/Off switches

‰

If the switch is in the ON state, data is transferred from Register to Bus

‰

If the switch is in the OFF state, the register output is electrically disconnected from the Bus

‰

The output of register-switch circuit can be in one of the 3 States - 1, 0, open circuit; this register is also known as “Tristate switch “

‰

The separate control input is used to enable the Gate O/P to drive the bus to 0, 1 or electrically disconnected state (Open circuit)

Timing of Data Transfers ‰

Finite delay is encountered for the gate to open and for the data to travel along the Bus to ALU

‰

Propagation Delay through ALU Adder circuit

‰

For the result to be properly stored in register Z, data must be maintained on the bus for some time (Hold time)

Control Unit ‰

Control unit fetches the instructions from the memory and converts them into a sequence of control signals to implement a sequence of register-transfer operations. Control Unit Design Approaches are: o o

Hardwired Control that leads to RISC (Reduced Instruction Set Computer) architecture Micro programmed Control leading to CISC (Complex Instruction Set Computer) architecture

Page 47 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Hardwired Control ‰

The control logic is implemented with gates, flip-flops, decoders and other digital circuits

‰

It requires changes in the wiring among the various components if the design is to be changed or modified, which is hard in general

‰

The goal is to minimize the number of components used and maximize the speed of operation

‰

It can be optimized to produce a fast mode of operation

Hardwired Control Unit Status Signals

Control Signals Sequential logic circuit

Instruction Register Fig 3.4: Schematic diagram of a Hardwired Control Unit

Fig 3.4 describes the scheme of operation of a Hardwired Control Unit. Based on the status of the CPU and the instruction to be executed, appropriate control signals are made ACTIVE. Micro programmed Control ‰

It is built around a storage unit called control memory, where all the control signals are stored in a program like format

‰

The microprograms are designed to implement or emulate the behaviour of a given instruction set

‰

Each instruction causes the corresponding microprogram to be fetched and its control information extracted in a manner that resembles fetching and execution of a program from the main memory

‰

Control signals are organized into formatted words (micro instructions)

‰

Design changes can be easily implemented just by changing the contents of the control memory

Drawbacks: ‰

Costly due to the presence of the control memory and its access circuitry,

‰

Slower due to the extra time required to fetch micro instructions from the control memory

Page 48 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Fig 3.5 shows the Schematic diagram of a Microprogrammed control unit

Status signals

Address Logic

Control memory

Microinstruction Register Instruction register

Decoder

Control signals

Fig 3.5: Schematic Diagram of a Microprogrammed Control Unit Control Sequence The seven steps that are involved in the execution of an instruction like (R1) (R1) + ((R3)) by a Microprogrammed Control unit is shown below. In each step, more than one microperation can be enabled. Table 3.2 describes the control sequence in the form of their respective microinstructions.

Table 3.2 Control Sequence in the form of their respective microperations Step

Action

1

PCout, MARin, Read, Clear Y, Set carry-in to ALU, Add, Zin

2

Zout, PC in, WMFC

3

MDRout, IRin

4

R3out, MARin, Read

5

R1out, Yin, WMFC

6

MDRout, Add, Zin

7

Zout, R1in, End

Page 49 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

MARin

Read

MDRout

IRin

Yin

Clear Y

Cary-in

Add

Zin

Zout

RIout

RIin

R3out

WMFC

End

1 2 3 4 5 6 7

:

PCout

Microinstruc tion

PCin

Microinstructions

0 1 0 0 0 0 0

1 0 0 0 0 0 0

1 0 0 1 0 0 0

1 0 0 1 0 0 0

0 0 1 0 0 1 0

0 0 1 0 0 0 0

0 0 0 0 1 0 0

1 0 0 0 0 0 0

1 0 0 0 0 0 0

1 0 0 0 0 1 0

1 0 0 0 0 1 0

0 1 0 0 0 0 1

0 0 0 0 1 0 0

0 0 0 0 0 0 1

0 0 0 1 0 0 0

0 1 0 0 1 0 0

0 0 0 0 0 0 1

Intel, AMD This generational and chronological list of Intel microprocessors attempts to present all of Intel's processors (µPs) from the pioneering 4-bit (1971) to the present high-end offerings, the 64-bit Itanium 2 (2002) and Intel Core 2 and Xeon 5100 and 7100 series processors (2006).

The Xeon is Intel's brand name for its server-class PC microprocessors intended for multipleprocessor machines. The brand has been maintained over several generations of processors. Xeon chips generally have more cache and support larger multiprocessor configurations than their desktop counterparts.

Many CPU instructions specify some operation, like add, multiply, or compare, to be carried out on an operand—data the processor often stores in registers (temporary internal holding locations), but may also fetch from cache or main memory. Different types of instructions may vary in length. Current CPUs, like the Pentium 4 and Athlon64, decode variable-length x86 instructions into one or a few simpler, fixed-length internal instructions called micro-ops, which are not accessible outside the CPU.

Although compatible microprocessors must produce identical results for identical instructions, internal designs and operation may be entirely different. For example, the AMD Athlon 64, unlike the Pentium 4, initially decodes an instruction into one or more intermediate macro-ops (complex instructions require several macro-ops), which are ultimately converted into one or more microops. Internal architecture may even differ within CPU families and in succeeding generations of highly compatible processor families, such as the Intel 386, 486, and Pentium. Later generations often add instruction-set enhancements such as MMX (Multimedia Extensions) and SSE (Streaming Single-Instruction, Multiple-Data Extensions) in the case of Intel processors. AMD64, which extended the AMD x86 architecture to enable 64-bit instructions and addressing, is another example.

Page 50 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Summary ‰

The Central Processing Unit (CPU) performs the actual processing of data. The data to be processed is obtained, via the system bus, from the main memory. Results from the CPU are then sent back to main memory via the system bus. In addition to computation, the CPU controls and co-ordinates the operation of the other major components. The CPU has two main components, namely: o

o

The Control Unit -- controls the fetching of instructions from the main memory and the subsequent execution of these instructions. Among other tasks carried out are the control of input and output devices and the passing of data to the Arithmetic/Logical Unit for computation. The Arithmetic/Logical Unit (ALU) -- carries out arithmetic operations on integer (whole number) and real (with an r-nary point, decimal point) operands. It can also perform simple logical tests for EQUALITY(= =),GREATER THAN (>), and less than ( filename

Example $ cat file1 file2 > file3 Saves the contents of file1 and file2 into a new file named file3. The output from the cat command is redirected from the terminal to the file, file3. If file3 already exists then it will be overwritten.

$ cat file2 >> file3 Appends the contents of file2 to file3. The result is file3 contains the contents of file1 followed by the contents of file2.

Standard input and standard output can be redirected in the same command.

$ tr "[:lower:]" "[:upper:]" < file1 > file2 Will change all characters in file1 from lower case to upper case and save the results in the file, file2.

Piping Piping directs the standard output of one UNIX command into the standard input of another UNIX command. Piping is done by separating two commands with a pipe character (|).

cmd1 | cmd2

Example $ ls | more Sends output from the ls command to the more command. This is useful if a directory listing scrolls off the screen.

Page 172 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

UNIX Process Management The Process ID (PID) Every process running on UNIX server has a unique number called the process id abbreviated as PID. When you start a process in the background, the system displays the PID associated with the background process. For example, $ longcmd & [1] 310 The PID associated with longcmd is 310. All processes have a PID. $ ps Will list the status of all processes being executed

Process Context Process context includes the following: ‰

User Level Context : Program text, data and stack (dynamic allocation of variables)

‰

Register Level Context : Value of Program Counter (PC), Contents of the processors registers, Value of the variables

‰

System Level Context : o Static: Process table entry, uarea, Per Process region table; o Dynamic: User Stack which typically contains data such as subroutine parameter, return address, and temporary variables; Kernel stack which typically contains temporary data such as subroutine parameter, return address, and temporary variables of system calls

Process table The O/S maintains information about each process in a process table. Entries in this table are often called process control blocks and must contain information about ‰

process state

‰

memory state

‰

resource state

for each process.

Process state includes the ‰

value of each register

‰

program counter

‰

stack pointer

‰

state of the process (runnning, runnable, blocked)

‰

process ID of itself, its parent, etc.

‰

elapsed time.

‰

pending signals that have not yet been dealt with (eg they arrived while the process was asleep).

Page 173 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Memory state Pointers to the various memory areas used by the program need to be kept, so that they can be relocated back as needed.

Resource state The process will generally have files open in particular directory, have a certain user ID, etc. The information about these will need to be stored also.

In UNIX each process has a file table. The first entry in this (file descriptor zero) is for the processes' standard input, the second entry is for standard output, the third for standard error. Additional entries are made when the process opens more files.

Fig. 9.3: Process Implementation Scheme

Figure 9.3 depicts a simple process implementation scheme. There are two processes, A and B, each with its own instructions, data and context, stored in main memory. The OS maintains, also in memory, a list of pointers to the above processes, and perhaps some additional information for each of them.

The content of a ``current process'' location identifies which process is currently being executed. The processor registers then contain data relevant to that particular process. Among them are the base and top addresses of the area in memory reserved to the process: an error condition would be trapped if the program being executed tried to write in a memory word whose address is outside those bounds.

Page 174 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Process States and Transitions When a system boots UNIX, it creates a single process called ``init''. This init acts as the root of the process tree. The init forks a set of copies of itself, one for each terminal line that is connected to it. Each one of these, type the login message and then blocks waiting for terminal input.

When the user name and password are typed, init checks that the user is valid, and if so changes to the user's home directory, resets the user ID of the process to the user, and ``exec''s a shell. At this point the init for that terminal line has been replaced by the login shell for that user. The user does whatever they want to do, and eventually logs out.

Logging out terminates the login shell. In the meantime, the init at the top of the process tree has done a wait, waiting on any of its children. The login shell is in fact a direct child of this top level init because it came from exec-ing a child. So when the shell terminates, the top level init wakes up.

The top level init then forks a new init for that terminal line and starts a wait again, for another child to terminate.

When a process is created, it goes through a series of states as depicted in Figure 9.3. The following list contains the complete set of process states. 1. The process is executing in user mode. 2. The process is executing in kernel mode. 3. The process is ready to run as soon as the kernel schedules it. 4. The process is sleeping and resides in main memory. 5. The process is ready to run, but the swapper (process 0) must swap the process into main memory before the kernel can schedule it to execute. 6. The process is sleeping, and the swapper has swapped the process to secondary storage to make room for other processes in main memory. 7. The process is returning from the kernel to user mode, but the kernel preempts it and does a context switch to schedule another process. 8. The process is newly created and is in a transition state; the process exists; but it is not ready to run, nor is it sleeping. This state is the start state for all process. 9. The process executed the exit system call and is in the zombie state. The process no longer exists; but it leaves a record containing an exit code. The zombie state is the final state of a process.

First, the process gets created with the fork () system call and it enters the bubble diagram at bubble number 8. Then the process enters state 3 or 5 depending on whether there is enough memory or not. Let’s say there is enough memory and it is in state 3. That state is the ready to run in memory, where the process is waiting in line to get its time quantum for the CPU. When the scheduler chooses it based on its scheduling algorithm, the process enters the kernel running state where it finishes its part of the fork () system call.

Page 175 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Fig. 9.4: Process State Transition Diagram

After that, the process can go into the user mode until its time quantum is up. At that time, the scheduler will pick another process to run, and the previous process goes back to the end of the line to wait its turn again. That state is the Preempted state. The preempted state is the same as the ready to run state.

The dotted line shows their equivalence. Eventually the process will get back into the user mode again for another time quantum. But let's say, it makes a system call and it goes back to kernel running again. Let’s also say that system call requires the service of some I/O from the disk, but that resource is not available now. Then that process goes to state 4, asleep in memory.

When the I/O becomes available, the interrupt handler awakens the process, and the process enters the ready to run stage again to go back to the CPU. If there is a shortage of memory, then the process gets swapped into the swap space on the hard disk, where the next most suitable process gets to go on memory to get some CPU time. After the process finishes in user mode, it goes back to the kernel mode, and then it exits to stage 9.

Stopping processes There are two ways in which processes can stop: voluntarily stop, or be forced to stop.

Page 176 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Foreground and Background Processes Normally when you enter a command at the UNIX prompt, the next prompt does not appear until the command is finished running. This is called running the command in the foreground and the process associated with the command is called a foreground process. You can also start a command in the background creating a background process. When a command is executed in the background, the UNIX prompt returns immediately. You can continue to work at the UNIX prompt while the command runs. To run a command in the background, append a space and ampersand (&) at the end of the command. UNIX CPU Scheduling Short term scheduling in UNIX is designed to benefit interactive jobs. Processes are given small CPU time slices by an algorithm that reduces to round robin for CPU-bound jobs, although there is a priority scheme. There's no preemption of one process by another when running in kernel mode. A process may relinquish the CPU because it's waiting for I/O (including I/O due to page faults) or because its time slice has expired.

Every process has a scheduling priority associated with it; the lower the numerical priority, the more likely is the process to run. System processes doing disk I/O and other important tasks have negative priorities and cannot be interrupted. Ordinary user processes have positive priorities and thus are less likely to be run than any system process, although user processes may have precedence over one another. The “nice” command may be used to affect this precedence according to its numerical priority argument.

The more CPU time a process accumulates, the lower (more positive) its priority becomes. The reverse is also true (process aging is employed to prevent starvation). Thus there is negative feedback in CPU scheduling, and its difficult for a single process to take CPU all time.

Old UNIX systems used a 1 sec. quantum for the round-robin scheduling algorithm. Later 4.2BSD did rescheduling every 0.1 seconds, and priority re-computation every second. The round-robin scheduling is accomplished by the timeout mechanism, which tells the clock interrupt driver to call a certain system routine after a specified interval. The subroutine to be called in this case causes the rescheduling and then resubmits a timeout to call itself again 0.1 sec later. The priority recomputation is also timed by a subroutine that resubmits a timeout for itself.

When a process chooses to relinquish the CPU (voluntarily, in a user program, or because this decision is to be made in the kernel context for a process executing that program) it sleep on an even. The system call used for this is called sleep (not to be confused with the C library routine with the same name, sleep(3)). It takes an argument that is by convention the address of a kernel data structure related to an event the process wants to occur before it is awakened. When the event occurs, the system process that knows about it calls wakeup with the address corresponding to the event, and all processes that had done a sleep on the same address are put in the ready queue.

Page 177 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology For example, a process waiting for disk I/O to complete will sleep on the address of the buffer corresponding to the data being transferred. When the interrupt routine for the disk driver notes that the transfer is complete, it calls wakeup on that buffer, causing all processes waiting for that buffer to be awakened. Which process among those actually does run is chosen by the scheduler effectively at random. Sleep, however, also takes a second argument, which is the scheduling priority to be used for this purpose. UNIX Memory Management UNIX, like other advanced operating systems, allows you to use all of the physical memory installed in your system as well as area(s) of the disk (called swap space) which have been designated for use by the kernel in case the physical memory is insufficient for the tasks at hand. Virtual memory is simply the sum of the physical memory (RAM) and the total swap space assigned by the system administrator at the system installation time. Mathematically, Virtual Memory (VM) = Physical RAM + Swap space The UNIX kernel divides the memory into manageable chunks called pages. A single page of memory is usually 4096 or 8192 bytes (4 or 8KB). Memory pages are laid down contiguously across the physical and virtual memory. The System and User Areas When the kernel loads, it uses RAM to keep itself memory resident. Consequently, it has to ensure that user programs do not overwrite/corrupt the kernel data structures (or overwrite/corrupt other users' data structures). It does so by designating part of RAM as kernel or system pages (which hold kernel text and data segments) and user pages (which hold user stacks, data, and text segments). Strong memory protection is implemented in the kernel memory management code to keep the users from corrupting the system area. For example, only the kernel is allowed to switch from the user to the system area. During the normal execution of a UNIX process, both system and user areas are used. A common system call when memory protection is violated is SIGSEGV (you see a "Segmentation violation" message on the screen when this happens. The culprit process is killed and its inmemory portions dumped to a disk file called "core"). Memory Management Schemes: ‰

Swapping: Processes requested from different users are allocated space in memory. When RAM is not sufficient to hold all processes, the swapper process swaps out sleeping processes onto the swap device. When the processes move to Ready to Run state, they are swapped back to RAM. The transfer between RAM and swap space is the whole process. The disadvantages of such a scheme are many processes cannot co-exist at the same time in main memory and processes of sizes greater than RAM cannot be executed.

‰

Demand Paging: When a process starts in UNIX, not all its memory pages are read in from the disk at once. Instead, the kernel loads into RAM only a few pages at a time. After the CPU digests these, the next page is requested. If it is not found in RAM, a page fault occurs, signalling the kernel to load the next few pages from disk into RAM. This is called demand paging.

Page 178 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology UNIX File System The file system usually refers to the entity which contains all the data for the workstation or server: system data, user data and all binary executable programs runnable on the machine. The word "file system" under UNIX can mean different things. It can refer to the hierarchical UNIX directory tree structure or the virtual file system or the physical file system, depending on the context:

Virtual file system or the UNIX directory tree The hierarchical representation of files and directories of files, with which a user or administrator may perform various functions: e.g. editing, viewing, executing, etc. This is the UNIX interface to the physical file system. Many UNIX resources (including hardware) are available via the virtual file system.

The root of the filesystem and the UNIX directory tree The top level directory under UNIX (denoted by a forward slash - /) is referred to as the root of the UNIX (virtual) filesystem. Under the root directory are a number of directories and files.

One of the unique things about UNIX as an operating system is that regards everything as a file. Files can be divided into the following categories : ‰

Ordinary files: Ordinary files can contain text, data, or program information. An ordinary file cannot contain another file, or directory. An ordinary file can be thought of as a one-dimensional array of bytes.

‰

Directories: Directories are containers that can hold files, and other directories. A directory is actually implemented as a file that has one line for each item contained within the directory. Each line in a directory file contains only the name of the item, and a numerical reference to the location of the item. The reference is called an i-number or inode, and is an index to a table known as the i-list. The i-list is a complete list of all the storage space available to the file system.

‰

Special files: Special files represent input/output devices, like a tty (terminal), a disk drive, or a printer. Special files can be either character special files that deal with streams of characters or block special files that operate on larger blocks of data. Typical block sizes are 512 bytes, 1024 bytes, and 2048 bytes.

‰

Links: A link is a pointer to another file. A directory is nothing more than a list of the names and inodes of files. There are two types: o

o

Hard links are not really files. They exist when more than one directory entry references the same inode. Hence, when a hard link is opened by a user program, the directory entry that is opened points directly to the inode of the data to be provided. And, when a hard link is deleted using rm, the directory entry is removed. Only when one deletes the last remaining directory entry that points to an inode are the data deleted. Soft Link is implemented as a directory file entry containing a pathname. The information in the file is the name of the file being referenced. When a user program attempts to read a file that is a soft link, the file system opens the symbolic link file, reads the reference, and then opens the file that is referenced. File management programs operate on the symbolic link file. For example, ls -l reads the symbolic link file and displays the name of the file being referenced, and

Page 179 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology rm deletes the symbolic link file, leaving untouched the file that is referenced by the link. Soft links are distinguishable from files, and can span across file systems.

Physical file system The collection of data represented by the virtual file system. The physical file system may be arranged on one or more actual storage devices, typically hard disks.

Fig. 9.5: Components of a File System

Every file system is organized in a sequence of blocks of 1024 bytes and generally has four components namely, ‰

Boot Block: Is the Master Boot Record (MBR) that contains a small boot program and the partition table. When the system is booted, the system BIOS checks for the existence of the first hard disk and loads the entire segment of the boot block into memory. It then hands over control to the bootstrapping program. This in turn loads the kernel into memory. However, the bootstrapping program is read in from the boot block of the root file system. For other file system, this block is simply kept blank.

‰

Super Block: contains global file information about disk usage and availability of data blocks and inodes. It contains o o o o o o

‰

Size of the file system Length of the file system’s logical block Last time of updating in-memory to disk Number of free data block available and a partial list of immediately allocable free data blocks. Number of inodes available and a partial list of immediately usable inodes. The state of the file system

Inode Block: Every file has an inode – a 128-byte table. All inodes are stored in a contiguous area called inode block in a user inaccessible area of the file system. The file’s inode is used as an index into this inode block. Each inode contains the following attributes of a file: o o o o o o o o o

File type (regular, directory, device, etc.) Number of links (the number of aliases the file has) User-id (owner of the file) Group-id of the owner File modes of user, group and others (three permissions) Size of the file (bytes) Date and time of last modification of file data Date and time of last access of file data Date and time of last change of the inode.

Page 180 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology o ‰

An array of 15 pointers to the file. (addresses where the contents of the file are stored )

Data Blocks: The smallest block that can be read and written by the disk controller is 512 bytes. It’s often called as a physical block. The kernel reads and writes data using a different block size, and this block is often referred to as a logical block. The data blocks commence from the point the Inode blocks terminate. Every block is identified by an address – a number that refers to the position of the block in the data block area. The blocks containing data are known as direct block. The blocks of a file are mostly not contiguous. When a file expands, the kernel may not find the adjacent block free. It has to locate a free one from the blocks scattered randomly throughout the disk. This slow down read/write operations and lead to disk fragmentation. The inode keeps track of all direct block addresses (12) and some indirect blocks. The indirect blocks do not contain data but only the addresses of those direct blocks which couldn’t be a accommodated in the inode.

UNIX I/O Subsystem Special files are also known as device files. In UNIX all physical devices are accessed via device files; they are what programs use to communicate with hardware. Device files contain information on location, type, and access mode for a specific device. When a device file is opened, the kernel uses the information in it to determine which physical device to access and how to access it.

There are two types of device files; character and block, as well as two modes of access. Block device files are used to access block device I/O. Block devices do buffered I/O, meaning that the the data is collected in a buffer until a full block can be transferred. Character device files are associated with character or raw device access. They are used for unbuffered data transfers to and from a device. Rather than transferring data in blocks the data is transferred character by character. One transfer can consist of multiple characters.

Fig. 9.6: Relationship between inode and data blocks

Page 181 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Some devices, such as disk partitions, may be accessed in block or character mode. Because each device file corresponds to a single access mode, physical devices that have more than one access mode will have more than one device file.

Device files are found in the /dev directory. Each device is assigned a major and minor device number. The major device number identifies the type of device, i.e. all SCSI devices would have the same number as would all the keyboards. The minor device number identifies a specific device, i.e. the keyboard attached to this workstation.

Device files are created using the mknod command. The form for this command is:

mknod device-name type major minor Where: ‰

device-name is the name of the device file

‰

type is either "c" for character or "b" for block

‰

major is the major device number

‰

minor is the minor device number

UNIX IPC

Introduction to Inter Process Communication Processes do not run in isolation from each other. Generally they need to communicate with each other.

Examples ‰

Any two processes in a pipeline are communicating. One sends a stream of bytes to the other.

‰

Access to the lineprinter is controlled by a single process called ``lpd'' (the lineprinter daemon). Each time a user runs ``lpr'' this has to communicate with ``lpd'' and send it the file to print.

‰

Your home directories are stored on the machine ``willow''. Each time you access a file the O/S has to make a connection to willow, request the file from a suitable process on willow and accept responses from it.

Files and shared memory suffer from various concurrent processing problems. For example, if one process is putting information into a file, how does the other process know that the first process is done and it can go ahead and read the file or how does a process know when another process has read the message in a file and it is safe to delete it. Pipes and named pipes get away from these problems.

Page 182 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Shared memory If two processes share the same piece of memory then they can use this to communicate. For example, one may write information in this shared area and the other may read it.

This can be a very fast method of information transfer because RAM can be used. Synchronisation is a major problem - if the first process keeps writing data, how can it ensure that the second one reads it?

Pipe A pipe acts like a channel between two processes. When one process writes into the pipe the other process can read from it. A pipe can usually buffer information so that the writer can place a lot of information in the pipe before the child has to read it. When the pipe becomes full the writer has to suspend.

Pipes can be un-named. This is the norm in UNIX where a process creates a pipe and then forks, so that the two processes share the pipe between them.

If the processes do not come from a common ancestor then they can only share a pipe if they can both name it (otherwise they could not find it). Named pipes usually appear as though they were files in the file system. Streams Pipes carry unstructured data - you put bytes in one end and get the same bytes out the other. Streams are designed to carry record information - you put records in at one end and get the same records out the other. Each record must contain a field saying how large it is.

Message Queues A message queue is like a pipe, and is used to transfer messages between processes in a UNIX system. Unlike a pipe, it retains message boundaries and hence is a much more reliable way for many processes to use the same IPC. This is often the case if a server process is receiving service requests from many different processes. Remember that a named pipe is used for a stream of bytes, so there are no boundaries.

Semaphores A semaphore provides a synchronizing mechanism for processes that are accessing the same resource. No data is passed with a semaphore-it simply coordinates access to shared resources.

Sockets Sockets are more like ports that you can send data to. A process will be ``listening'' at a port and will accept data sent to it.

Page 183 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology Signals Signals are a fairly crude method if IPC. A process may send a signal to another such as ``wake up'' or ``die''. The other process can respond to these signals in various ways. Network Support in UNIX One of the biggest reasons for using UNIX is networking capability. With other operating systems, additional software must be purchased for networking. With UNIX, networking capability is simply part of the operating system. UNIX is ideal for such things as world wide e-mail and connecting to the Internet. In 1984, the University of California at Berkeley released version 4.2BSD which included a complete implementation of the TCP/IP networking protocols. Systems based on this and later BSD releases provided a multi-vendor networking capability based on Ethernet networking. The networking support included, remote login, file transfer, electronic mail, and other important features. As UNIX was ported onto more and more different types of computer hardware the UNIX networking allowed many different types of systems to share and mutually use data. Networks consisting of many different systems could be used as a large distributed system. When SUN Microsystems added NFS (Network File System), this ability to share and mutually use data was significantly enhanced.

UNIX was founded on what could be called a "small is good" philosophy. The idea is that each program is designed to do one job well. Because UNIX was developed by different people with different needs it has grown to an operating system that is both flexible and easy to adapt for specific needs.

UNIX was written in a machine independent language. So UNIX and UNIX-like operating systems can run on a variety of hardware. These systems are available from many different sources, some of them at no cost. Because of this diversity and the ability to utilize the same "user-interface" on many different systems, UNIX is said to be an open system.

A socket is an endpoint of communication between processes. It is a software entity that provides the basic building block for interprocess communications.

SCO TCP/IP supports sockets in the Internet and UNIX domains. A socket has a type and one or more associated processes. Three types of sockets are available to the programmer: ‰

stream socket

‰

datagram socket

‰

raw socket

The TCP/IP protocol and UNIX forms the basis for the Internet.

Page 184 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Session 11: Case Study – WINDOWS XP Learning Objectives After completing this chapter, you will be able to: ‰

Classify Windows XP

Windows XP Introduction: Microsoft designed Windows XP to be an extensible, portable operating system. Windows XP supports multiples operating environments and symmetric multiprocessing, including both 32 bit and 64 bit processors, and NUMA computers. The use of kernel objects to provide basic services, and support for client – server computing. It can run programs compiled for MSDOS, Win 16, Windows 95, Windows 2000, and/or POSIX. It provides virtual memory, integrated caching, and preemptive scheduling. It also supports a security model stronger than those of previous Microsoft operating systems, and includes internationalization

Fig 9.7: Windows XP Architecture Page 185 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

History In 1988, Microsoft decided to develop a “new technology” (NT) portable operating system that supported both the OS/2 and POSIX APIs. Originally, NT was supposed to use the OS/2 API as its native environment but during development NT was changed to use the Win32 API, reflecting the popularity of Windows 3.0 Design Principles ‰

Extensibility o It is a layered architecture. Executive, which runs in protected mode, provides the basic system services. On top of the executive, several server subsystems operate in user mode.

‰

Portability o

‰

Windows XP can be moved from on hardware architecture to another with relatively few changes (a) Written in C and C++ (b) Processor-dependent code is isolated in a dynamic link library (DLL) called the “hardware abstraction layer” (HAL).

Reliability o

XP uses hardware protection for virtual memory, and software protection mechanisms for operating system resources.

‰

Compatibility o Applications that follow the IEEE 1003.1 (POSIX) standard can be complied to run on XP without changing the source code

‰

Performance o

‰

The subsystems can communicate with one another via high-performance message passing. Preemption of low priority threads enables the system to respond quickly to external events and also designed for symmetrical multiprocessing.

International supports different locales via the national language support (NLS) API

System Components — Kernel ‰

Foundation for the executive and the subsystems

‰

Never paged out of memory; execution is never preempted

‰

There are four main responsibilities: o thread scheduling o interrupt and exception handling o low-level processor synchronization o recovery after a power failure

Kernel — Process and Threads ‰

Threads are the unit of execution scheduled by the kernel’s dispatcher

‰

Each thread has its own state, including a priority, processor affinity, and accounting information

Page 186 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Kernel — Scheduling ‰

The dispatcher uses a 32-level priority scheme to determine the order of thread execution. Those priorities are divided into two classes o o

‰

The real-time class contains threads with priorities ranging from 16 to 31 The variable class contains threads having priorities from 0 to 15

Characteristics of XP’s priority strategy o o o

Trends to give very good response times to interactive threads that are using the mouse and windows Enables I/O-bound threads to keep the I/O devices busy Complete-bound threads soak up the spare CPU cycles in the background

‰

Scheduling can occur when a thread enters the ready or wait state, when a thread terminates, or when an application changes

‰

Real-time threads are given preferential access to the CPU; but XP does not guarantee that a real-time thread will start to execute within any particular time limit is called soft realtime

Executive — Object Manager ‰

XP uses objects for all its services and entities; the object manger supervises the use of all the objects o o o

‰

Generates an object handle Checks security Keeps track of which processes are using each object

Objects are manipulated by a standard set of methods, namely create, open, close, delete, query name, parse and security

Executive — Virtual Memory Manager ‰

The design of the VM manager supports virtual to physical mapping; a paging mechanism, transparent cache coherence on multiprocessor systems, and virtual address aliasing

‰

The VM manager in XP uses a page-based management scheme with a page size of 4 KB

‰

The XP VM manager uses a two step process to allocate memory o o

The first step reserves a portion of the process’s address space The second step commits the allocation by assigning space in the 2000 paging file

Page 187 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Executive — Process Manager ‰

Provides services for creating, deleting, and using threads and processes.

‰

Issues such as parent/child relationships or process hierarchies are left to the particular environmental subsystem that owns the process.

Executive — Local Procedure Call (LPC) Facility ‰

The LPC passes requests and results between client and server processes within a single machine.

‰

In particular, it is used to request services from the various XP subsystems.

‰

When a LPC channel is created, one of three types of message passing techniques must be specified. 1. suitable for small messages, up to 256 bytes; port's message queue is used as intermediate storage, and the messages are copied from one process to the other. 2. avoids copying large messages by pointing to a shared memory section object created for the channel. 3. Called quick LPC was used by graphical display portions of the Win32 subsystem.

Executive — I/O Manager ‰

The I/O manager is responsible for o o o o

file systems cache management device drivers network drivers

‰

Keeps track of which installable file systems are loaded, and manages buffers for I/O requests

‰

Works with VM Manager to provide memory-mapped file I/O

‰

Controls the XP cache manager, which handles caching for the entire I/O system

‰

Supports both synchronous and asynchronous operations.

Executive — Security Reference Monitor ‰

The object-oriented nature of XP enables the use of a uniform mechanism to perform runtime access validation and audit checks for every entity in the system

‰

Whenever a process opens a handle to an object, the security reference monitor checks the process’s security token and the object’s access control list to see whether the process has the necessary rights

Page 188 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

File System ‰

The fundamental structure of the XP file system (NTFS) is a volume o Created by the XP disk administrator utility o Based on a logical disk partition o May occupy a portions of a disk, an entire disk, or span across several disks

‰

All metadata, such as information about the volume, is stored in a regular file

‰

NTFS uses clusters as the underlying unit of disk allocation o o

A cluster is a number of disk sectors that is a power of two Because the cluster size is smaller than for the 16-bit FAT file system, the amount of internal fragmentation is reduced

File System — Security ‰

Security of an NTFS volume is derived from the XP object model

‰

Each file object has a security descriptor attribute stored in this MFT record

‰

This attribute contains the access token of the owner of the file, and an access control list that states the access privileges that are granted to each user that has access to the file

Networking XP supports both peer-to-peer and client/server networking; it also has facilities for network management. To describe networking in XP, we refer to two of the internal networking interfaces: ‰

NDIS (Network Device Interface Specification) — Separates network adapters from the transport protocols so that either can be changed without affecting the other

‰

TDI (Transport Driver Interface) — Enables any session layer component to use any available transport mechanism

XP implements transport protocols as drivers that can be loaded and unloaded from the system dynamically. The server message block (SMB) protocol is used to send I/O requests over the network. It has four message types: ‰

Session control

‰

File

‰

Printer

‰

Message

The network basic Input/Output system (NetBIOS) is a hardware abstraction interface for networks. NetBEUI (NetBIOS Extended User Interface): default protocol for Windows 95 peer networking and Windows for Workgroups; used when XP wants to share resources with these networks.

Page 189 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

Summary The early advantages of UNIX were that this system was written "in a high-level language, was distributed in source form. Files are supported by the kernel as unstructured sequences of bytes. Direct access and sequential access are supported through system calls and library routines. The data blocks are found by pointers in the inode. Directory entries point to inodes. UNIX is a multiprogrammed system. Processes can easily create new processes with the fork system call. Processes can communicate with pipes or, more generally, sockets. Processes are represented by two structures: the process structure and the user structure. Networking support is one of the most important features. The socket concept provides the programming mechanism to access other processes. Test Your Understanding 1. What is the relation between process system time, process waiting time, and process CPU time? 2. What is the difference between UNIX and windows? 3. What is the difference between process and thread ? 4. Different types of Real-Time Scheduling? 5. Difference between Primary storage and secondary storage?

Answers: 1. Process system time (turn around time) = process cpu time + process waiting time 2. UNIX is multi user multi tasking, while windows is single user multi tasking 3. Process is some job or task which is running in background. while a thread is a single line of execution in a programs , so many threads can be there in a program. 4. Hard real-time systems: Required to complete a critical task within a guaranteed amount of time. Soft real-time computing: Requires that critical processes receive priority over less fortunate ones. 5. Main memory: Only large storage media that the CPU can access directly. Secondary storage: Extension of main memory that provides large nonvolatile storage capacity.

Page 190 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

References

Websites ‰

http://www.ece.eps.hw.ac.uk/Modules/B35dq1/slides/Performance/sld001.htm

‰

http://www.it.kmitl.ac.th/Publish/ComputerOrganization&Architecture/com.htm

‰

http://users.cs.cf.ac.uk/David.W.Walker/CM0323/

‰

http://www.mcs.anl.gov/mpi/

‰

For information on the World`s fastest supercomputers : http://www.top500.org

‰

www.sei.cmu.edu/str/descriptions/clientserver_body.html

‰

en.wikipedia.org/wiki/Client-server

‰

www.microsoft.com/windowsserver2003/technologies/storage/default.mspx

‰

computing-dictionary.thefreedictionary.com/compute+server

‰

https://computeserver.dev.java.net/

‰

www.rollyo.com/explore.html?rollterm=j

‰

simple.wikipedia.org/wiki/Wikipedia:Privacy_policy

‰

www.rollyo.com/explore.html?rollterm=j

‰

www.answers.com/topic/firebird-database-server

‰

www.rollyo.com/explore.html?rollterm=j –

‰

B Govindarajalu, “Computer Architecture and Organization, Design Principles and Applications”

‰

John P Hayes, “ Computer Architecture and Organization “

‰

Jane Holcombe Charles Holcombe, “Survey of Operating Systems”

‰

Computer Networks – A Systems Approach, Larry L.Patterson and Bruce S.Davie

‰

William Stallings, “Operating Systems: Internals and Design Principles” Prentice Hall, 2001

‰

M. Morris Mano, “Computer System Architecture”

‰

“Data Communications and Networking”, Behrouz A. Forouzan

‰

Carl Hamacher, Zvonko Vranesic, Safwat Zaky ,”Computer Organization” McGrawHill International Edition, 2002.

Books

Page 191 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

Handout - Fundamentals of Computer Technology

STUDENT NOTES:

Page 192 ©Copyright 2007, Cognizant Technology Solutions, All Rights Reserved C3: Protected

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF