fcpc notes

Embed Size (px)

Citation preview

  • 8/19/2019 fcpc notes

    1/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Lecture: 1

    An Overview of Computer System and Operating Systems: Fundamentals. 

    Contents

    1.  Introduction to Computer System

    2.  Functions of Computer System

    3.  Introduction to Operating System

    4.  Functions of Operating System

    5.  Types of Operating System

    1. 

    Introduction

    We should keep in mind that a computer is a programmable machine. The twomain characteristics of a computer are: (i) it responds to a specific set ofinstructions in a well-defined manner. (ii) It can execute a pre-recorded list ofinstructions (a program). Modern computers are electronic and digital. The actualmachinery - wires, transistors and circuits is called hardware; the instructions anddata are called software.

    2.  Functions of Computer System

    The Computer System needs both hardware and software. Hardware consists of the

    mechanical and electronic devices, which we can see and touch. The software consists of

    programs, the operating system and the data that reside in the memory and storage devices.

    A computer does mainly the following four functions:

    1.  Receive input —Accept data/information from outside through various input deviceslike the keyboard, mouse, scanner, etc.

    2.  Process information—Perform arithmetic or logical operations on data/ information.

    3.  Produce output—Communicate information to the outside world through outputdevices like monitor, printer, etc.

    4.  Store information—Store the information in storage devices like hard disk, floppydisks, CD, etc.

    These four basic functions are responsible for everything that computers do.

    3.  Introduction to Operating System

  • 8/19/2019 fcpc notes

    2/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    The operating system is the core software component of your computer. It performsmany functions and is, in very basic terms, an interface between your computer and

    the outside world. In the section about hardware, a computer is described asconsisting of several component parts including your monitor, keyboard, mouse, andother parts. The operating system provides an interface to these parts using what isreferred to as "drivers". This is why sometimes when you install a new printer orother piece of hardware, your system will ask you to install more software called adriver.

    4.  Functions of Operating System

    The operating system provides for several other functions including:

    •  System tools (programs) used to monitor computer performance, debug problems, ormaintain parts of the system.

    •  A set of libraries or functions which programs may use to perform specific tasksespecially relating to interfacing with computer system components.

    The operating system makes these interfacing functions along with its other functions operatesmoothly and these functions are mostly transparent to the user.

    5.  Types of Operating System

    There are many types of operating systems. The most common is the Microsoft suite of operatingsystems. They include from most recent to the oldest:

    •  Windows XP Professional Edition - A version used by many businesses on workstations.It has the ability to become a member of a corporate domain.

    •  Windows XP Home Edition - A lower cost version of Windows XP which is for homeuse only and should not be used at a business.

    •  Windows 2000 - A better version of the Windows NT operating system which works wellboth at home and as a workstation at a business. It includes technologies which allowhardware to be automatically detected and other enhancements over Windows NT.

    •  Windows ME - A upgraded version from windows 98 but it has been historically plaguedwith programming errors which may be frustrating for home users.

    •  Windows 98 - This was produced in two main versions. The first Windows 98 versionwas plagued with programming errors but the Windows 98 Second Edition which cameout later was much better with many errors resolved.

    •  Windows NT - A version of Windows made specifically for businesses offering bettercontrol over workstation capabilities to help network administrators.

    •  Windows 95 - The first version of Windows after the older Windows 3.x versionsoffering a better interface and better library functions for programs.

  • 8/19/2019 fcpc notes

    3/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    There are other worthwhile types of operating systems not made by Microsoft. The greatestproblem with these operating systems lies in the fact that not as many application programs arewritten for them. However if you can get the type of application programs you are looking for,

    one of the systems listed below may be a good choice.

    •  Unix - A system that has been around for many years and it is very stable. It is primaryused to be a server rather than a workstation and should not be used by anyone who doesnot understand the system. It can be difficult to learn. Unix must normally run an acomputer made by the same company that produces the software.

    •  Linux - Linux is similar to Unix in operation but it is free. It also should not be used byanyone who does not understand the system and can be difficult to learn.

    •  Apple MacIntosh - Most recent versions are based on Unix but it has a good graphicalinterface so it is both stable (does not crash often or have as many software problems asother systems may have) and easy to learn. One drawback to this system is that it can

    only be run on Apple produced hardware.

  • 8/19/2019 fcpc notes

    4/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Lecture: 2

    Evaluation of Computers, Hardware organization of a computers. 

    Contents

    1.  Evolution of Computers

    2.  Hardware organization of a computers

    3.  Input Device

    4.  Output Device

    5.  CPU6.  Memory Unit

    7.  Control Unit

    8.  ALU

    1.  Evolution of Computers

    The need for a device to do calculations along with growth in commerce and other humanactivities explain the evolution of computers. Having the right tool to perform right has alwaysbeen important for human beings. In this post, I have mentioned some important history  in theevolution of computers.

    In the beginning, when the task was simply counting or adding, people used either their fingersor pebbles along lines in the sand in order to simply the process of counting, people in Asiaminor built a counting device called ABACUS, the device allowed users to do calculations usinga system of sliding beads arranged on a rack.

    With the passage of time, many computing devices such as Napier bones and slide rule wereinvented. It took many centuries for the advancement in computing devices. In 1642, a Frenchmathematician, Blaise Pascal invented the first functional automatic calculator. The brassrectangular box also called Pascaline, used eight movable dials to add sums and eight figuresonly.

    In 1694, german mathematician Gotfried Wilhemvoz Leibniz, extended Pascal’s design toperform multiplication, division and to find square root. This machine is known asstepped reckoner. The only problem with this device that it lacked mechanical precision inits construction and was not reliable.

    The real beginning computer was made by an English mathematician Charles Babbage in 1822.He proposed a engine to perform difference equations, called a difference engine. It would printresults automatically. However, Babbage never quite made a fully functional difference engine,

  • 8/19/2019 fcpc notes

    5/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    and in 1833, he quit working on it to concentrate on analytical engine. The basic design of theengine included input devices in the form of perforated cards containing operating system as astore for memory of 1,000 numbers up to 50 decimal digits long. It also contained a controlled

    unit that allowed processing instructions at any sequence, output device to produce printedresults. Babbage borrowed the idea of punch cards to encode the instructions inthe machine from the Joseph Marie jacquard’s loom.

    A computer as shown in Fig. performs basically five major operations or functions irrespective

    of their size and make. These are: -

    1) It accepts data or instructions by way of input

    2) It stores data

    3) It can process data as required by the user

  • 8/19/2019 fcpc notes

    6/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    4) It gives results in the form of output

    5) It controls all operations inside a computer.

    2.  Hardware Organization of Computer

    All general purpose computers require the following hardware components:

    (i)  Central Processing Unit (CPU): The ‘brain’ of the computer, the component thatactually executes instructions.

    (ii)  Memory : It enables a computer to store, at least temporarily, data and programs.

    (iii)  Input device : Usually a keyboard or mouse is used to read data and programs into thecomputer.

    (iv)  Output device: A display screen, printer, etc. that lets you see what the computer hasaccomplished.

    (v)  Mass storage device: It allows a computer to permanently store large amounts of data.Common mass storage devices include disk drive and tape drive.

    In addition to these components, many others make it possible for the basic components of acomputer to work together efficiently.

    Objectives

    After going through this lesson, you will be in a position to:

    •  identify the basic components of a computer and their working.

    •  explain the importance of various units of a computer .

    •  learn how these units work together to accomplish a given job .

    3.  Input Device

    An input device presents data to the processing unit in a machine-readable form.

    Although the keyboard is a common input device for a small computer, a system may alsosupport various other input devices such as Optical Character Recognition (OCR), Magnetic

    Ink Character Recognition (MICR), mark sense reader, etc.

    4.  Output Device

    Output devices receive information from the CPU and present it to the user in the desired

    form. Output devices include display screen, loudspeakers, printers, plotters, etc.

  • 8/19/2019 fcpc notes

    7/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    5.  CPU

    This part of the computer that executes program instructions is known as the processor or

    Central Processing Unit (CPU). In a microcomputer, the CPU is based on a single electronic

    component, the microprocessor chip, within the system unit or system cabinet. The system

    unit also includes circuit boards, memory chips, ports and other components. A

    microcomputer’s system cabinet will also house disk drives, hard disks, etc., but these are

    considered separate from the CPU.

    The CPU has two parts —The Control Unit (CU) and the Arithmetic Logic Unit (ALU). In amicrocomputer, both are on a single microprocessor chip.

    6.  Memory Unit

    Memory - also known as the primary storage or main memory - is a part of themicrocomputer that holds data and instructions.Part of the contents of the memory is held only temporarily, that is, it is stored only as long

    as the microcomputer is turned on. When you turn the machine off, the contents are lost.

    The capacity of the memory to hold data and program instructions varies in different

    computers. The original IBM PC could hold approximately several thousand characters of

    data or instructions only. But modern microcomputers can hold millions or even billions of

    characters in their memory.

    7.  Control Unit

    The control unit tells the rest of the computer system how to carry out a program’s

    instructions. It directs the movement of electronic signals between memory - which

    temporarily holds data, instructions and processes information - and the ALU. It also

    directs these control signals between the CPU and input/output devices.

    8.  ALU

    Arithmetic Logic Unit, usually called the ALU, performs two types of operations -

    arithmetical and logical. Arithmetical operations are the fundamental mathematical

    operations consisting of addition, subtraction, multiplication and division. Logical

    operations consist of comparisons. That is two pieces of data are compared to see whether

    one is equal to, less than, or greater than the other.

  • 8/19/2019 fcpc notes

    8/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Lecture: 3

    Introduction to Microprocessor, Generation of Microprocessor

    Contents

    6.  Introduction to Microprocessor

    7.  Generation of Microprocessor

    P1 (086) First-Generation Processors8088 and 8086 Processors80186 and 80188 Processors8087 Coprocessor

    6.  Introduction to Microprocessor

    Intel 4004, the first general-purpose, commercial microprocessor

    Microprocessor  incorporates most or all of the functions of a computer's centralprocessing unit  (CPU) on a single integrated circuit  (IC, or microchip). The firstmicroprocessors emerged in the early 1970s and were used for electronic calculators,using binary-coded decimal (BCD) arithmetic on 4-bit words. Other embedded usesof 4-bit and 8-bit microprocessors, such as terminals, printers, various kinds ofautomation  etc., followed soon after. Affordable 8-bit microprocessors with 16-bitaddressing also led to the first general-purpose microcomputers from the mid-1970son. 

  • 8/19/2019 fcpc notes

    9/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    During the 1960s, computer processors were often constructed out of small and medium-scaleICs containing from tens to a few hundred transistors. The integration of a whole CPU onto asingle chip greatly reduced the cost of processing power. From these humble beginnings,

    continued increases in microprocessor capacity have rendered other forms of computers almostcompletely obsolete (see history of computing hardware), with one or more microprocessorsused in everything from the smallest embedded systems  and handheld devices  to the largestmainframes and supercomputers.

    Since the early 1970s, the increase in capacity of microprocessors has been a consequence ofMoore's Law, which suggests that the number of transistors that can be fitted onto a chip doublesevery two years. Although originally calculated as a doubling every year, Moore later refined theperiod to two years. It is often incorrectly quoted as a doubling of transistors every 18 months.

    7. 

    Generation of Microprocessor

    Each generation of computer is characterized by a major technological developmentthat fundamentally changed the way computers operate, resulting in increasinglysmaller, cheaper, more powerful and more efficient and reliable devices.

    P1 (086) First-Generation Processors

    The first generation of processors represents the series of chips from Intel that werefound in the first PCs. IBM, as the architect of the PC at the time, chose Intel processors andsupport chips to build the PC motherboard, setting a standard that would hold for manysubsequent processor generations to come

    8088 and 8086 Processors

    Intel introduced a revolutionary new processor called the 8086 back in June of 1978.The 8086 was one of the first 16-bit processor chips on the market; at the time virtually all otherprocessors were 8-bit designs. The 8086 had 16-bit internal registers and could run a new classof software using 16-bit instructions. It also had a 16-bit external data path, which meant it couldtransfer data to memory 16 bits at a time.The address bus was 20 bits wide, meaning that the 8086 could address a full 1MB (220) ofmemory. This was in stark contrast to most other chips of that time that had 8-bit internalregisters, an 8-bit external data bus, and a 16-bit address bus allowing a maximum of only 64KBof RAM (216).Unfortunately, most of the personal computer world at the time was using 8-bit processors,which ran 8-bit CP/M (Control Program for Microprocessors) operating systems and software.The board and circuit designs at the time were largely 8-bit as well. Building a full 16-bitmotherboard and memory system would be costly, pricing such a computer out of the market.The cost was high because the 8086 needed a 16-bit data bus rather than a less expensive 8-bitbus. Systems available at that time were 8-bit, and slow sales of the 8086 indicated to Intel thatpeople weren't willing to pay for the extra performance of the full 16-bit design. In response,

  • 8/19/2019 fcpc notes

    10/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Intel introduced a kind of crippled version of the 8086, called the 8088. The 8088 essentiallydeleted 8 of the 16 bits on the data bus, making the 8088 an 8-bit chip as far as data input andoutput were concerned. However, because it retained the full 16-bit internal registers and the 20-

    bit address bus, the 8088 ran 16-bit software and was capable of addressing a full 1MB of RAM.For these reasons, IBM selected the 8-bit 8088 chip for the original IBM PC. Years later, IBMwas criticized for using the 8-bit 8088 instead of the 16-bit 8086. In retrospect, it was a very wisedecision. IBM even covered up the physical design in its ads, which at the time indicated its newPC had a "high-speed 16-bit microprocessor." IBM could say that because the 8088 still ran thesame powerful 16-bit software the 8086 ran, just a little more slowly. In fact, programmersuniversally thought of the 8088 as a 16-bit chip because there was virtually no way a programcould distinguish an 8088 from an 8086. This allowed IBM to deliver a PC capable of running anew generation of 16-bit software, while retaining a much less expensive 8-bit design for thehardware. Because of this, the IBM PC was actually priced less at its introduction than the mostpopular PC of the time, the Apple II. For the trivia buffs out there, the IBM PC listed for $1,265

    and included only 16KB of RAM, while a similarly configured Apple II cost $1,355.The original IBM PC used the Intel 8088. The 8088 was introduced in June 1979, but the IBMPC did not appear until August 1981. Back then, there was often a significant lag time betweenthe introduction of a new processor and systems that incorporated it. That is unlike today, whennew processors and systems using them are often released on the same day.The 8088 in the IBM PC ran at 4.77MHz, or 4,770,000 cycles (essentially computer heartbeats)per second. Each cycle represents a unit of time to the system, with different instructions oroperations requiring one or more cycles to complete. The average instruction on the 8088 took12 cycles to complete.Computer users sometimes wonder why a 640KB conventional-memory barrier exists if the 8088chip can address 1MB of memory. The conventional-memory barrier exists because IBM

    reserved 384KB of the upper portion of the 1,024KB (1MB) address space of the 8088 for use byadapter cards and system BIOS. The lower 640KB is the conventional memory in which DOSand software applications execute.

    80186 and 80188 Processors

    After Intel produced the 8086 and 8088 chips, it turned its sights toward producing amore powerful chip with an increased instruction set. The company's first efforts along thisline—the 80186 and 80188—were unsuccessful. But incorporating system components into theCPU chip was an important idea for Intel because it led to faster, better chips, such as the 286.The relationship between the 80186 and 80188 is the same as that of the 8086 and 8088; one is a

    slightly more advanced version of the other. Compared CPU to CPU, the 80186 is almost thesame as the 8088 and has a full 16-bit design. The 80188 (like the 8088) is a hybrid chip thatcompromises the 16-bit design with an 8-bit external communications interface. The advantageof the 80186 and 80188 is that they combine on a single chip 15 to 20 of the 8086–8088 seriessystem components—a fact that can greatly reduce the number of components in a computerdesign. The 80186 and 80188 chips were used for highly intelligent peripheral adapter cards ofthat age, such as network adapters.

    8087 Coprocessor

  • 8/19/2019 fcpc notes

    11/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Intel introduced the 8086 processor in 1976. The math coprocessor that was pairedwith the chip—the 8087—often was called the numeric data processor (NDP), the mathcoprocessor, or simply the math chip. The 8087 is designed to perform high-level math

    operations at many times the speed of the main processor. The primary advantage of using thischip is the increased execution speed in number-crunching programs, such as spreadsheetapplications.

    Lecture: 4

    Commonly used CPUs, Input/output devices.

    Contents

    9.  Introduction to CPU

    10. CPU Registers

    11. Input Devices

    12. Output Devices

    9.  Introduction to CPU

    The central processing unit  (CPU) is the portion of a computer  system that carries out theinstructions of a computer program, and is the primary element carrying out the computer'sfunctions. The central processing unit carries out each instruction of the program in sequence, to

  • 8/19/2019 fcpc notes

    12/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    perform the basic arithmetical, logical, and input/output operations of the system. This term hasbeen in use in the computer industry at least since the early 1960s.[1]  The form, design andimplementation of CPUs have changed dramatically since the earliest examples, but their

    fundamental operation remains much the same.

    Early CPUs were custom-designed as a part of a larger, sometimes one-of-a-kind, computer.However, this costly method of designing custom CPUs for a particular application has largelygiven way to the development of mass-produced processors that are made for one or manypurposes. This standardization trend generally began in the era of discrete transistor mainframes and minicomputers and has rapidly accelerated with the popularization of the integrated circuit (IC). The IC has allowed increasingly complex CPUs to be designed and manufactured totolerances on the order of nanometers. Both the miniaturization and standardization of CPUshave increased the presence of these digital devices in modern life far beyond the limitedapplication of dedicated computing machines. Modern microprocessors appear in everything

    from automobiles to cell phones and children's toys.

    10. CPU Registers

    EAX: Arithmetic operations, I/O port access and interrupt callEDX: Arithmetic operations, I/O port access and interrupt call. If you have a multiplicationoperation which results in more than what a single register can handle, then the mostsignificant 16 numbers are stored in EDX and least significant ones are stored in EAXEBX: Holds return valuesECX: Used for loop counters. Also used for "this" pointer for a classEIP: Instruction pointer. Points to the next instruction to execute.ESP: Stack pointer. This points to the top of the stack.EBP: Base/Frame pointer.

    11. Input Devices

    Input device converts incoming data and instructions into a pattern of electrical signals in binary code that are comprehensible to a digital computer. An output device reverses the process,translating the digitized signals into a form intelligible to the user. At one time punched-card andpaper-tape readers were extensively used for inputting, but these have now been supplanted by

    more efficient devices.

  • 8/19/2019 fcpc notes

    13/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Input devices include typewriter-like keyboards; hand-held devices such as the mouse, trackball, joystick, and special pen with pressure-sensitive pad; and microphones. They also includesensors that provide information about their environment—temperature, pressure, and so forth—to a computer. Another direct-entry mechanism is the optical laser scanner (e.g., scanners usedwith point-of-sale terminals in retail stores) that can read bar-coded data or optical characterfonts. Output equipment includes video display terminals  (either cathode-ray tubes or liquidcrystal displays), ink-jet and laser printers, loudspeakers, and devices such as flow valves thatcontrol machinery, often in response to computer processing of sensor input data. Some devices,

    such as video display terminals, may provide both input and output. Other examples are devicesthat enable the transmission and reception of data between computers—e.g., modems andnetwork interfaces. Most auxiliary storage devices—as, for example, magnetic tape, magneticdisk drives, and certain types of optical compact discs—also double as input/output devices

    Various standards for connecting peripherals to computers exist. For example, integrated driveelectronics (IDE) and enhanced integrated drive electronics (EIDE) are common interfaces, orbuses, for magnetic disk drives. A bus (also known as a port) can be either serial or parallel,depending on whether the data path carries one bit at a time (serial) or many at once (parallel).Serial connections, which use relatively few wires, are generally simpler and slower than parallelconnections. Universal serial bus (USB) is a common serial bus. A common example of aparallel bus is the small computer systems interface, or SCSI, bus.

    Keyboards and mice no longer have to be wired to the computer. Wireless versions can beconnected to the computer by using infrared beams, provided there is a clear line of sightbetween the device and the infrared port on the computer. Since a laptop may be used in aconfined space, alternate pointing devices such as a trackball, touchpad, or pointing stick areusually provided. However, some users prefer to connect an external mouse to their laptopcomputers, thereby bypassing these alternatives. Even some computer display screens can beused as input devices. Touch screens can be found at an ATM or a kiosk, and a stylus orelectronic pen can be used to input data into a PDA or small hand-held computer

  • 8/19/2019 fcpc notes

    14/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    There is an assortment of optical devices. Digital cameras are replacing conventional filmcameras. One no longer has to wait for film to be developed. State-of-the-art digital cameras nowstore pictures internally in chips, on special memory strips, or on disks. Some cameras have an

    LCD on which pictures can be previewed. Once image files have been transferred to a computerby a wire connection or by disk, they can be edited and printed. The quality of the final picturedepends on both the quality of the paper and printer. Digital images do not have to be printed.They can easily be posted to a Web site or e-mailed to friend or relative. Some of the imagesused in these Lecture Notes were taken with a digital camera.

    There are several different types of scanners. An MICR scans and reads the magnetic markingsat the bottom of a check that represents information about the bank, the account, the checknumber, and once written, the amount of the check.

    Most likely, you have used a pencil to take a test or to complete a form that is then scanned and

    interpreted by an optical scanner. Many states are using optical recognition to read and processhandwritten income tax forms, and retail store salespeople use handheld wand readers to readsales tags on store merchandise. The United States Postal Service has funded millions of dollarsin grants in an attempt to develop systems that can read cursive handwriting. Like otherperipheral devices, the prices for personal computer scanners have decreased dramatically overthe past few years. Perhaps you have scanned an image into a computer and used it as wallpaper,or scanned and converted text from a page into a word processing document using OCRsoftware. Several years ago the food industry began to use unique bar codes called the UPC(Universal Product Code) to identify specific products. Other "industries" also use bar codes.Although the codes are different from those used in supermarkets, each book in my campuslibrary contains a bar code and so does each faculty/staff/students' identification card. Librarians

    check out books by using a small pen-like scanner and "wanding" the bar codes on the book andidentification card

    So far we have examined devices where information is entered by typing, selected by pointing orclicking, and visualized by scanners and cameras. There is one final method of inputting data,and that is by voice. Using a microphone and appropriate software, you can use your voice toenter commands or dictate words. One of the challenges to voice input is speech recognition.Early speech recognition software required users to speak discrete words. That is, they had tobriefly pause between each word as they spoke. Newer speech recognition software, know ascontinuous word systems, allow users to speak at a natural pace. Users are able to speak at afaster rate due to software advances and increased processor speeds that interpret what is being

    spoken. One of my colleagues is a professor, an artist, and a designer and uses a computer for herprofessional and creative activities. Although physically challenged, she uses her voice tocommand the computer, dictate documents, and draw pictures. We will now turn our attention tooutput devices.

    12. Output Devices

  • 8/19/2019 fcpc notes

    15/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Output devices receive information from the CPU and present it to the user in the desired

    form. Output devices include display screen, loudspeakers, printers, plotters, etc.

    Softcopy

    The traditional output device for personal computers has been the CRT monitor. Originally they

    were only available in monochrome, but today most monitors are now color. The size and quality

    of the display are a function of the monitor and video adapter to which they are connected. Like

    televisions, the size of a monitor is determined by a diagonal measurement of the screen. A few

    years ago, several computer companies were sued because of misleading advertisements. They

    measured from corner to corner of the screen instead of the portion of the screen that could

    actually be used.

    Subsequently, descriptions now include the "viewable" measurement, so a typical advertisement

    will mention a 17" monitor with 16" viewable. Quality of the display is determined by several

    factors.

    1.  The number of horizontal and vertical pixels. Typical low resolution would be 640 by480, while a high resolution can be 1600 by 1200.

    2.  The dot pitch, which is the distance between pixels. This can vary from .15 mm to .30 m.3.  The color depth, which refers to the number of colors. Typically this can range from 256

    colors to 16.7 million colors.

    As one would expect, a higher quality video card and monitor will correspondingly have a higher

    price. As shown below, if you are using a Windows-based computer, you can find (and change)

  • 8/19/2019 fcpc notes

    16/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    information about your graphics card and monitor settings by right-clicking on the background,

    selecting Properties, and then select the Settings tab

    Obviously a CRT monitor is not a good choice for a portable computer display device. Using the

    same flat-panel technology that is typically found in wristwatches and calculators, laptop

    computers use an LCD, and like their CRT "cousins", better visual quality carries a higher price

    tag. Only recently have flat-panel displays been available for both Wintel and Macintosh desktop

    computers. Unlike CRT monitors that get deeper as they get wider, LCD panels remain very thin.

    Unfortunately, this small footprint carries a large price tag.

    As previously mentioned, sound played through speakers is another example of softcopy output.

    Just as monitors require a video card to create and display visual output, speakers require anaudio card to create and produce auditory output. This sound can be previously recorded or a

    synthesized voice, recorded sound effects, recorded vocal/ instrumental music, or synthesized

    instrumental music. With the proper hardware and software, a human voice can be recorded and

    then played back. This is useful if the number of spoken words is small. For example, how many

    words are needed to speak all of the zip codes used in the United States? Since we "spell" zip

    codes, only ten words are needed! That is, 14372 is spoken as "one-four-three-seven-two"

    instead of "fourteen thousand three hundred seventy-two." When large numbers of words are

    needed, then a human voice is synthesized. Depending on the system, these voices range from

    nearly perfect speaking to mechanical robot-like speech. An example of such a system would be

    a speaker used in conjunction with "vocalizer" software. A visually impaired user could use this

    software to read the text that appears in a document that is displayed on a monitor. Just as human

    words can be synthesized, so can instrumental music. Using a MIDI device, most often in the

    form of a musical keyboard connected to a computer, instrumental musical sounds can be created

    and stored. These instrumental sounds are not recorded, but information such as the note,

    duration, and "voice" (piano, saxophone, etc.) is stored as a file. MIDI files can be thought of as

    a recording of the sheet music instead of the actual instrument playing. Consequently, MIDI files

    are considerably smaller than recorded ones. When played back, the musical sound of the

    instrument is synthesized by the sound card and sent to the speakers. There are some additional

    input and output devices that are used in the production and presentation of multimedia, and theywill be discussed in a later chapter.

    Hardcopy

    Printers are subdivided into impact and non-impact categories. When microcomputers were first

    available, the traditional hardcopy output device for personal and large-scale computers was a

    dot-matrix printer. These printers had a small print head that contained an arrangement (matrix)

    of one or more columns of small wires or pins. These pins would form the various printable

  • 8/19/2019 fcpc notes

    17/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    characters. Shown below is a one-column 7-pin head (the pins are much closer than indicated in

    the figure), a printed letter, and a magnified view of the letter showing the dots that created it.

    Since dot-matrix printers are impact printers (small pins striking a ribbon and paper), they tend tobe noisy, and their quality is marginal. Although rarely used with new personal computers, theyre still popular with businesses that need the ability to produce multiple copies of forms orsimilar output.

    The two most popular non-impact printers for personal computers are the laser and inkjetprinters. The printer speed of laser printers used with home computers generally print around 8 to10 ppm, and the quality of print is between 600 and 1200 dpi. For comparison, a dot matrixprinter prints at 75-100 dpi, and a large organization may have an expensive, high-volume laserprinter that prints 1,000 ppm. Low cost black and white laser printers for use with personalcomputers can be purchased for a few hundred dollars. Inkjet printers, which spray ink frommultiple nozzles, are available in both black and white and color models. Although most oftoday's inkjets are capable of printing in color, they have much slower print rates typically 2-6ppm and lower resolution 300-600 dpi. Although laser printers have a higher initial cost thaninkjet printers, they cost less per page to print hardcopies. Because of its ability to print in color,and despite the lesser speed and quality and higher printing cost, the inkjet is still the mostpopular printer used with personal computers.

  • 8/19/2019 fcpc notes

    18/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Lecture: 5

    Input/output ports and connectors.

    Contents

    1.  Input/output Ports

    2.  Connectors

    3.  Types of Connectors

  • 8/19/2019 fcpc notes

    19/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    1.  Input/output Ports

    This is the standard input and output facilities in Isis. Input from and output to any endpointis handled using the same mechanism known as a port, which allows the same procedures to

    be used for reading, writing, and other operations, regardless of where the data is coming

    from or going to. You can create ports that connect to disk files, memory buffers, internet

    sites, multicast networks, or serial ports, just to name a few.

    In Isis, a port is represented as a list of several items, which includes the port type, internalidentity information, and the procedures used to operate on the port. It will usually not benecessary to look at anything in this list, and of course, nothing in the list should ever bemodified manually. Use only the port manipulation routines described below.

    Default input and output ports

    default-input-port # the default input port (stdin)default-output-port # the default output port (stdout)

    (current-input-port) # return the current input port(current-output-port) # return the current output port

    (set-input-port port) # change the current input port(set-output-port port) # change the current output port

    The default input and output ports are usually your keyboard and your terminal on your

    screen. Whatever you type on your keyboard is available for reading from the default input

    port, and whatever you write to the default output port appears on your screen. Technically,

    the default input port and output ports refer to the "standard input" and "standard output" files

    of the Isis process.

    The current input and output ports indicate the places Isis will read and write data to when noparticular port is specified in the routines described later (for example, the print function

    prints messages to the current output port). current-input-port and current-output-port allowyou to find out what the current input and output ports are. When Isis is started, the currentinput and output ports are the same as the default input and output ports, but you can changethem using set-input-port and set-output-port.

    Opening ports

    (open-input filename) # open a disk file for input

  • 8/19/2019 fcpc notes

    20/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    (open-output filename) # open a disk file for output(open-update filename) # open a disk file for input and output

    (new-string-port name string) # create new port connected to a string(new-memory-port name size address freeflag) # create new port connected to memorybufferopen-input, open-output, and open-update open a disk file for reading, writing, or both. A

    port is returned, or Null if there was a problem accessing the file.

    (set iport (open-input "inputfile.dat"))(set oport (open-output "outputfile.dat"))new-string-port creates a port that points to a specified string (which is copied into a memory

    buffer), and new-memory-port creates a port that points directly to a buffer in memory. A

    string name is expected for each, to be used for identification and in error messages. new-memory-port expects the size of the memory buffer in bytes, the address of the buffer, and a

    boolean freeflag indicating whether the buffer should be automatically freed when the port is

    closed. Both routines return the newly created port, valid for reading or writing.

    (set size 32768)(set buf (allocate-memory size))(set mport (new-memory-port "mybuf" size buf False))In addition to disk files and memory buffers, you may open ports to TCP connections, serial

    ports, multicast networks, unix pipes, and other devices. Descriptions of these ports appears

    in other sections of the documentation.

    Closing ports

    (close port) # close port and deallocate associated resourcesWhen a port is no longer needed, it should be closed so that resources associated with the

    port may be reclaimed.

    Reading and writing data

    (read-string port) # read string up to a newline character(read port) # read CODED Isis values(read-raw port numbytes address) # read raw bytes to memory address

    (write-string port val val ...) # write values in human readable format(write port val val ...) # write CODED Isis values(write-raw port numbytes address) # write raw bytes from memory address

  • 8/19/2019 fcpc notes

    21/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    (read-string) # same as read-string from the current input port(print val val ...) # same as write-string to current output port

    Isis allows you to read and write data on ports in three different formats: strings, coded Isis

    values, and raw bytes. There is a separate pair of read and write functions for each format. If

    data is written in one format, it should usually be read back with the corresponding read

    function for the same format.

    Read-string and write-string read and write human-readable strings. read-string readscharacters from the port up to the next newline character and returns a string (without thenewline in it), or Null if no more data is available. write-string writes one or more strings,characters, and other Isis values in a human-readable format, and returns the total number ofbytes written to the port, or Null if an error occurred. Values are written exactly as they

    would be displayed in Isis, except that strings and characters are written without their quotes,and a newline character must be given explicitly if it is desired.

    (set oport (open-output "test.txt"))(write-string oport "The number of the day is: " (random) newline)(write-string oport "Thank you and goodbye." newline)(close oport)

    (set iport (open-input "test.txt"))(while (!= Null (set aline (read-string iport)))

    (print aline newline))

    (close iport)

    Plain read and write receive and transmit Isis values in a compact coded form  that is not

    readable by humans. These routines are most useful for sending and receiving Isis values

    over a network or in disk files, where other programs will not have to access the data. Any

    type of value except procedures and addresses may be read or written. read reads one value

    from the given port and returns it, or Null if no more data is available. write writes one or

    more values to the given port, and returns the total number of bytes written, or Null if an

    error occurred. A description of the protocol used in coding values can be obtained from

    Stefan.

    (set oport (open-output "test.data"))(write oport (random) (random) (random))(close oport)

    (set iport (open-input "test.data"))(print "The three secret numbers are: "

    (read iport) (read iport) (read iport) newline)(close iport)

  • 8/19/2019 fcpc notes

    22/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Read-raw and write-raw receive and transmit blocks of raw data in memory buffers. Each

    expects the port, an integer number of bytes, and the address of the memory buffer. Each also

    returns the total number of bytes read or written, or Null if an error occurred. These functionsare most useful for transfering large blocks of raw data, like images or audio, in the most

    time and space efficient manner.

    (set outbuf (allocate-memory 50)) # allocate a memory buffer(outbuf c-byte (make-series 0 50 1)) # put something in the buffer

    (set oport (open-output "test.raw"))(write-raw oport 50 outbuf) # write the entire buffer(close oport)

    (set inbuf (allocate-memory 50)) # allocate a second buffer(set iport (open-input "test.raw"))(read-raw iport 50 inbuf) # read 50 bytes into it(close iport)

    (display (inbuf [c-byte 50])) # display the contents

    When read-string is called with no argument, it reads a string from the current input port

    (usually the keyboard). Similarly, the print function prints values to the current output port

    (usually the screen). These functions are most useful as a way of requesting a line of input

    from the user and writing messages that the user will see on the screen. See above for more

    information about how to query or change the current input and output ports.

    (while True(begin(print "Please enter a number: ")(set numstr (read-string))(print "The square root of your number is: "

    (sqrt (eval numstr)) newline)))

    Port position

    (tell port) # return the current position in port(seek port pos) # seek to a particular position in porttell returns the current read/write position in the port in bytes relative to the beginning of the

    file, or Null if it is not known or if there is an error. seek sets the current read/write position.

    It returns True if successful, and False if not.

  • 8/19/2019 fcpc notes

    23/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Port status

    (pending port) # return True if data is waiting to be read at port(pending port microsecs) # return True if data pending or False if time limit reached

    (read-ready port) # same as pending(read-ready port microsecs) # same as pending

    (write-ready port) # return True if data may be written to port(write-ready port microsecs) # return True if data may be written or False if time limitreachedpending returns True if data is waiting to be read from the specified port, or False otherwise.

    If a second argument is given, the function waits up to the specified number of microseconds,

    and returns immediately with True if data is pending, or False if the time limit was reached.read-ready is exactly the same as pending.

    write-ready performs the converse operation for writing. It returns True if the port is ready toaccept data, or False if not or if the optional time limit has been reached. This routine istypically useful to prevent a program from blocking when, in TCP networking applicationsfor example, a outgoing connection is hung and momentarily cannot accept more data.

    Port queries

    (input-port? port) # return True if port supports input(output-port? port) # return True if port supports outputThese routines check if the given port supports input or output. The result is either True or

    False.

    -> (input-port? (current-input-port))True-> (output-port? (current-input-port))False

    Port utilities

    (read-text port numchars) # read up to numchars, return string(read-all-text port) # read entire port, return string

    (read-data port numbytes) # read up to numbytes, return [buf len](read-all-data port) # read entire port, return [buf len]

  • 8/19/2019 fcpc notes

    24/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    (transfer-data inport outport numbytes) # transfer numbytes from inport to outport(transfer-all-data inport outport) # transfer entire inport to outport

    read-text reads up to the specified number of characters from the given port and returns a

    string. read-all-text reads as many characters as possible from the port and returns a string.

    Both functions return Null if there is an error.

    read-data and read-all-data are similar, except they read raw data. The return value is a list oftwo items: the address of a newly-allocated memory buffer, and an integer indicating thenumber of bytes stored in that buffer (which may be smaller than the number of bytesrequested). You are responsible for deallocating the memory buffer when you no longer needit. If there is an error, the returned number of bytes will be 0.

    transfer-data and transfer-all-data read bytes from one port and write them to another. Thenumber of bytes actually transferred is returned, or 0 if there was an error.

    (set copy-file(proc (inname outname)(local (infile outfile)(begin

    (set infile (open-input inname))(set outfile (open-output outname))(if (and infile outfile) (transfer-all-data infile outfile))(close infile)

    (close outfile)))))

    Port list internals

    port-name # string, port nameport-type # string, port typeport-inflag # boolean, input enabled on port?port-outflag # boolean, output enabled on port?

    port-internal-id # internal id of port, or Null if not neededport-close-proc # procedures for manipulating this portport-read-procport-readline-procport-write-procport-tell-procport-seek-procport-read-ready-procport-write-ready-procport-configure-proc

  • 8/19/2019 fcpc notes

    25/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    These constants represent indices in the port descriptor list that you can use to get certain

    information about a port. The most useful item to most users is the probably the name of the

    port, which you can obtain by indexing into the port list with port-name.

    -> ((current-input-port) port-name)"Standard Input"-> ((current-output-port) port-name)"Standard Output"

    Creating new kinds of ports

    (new-port name type inflag outflag internal-idclose-proc read-proc readline-proc write-proctell-proc seek-procread-ready-proc write-ready-proc configure-proc) # create a new port

    new-port creates a new port. name and type should be strings. inflag and outflag should be

    booleans that indicate whether the port will support input or output or both. internal-id can be

    any value that you want to use as an internal identifier to the port. The rest of the arguments

    will be the procedures that are used to manipulate the port. The procedures that you design

    for the port should be defined in the following way, where id will be the internal-id that you

    specify in new-port:

    (close id) # close and free resources, return True if successful(read id n addr) # read n bytes into addr, return num bytes actually read(readline id n addr stopval) # read n bytes or up to stopval, return num bytes actually read(write id n addr) # write n bytes from addr, return num bytes actually written(tell id) # return current read/write position, or Null if N/A(seek id pos) # set current read/write position, return True if successful(read-ready id microsecs) # return True if data can be read or False if time limit reached(write-ready id microsecs) # return True if data can be written or False if time limit reached(configure id arg arg ...) # perform user-defined operationsFor example, below is the definition of new-memory-port, which uses new-port to create a

    new port. The procedures for manipulating the port are defined within the scope of a localenvironment that includes bindings needed for the internal operations of the port. Talk to

    Stefan for more information on creating new types of ports.

    (set new-memory-port(proc (name buflen membuf freeflag)(local (bufpos)(begin

    (set bufpos 0)(new-port name "MEMORY" [ buflen membuf freeflag ] True True

  • 8/19/2019 fcpc notes

    26/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    # close function(proc (id)

    (begin(if freeflag (free membuf))True))

    # read function(proc (id size ptr)

    (local (readsize)(begin

    (set readsize (min size (- buflen bufpos)))(if readsize (copy-memory readsize (+ membuf bufpos) ptr))(set bufpos (+ bufpos readsize))

    readsize)))

    # readline function(proc (id size ptr endval)

    (local (readsize val going)(begin

    (set readsize 0)(set going True)(while (and (< bufpos buflen) going)

    (begin(set val ((+ membuf bufpos) c-byte))

    ((+ ptr readsize) c-byte val)(set readsize (+ readsize 1))(set bufpos (+ bufpos 1))(if (= val endval) (set going False))))

    readsize)))

    # write function(proc (id size ptr)

    (local (writesize)(begin

    (set writesize (min size (- buflen bufpos)))

    (if writesize (copy-memory writesize ptr (+ membuf bufpos)))(set bufpos (+ bufpos writesize))writesize)))

    # tell function(proc (id) bufpos)

    # seek function(proc (id pos) (set bufpos pos))

  • 8/19/2019 fcpc notes

    27/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    # read-ready function(proc (id time) (not (= bufpos buflen)))

    # write-ready function(proc (id time) (= bufpos buflen))

    # configure function(proc args Null)

    )))))

    2.  Connectors

    The part of a cable that plugs into a port  or interface  to connect one device  to another. Mostconnectors are either male (containing one or more exposed pins) or female (containing holes inwhich the male connector can be inserted). 

    Every house or office today is equipped with a multitude of connectors. Connectors are devicesused for mating and de-mating electrical power connections.Connectors are responsible forpower transfers and information transfers among machines and people that are spread overdifferent locations. This is usually a mechanical or optical coupling device that provides a

    demountable connection between two fibers or a fiber and a source or detector. This componentconnects conductors of one circuit with those of another circuit. It is used to provide rapidconnection or disconnection mating with a personal computer board or another connector. Ahousing becomes a connector when it contains the specified number of contacts (withconductors) to make it functional.

    A connector is different from a splice. A splice is a device that joins conducting or transmittingmedia permanently; it is used to join physical media that conduct or transmit power or acommunication signal. Connectors join things temporarily, while splices are only done whenwires are to be permanently joined.

  • 8/19/2019 fcpc notes

    28/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Different electrical and electronic equipments have different set of wires and every wire has adifferent set of connectors. There are so many different types of connectors that it is oftendifficult to understand where it is to be fitted. Even worse, one may buy a replacement cable that

    simply has the wrong connectors. If the connectors don't fit, it is often possible to just replace theconnector rather then returning the entire piece of equipment. Advice from a good hardwareinstallation expert is recommended while troubleshooting any issues pertaining to connectors.

    When one buys a connector, one should enquire about its cost, its compatibility with otherconnectors, ease of use, the energy saving factor and the total number of connections possible.Connector technology is constantly expanding and laying new trends in the market and a buyer isadvised to always check these trends prior to choosing a conductor for specific equipment.Connector provides detailed information on Connectors, Electrical Connectors, Fiber OpticConnectors, USB Connectors and more.

    3. 

    Types of Connectors

    All electronic devices require a constant source of power to function and like all electronics evencomputers require power to function. Computer PSU is a term given to any the wires that thatconvert lethal electricity into usable and safe electricity. Each PSU requires connectors tofunction and this article is going to elaborate on the connectors used in these power supplies.

    The first one used in computer power supply is the P1 or the PC main connector. This connectorgoes right inside the mother board to supply it with electric power. This particular one has 20pins but some connectors have up to 24 pins. The PC main connector is the largest and mostimportant of all the computer's connectors.

    The 4 P Peripheral computer power supply connector is often called the Molex connector. Theseconnectors go into various drives located in the computer and most of these connectors have 4wires of black, red and yellow color. The 4P Peripheral is also used to supply additional power toFire Wire 800 and similar PCI cards.

    The serial ATA computer PSU connector is 15 pins and this connector is used for componentsthat use SATA power plugs. This is different from the rest since it supplies power at 3 differentvoltages with +12 volts being the highest and +3.3 volts being the lowest.

  • 8/19/2019 fcpc notes

    29/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Auxiliary computer power supply connectors provide additional power only when required andthese are often kept aside in case of an emergency. There are many types of Auxiliary powersupply connectors and depending on the requirement a person can choose from these different

    connectors. Other power supply connectors include the 6 pin, 6+2 pin, ATX12V, 4 pin berg andAc 14 connectors

    Lecture: 6

  • 8/19/2019 fcpc notes

    30/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Operating System Basics: Introduction to Operating system, Functions of an Operating

    system, Types of an Operating Systems.

    Contents

    1.  Introduction to Operating System

    2.  What does a Driver do of an Operating System

    3.  Functions of an Operating System

    4.  Operating System Concerns

    5.  Types of an Operating System

    Windows XP Professional EditionWindows XP Home Edition

    Windows 2000Windows MEWindows 98Windows NTWindows 95

    1.  Introduction to Operating System

    The operating system is the core software component of your computer. It performsmany functions and is, in very basic terms, an interface between your computer andthe outside world. In the section about hardware, a computer is described as

    consisting of several component parts including your monitor, keyboard, mouse, andother parts. The operating system provides an interface to these parts using what isreferred to as "drivers". This is why sometimes when you install a new printer orother piece of hardware, your system will ask you to install more software called adriver.

    2.  What does a Driver do of an Operating System

    A driver is a specially written program which understands the operation of the deviceit interfaces to, such as a printer, video card, sound card or CD ROM drive. Ittranslates commands from the operating system or user into commands understood by

    the the component computer part it interfaces with. It also translates responses fromthe component computer part back to responses that can be understood by theoperating system, application program, or user. The below diagram gives a graphicaldepiction of the interfaces between the operating system and the computercomponent.

  • 8/19/2019 fcpc notes

    31/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    3. 

    Functions of an Operating System

    The operating system provides for several other functions including:

    •  System tools (programs) used to monitor computer performance, debug problems, ormaintain parts of the system.

    •  A set of libraries or functions which programs may use to perform specific tasksespecially relating to interfacing with computer system components.

    The operating system makes these interfacing functions along with its other functions operatesmoothly and these functions are mostly transparent to the user.

    4.  Operating System Concerns

    As mentioned previously, an operating system is a computer program. Operating systems arewritten by human programmers who make mistakes. Therefore there can be errors in the codeeven though there may be some testing before the product is released. Some companies havebetter software quality control and testing than others so you may notice varying levels of qualityfrom operating system to operating system. Errors in operating systems cause three main types ofproblems:

  • 8/19/2019 fcpc notes

    32/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    •  System crashes and instabilities - These can happen due to a software bug typically in theoperating system, although computer programs being run on the operating system canmake the system more unstable or may even crash the system by themselves. This varies

    depending on the type of operating system. A system crash is the act of a system freezingand becoming unresponsive which would cause the user to need to reboot.

    •  Security flaws - Some software errors leave a door open for the system to be broken intoby unauthorized intruders. As these flaws are discovered, unauthorized intruders may tryto use these to gain illegal access to your system. Patching these flaws often will helpkeep your computer system secure. How this is done will be explained later.

    •  Sometimes errors in the operating system will cause the computer not to work correctlywith some peripheral devices such as printers.

    5.  Types of an Operating System

    There are many types of operating systems. The most common is the Microsoft suite of operatingsystems. They include from most recent to the oldest:

    •  Windows XP Professional Edition - A version used by many businesses onworkstations. It has the ability to become a member of a corporate domain.

    •  Windows XP Home Edition - A lower cost version of Windows XP which is for homeuse only and should not be used at a business.

    •  Windows 2000 - A better version of the Windows NT operating system which workswell both at home and as a workstation at a business. It includes technologies whichallow hardware to be automatically detected and other enhancements over Windows NT.

    •  Windows ME - An upgraded version from windows 98 but it has been historicallyplagued with programming errors which may be frustrating for home users.

    •  Windows 98 - This was produced in two main versions. The first Windows 98 versionwas plagued with programming errors but the Windows 98 Second Edition which cameout later was much better with many errors resolved.

    •  Windows NT - A version of Windows made specifically for businesses offering bettercontrol over workstation capabilities to help network administrators.

    •  Windows 95  - The first version of Windows after the older Windows 3.x versions

    offering a better interface and better library functions for programs 

  • 8/19/2019 fcpc notes

    33/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Lecture: 7

    Basic introduction to DOS, UNIX/LINUX OS, Windows XP.

    Contents

    1.  Introduction to DOS

    2.  Basic DOS Commands

    3.  Introduction to UNIX OS

    4.  Introduction to LINUX OS

    5.  Basic UNIX/LINUX Commands

    6.  Introduction to Windows XP

    1.  Introduction to DOS

    This is about the family of operating systems for IBM PC-compatible computers. For other

    uses, see DOS (disambiguation). DOS, short for "Disk Operating System", is an acronym for

    several closely related operating systems  that dominated the IBM PC compatible  market

    between 1981 and 1995, or until about 2000 if one includes the partially DOS-based

    Microsoft Windows versions 95, 98, and Millennium Edition. Related systems include MS-

    DOS, PC-DOS, DR-DOS, FreeDOS, PTS-DOS, ROM-DOS, JM-OS, and several others. In

    spite of the common usage, none of these systems were simply named "DOS" (a name given

    only to an unrelated IBM mainframe operating system in the 1960s). A number of unrelated,

    non-x86  microcomputer disk operating systems had "DOS" in their name, and are often

    referred to simply as "DOS" when discussing machines that use them (e.g. AmigaDOS,

    AMSDOS, ANDOS, Apple DOS, Atari DOS, Commodore DOS, CSI-DOS, ProDOS, and

    TRS-DOS). While providing many of the same operating system  functions for their

    respective computer systems, programs running under any one of these operating systems

    would not run under others.

    2.  Basic DOS Commands

    Changing the default drive

    To change the default drive, type the desired drive letter followed by a carriage return. DOS will

    respond with a prompt that gives the desired drive as the default.

    Directories

    To obtain a listing of the files on the default drive (a directory), give the command:

    A>dir

  • 8/19/2019 fcpc notes

    34/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    To a listing of the files on another drive, type:

    A>dir a:

    to see, for example, which files are on the A disk. You could, of course, first make A the defaultdrive and then give the previous command, but this is more cumbersome. This exampleillustrates a general feature of DOS. Unless you specify otherwise, DOS assumes that it will bedealing with the default drive. You can perform most operations without changing the defaultdrive by specifing another drive letter at the appropriate spot.

    Specifying a filename

    Most DOS commands require you to specify one or more filenames. Valid filenames are

    composed of up to eight characters and are optionally followed by an extension of up to three

    characters. The filename and extension are separated by a period. Some examples of DOSfilenames are:

    sst.exedemo.cmd junk

    Extensions can be used to remind you what the file contains. SST uses the extension `.cmd' forfiles of SST commands and the extension `.sav' for SST system files.

    Copying files

    Frequently you will want to make a copy of a file. To copy a file (named oldfile) to a new file

    named newfile, enter:

    A>copy oldfile newfile

    The file newfile will have exactly the same contents as the file oldfile. As always, DOS assumesoldfile is on the default drive and also places newfile on the default drive. The syntax of DOScommands when two filenames are required is usually "from to", i.e. the first filename is thesource (or "from") file and the second is the destination (or "to") file.

    To copy a file from one disk to another, it is only necessary to precede the filename by a drive

    designation. If you are copying files between disks, then the copy can have the same filename asthe original. In fact, if you do not supply a filename for the destination, DOS assumes that youwant to use the same filename as the source. For example, if B is the default drive, the followingcommand makes a copy of the file oldfile from the A disk on the B disk with the same name:

    B>copy a:oldfile

    On the other hand, if oldfile is on B (the default drive) and you would like a copy on the A disk,type:

  • 8/19/2019 fcpc notes

    35/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    A>copy oldfile a:

    (It is not necessary to precede oldfile with a drive designation since it is on the default drive.) Ifthere is already a file named oldfile on A (the destination drive), it will be overwritten.

    Abbreviating filenames in DOS

    DOS allows you to use a simple scheme of wild cards to refer to multiple filenames without

    having to type out the entire list of filenames that you want. There are two wild cards, the

    question mark and the asterisk. A question mark matches any character while an asterisk matches

    any string of characters. Changing the default drive

    To change the default drive, type the desired drive letter followed by a carriage return. DOS will

    respond with a prompt that gives the desired drive as the default.

    Directories

    To obtain a listing of the files on the default drive (a directory), give the command:

    A>dir

    To a listing of the files on another drive, type:

    A>dir a:

    to see, for example, which files are on the A disk. You could, of course, first make A the defaultdrive and then give the previous command, but this is more cumbersome. This exampleillustrates a general feature of DOS. Unless you specify otherwise, DOS assumes that it will bedealing with the default drive. You can perform most operations without changing the defaultdrive by specifing another drive letter at the appropriate spot.

    Specifying a filename

    Most DOS commands require you to specify one or more filenames. Valid filenames are

    composed of up to eight characters and are optionally followed by an extension of up to three

    characters. The filename and extension are separated by a period. Some examples of DOS

    filenames are:

    sst.exedemo.cmd junk

    Extensions can be used to remind you what the file contains. SST uses the extension `.cmd' forfiles of SST commands and the extension `.sav' for SST system files.

  • 8/19/2019 fcpc notes

    36/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Copying files

    Frequently you will want to make a copy of a file. To copy a file (named oldfile) to a new file

    named newfile, enter:

    A>copy oldfile newfile

    The file newfile will have exactly the same contents as the file oldfile. As always, DOS assumesoldfile is on the default drive and also places newfile on the default drive. The syntax of DOScommands when two filenames are required is usually "from to", i.e. the first filename is thesource (or "from") file and the second is the destination (or "to") file.

    To copy a file from one disk to another, it is only necessary to precede the filename by a drivedesignation. If you are copying files between disks, then the copy can have the same filename as

    the original. In fact, if you do not supply a filename for the destination, DOS assumes that youwant to use the same filename as the source. For example, if B is the default drive, the followingcommand makes a copy of the file oldfile from the A disk on the B disk with the same name:

    B>copy a:oldfile

    On the other hand, if oldfile is on B (the default drive) and you would like a copy on the A disk,type:

    A>copy oldfile a:

    (It is not necessary to precede oldfile with a drive designation since it is on the default drive.) Ifthere is already a file named oldfile on A (the destination drive), it will be overwritten.

    Abbreviating filenames in DOS

    DOS allows you to use a simple scheme of wild cards to refer to multiple filenames without

    having to type out the entire list of filenames that you want. There are two wild cards, the

    question mark and the asterisk. A question mark matches any character while an asterisk matches

    any string of characters. For example, `s?t' matches `sat', `sst', and `st'. Similarly, `s*t' would

    match each of the previous names as well as `short', `s123.45t'. The abbreviation `*.sav' would

    match any filename with the extension `.sav' (i.e., any SST system file), while `*' (or,

    equivalently, `*.*') would match any filename.

    To obtain a listing of all the files on the A drive with the extension `.sav', type:

    B>dir a:*.cmd

    To copy all files from A to B, you could use the command:

    C>copy a:*.* b:

  • 8/19/2019 fcpc notes

    37/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    SST uses a similar scheme of wild cards to abbreviate variable names.

    Listing the contents of a file on the monitor

    To display the contents of a text file on the monitor, you can use the DOS type command which

    has the following syntax:

    A>type filename

    As always, if the filename is not preceded by a drive specification, DOS assumes the file is onthe default drive. To type a file on the A drive, use instead:

    B>type a:filename

    Not all files in DOS are textfiles. Files with the extension `.exe' or `.com' are executableprograms stored in a binary format which cannot be typed.

    To stop scrolling output on the screen

    If you attempt to type a large file, it is apt to scroll down the screen faster than you are able to

    read it. To stop scrolling, press the and the keys simultaneously. To restart

    output, press the and keys again.

    To print what is on the screen

    If you have a printer connected to your computer and you would like a "hard" copy of what is

    currently on the screen, depress the and keys simultaneously, and DOSwill send a copy of what is on the screen to your printer. If you want to obtain a printed copy of

    the rest of your computer session, depress the and keys simultaneously. Further

    output will be sent to the printer as it appears on the screen. To stop printing depress these keys

    again.

    Subdirectories

    DOS allows you to organize disks into subdirectories--groupings of files in a tree structure. For

    most purposes a subdirectory on a disk is used as if it were a separate disk.

    To create a subdirectory named sst, type:

    C>mkdir sst

    The subdirectory sst now exists. There are two ways to access files in the subdirectory. First, youcan make the subdirectory the default directory in the same way that you make a disk drive thedefault drive. This is done by changing directories:

    C>cd sst

  • 8/19/2019 fcpc notes

    38/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    You are now located within the sst subdirectory. To obtain a listing of files in the sstsubdirectory, give the command:

    C>dir

    Unless you specify otherwise, DOS assumes that you only want a listing of files in the defaultsubdirectory--which is whatever subdirectory you happen to be located in at the time you issue acommand. To return to the main (or root) directory, give the command:

    C>cd \

    The backslash (`\') is DOS's symbol for the top directory.

    The other way to access files in a subdirectory is to provide DOS with a path telling it how tofind the file you are interested in. If you are in the root directory and you would like to see thecontents of a file in the sst subdirectory, try:

    C>type sst\filename

    Thus, it is not necessary to change directories to access a file in another directory.

    DOS allows you to create subdirectories in subdirectories so directory structures can becomerather complicated. We do not recommend this practice if you are a newcomer to DOS. For thepurposes of this manual we will assume that you do not have subdirectories to subdirectories.

    Specifying pathnames can become rather tedious and DOS provides a facility for specifyingwhich directories are to be searched for programs with the path command. If you type:

    C>path \;\sst

    DOS will search the root directory (\) and the sst subdirectory (\sst) when it looks for programsto execute. With the above path command, it is possible to execute sst, for example, withoutbeing located in the sst subdirectory.

    3.  Introduction to UNIX OS

    Unix operating systems are widely used in servers, workstations, and mobile devices. TheUnix environment and the client–server  program model were essential elements in thedevelopment of the Internet and the reshaping of computing as centered in networks ratherthan in individual computers.

    Both Unix and the C programming language were developed by AT&T and distributed togovernment and academic institutions, which led to both being ported to a wider variety ofmachine families than any other operating system. As a result, Unix became synonymouswith "open systems".

  • 8/19/2019 fcpc notes

    39/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    Unix was designed to be portable, multi-tasking  and multi-user  in a time-sharing configuration. Unix systems are characterized by various concepts: the use of plain text forstoring data; a hierarchical file system; treating devices and certain types of inter-process

    communication  (IPC) as files; and the use of a large number of software tools, smallprograms that can be strung together through a command line interpreter  using pipes, asopposed to using a single monolithic program that includes all of the same functionality.These concepts are collectively known as the Unix philosophy.

    Under Unix, the "operating system" consists of many of these utilities along with the mastercontrol program, the kernel. The kernel provides services to start and stop programs, handlesthe file system and other common "low level" tasks that most programs share, and, perhapsmost importantly, schedules access to hardware to avoid conflicts if two programs try toaccess the same resource or device simultaneously. To mediate such access, the kernel wasgiven special rights on the system, leading to the division between user-space and kernel-

    space.

    The microkernel  concept was introduced in an effort to reverse the trend towards largerkernels and return to a system in which most tasks were completed by smaller utilities. In anera when a "normal" computer consisted of a hard disk for storage and a data terminal  forinput and output (I/O), the Unix file model worked quite well as most I/O was "linear".However, modern systems include networking and other new devices. As graphical userinterfaces developed, the file model proved inadequate to the task of handling asynchronousevents such as those generated by a mouse, and in the 1980s non-blocking I/O and the set ofinter-process communication mechanisms was augmented (sockets, shared memory, messagequeues, semaphores), and functionalities such as network protocols were moved out of the

    kernel.

    4.  Introduction to LINUX OS

    Linux refers to the family of Unix-like computer operating systems using the Linux kernel.Linux can be installed on a wide variety of computer hardware, ranging from mobile phones,tablet computers  and video game consoles, to mainframes and supercomputers. Linux is aleading server operating system, and runs the 10 fastest supercomputers in the world.

    The development of Linux is one of the most prominent examples of free and open sourcesoftware collaboration; typically all the underlying source code can be used, freely modified,

    and redistributed, both commercially and non-commercially, by anyone under licenses suchas the GNU General Public License. Typically Linux is packaged in a format known as aLinux distribution for desktop and server use. Some popular mainstream Linux distributionsinclude Debian  (and its derivatives such as Ubuntu), Fedora  and openSUSE. Linuxdistributions include the Linux kernel and supporting utilities  and libraries  to fulfill thedistribution's intended use.

    A distribution oriented toward desktop use may include the X Window System, the GNOME and KDE Plasma  desktop environments. Other distributions may include a less resourceintensive desktop such as LXDE or XFCE for use on older or less-powerful computers. A

  • 8/19/2019 fcpc notes

    40/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    distribution intended to run as a server may omit any graphical environment from thestandard install and instead include other software such as the Apache HTTP Server and aSSH server like OpenSSH. Because Linux is freely redistributable, it is possible for anyone

    to create a distribution for any intended use. Commonly used applications with desktopLinux systems include the Mozilla Firefox  web-browser, the OpenOffice.org  officeapplication suite and the GIMP image editor.

    The name "Linux" comes from the Linux kernel, originally written in 1991 by LinusTorvalds. The main supporting user space system tools and libraries from the GNU Project (announced in 1983 by Richard Stallman) are the basis for the Free Software Foundation'spreferred name GNU/Linux.

    5.  Basic UNIX/LINUX Commands

    Files

    •  ls --- lists your filesls -l --- lists your files in 'long format', which contains lots of useful information, e.g. theexact size of the file, who owns the file and who has the right to look at it, and when itwas last modified.ls -a --- lists all files, including the ones whose filenames begin in a dot, which you donot always want to see.There are many more options, for example to list files by size, by date, recursively etc.

    •  more filename --- shows the first part of a file, just as much as will fit on one screen. Justhit the space bar to see more or q to quit. You can use /pattern to search for a pattern.

    •  emacs filename --- is an editor that lets you create and edit a file. See the emacs page.•  mv filename1 filename2 --- moves a file (i.e. gives it a different name, or moves it into a

    different directory (see below)•  cp filename1 filename2 --- copies a file•  rm filename --- removes a file. It is wise to use the option rm -i, which will ask you for

    confirmation before actually deleting anything. You can make this your default bymaking an alias in your .cshrc file.

    •  diff filename1 filename2 --- compares files, and shows where they differ•  wc filename --- tells you how many lines, words, and characters there are in a file•  chmod options filename --- lets you change the read, write, and execute permissions on

    your files. The default is that only you can look at them and change them, but you maysometimes want to change these permissions. For example, chmod o+r filename  willmake the file readable for everyone, and chmod o-r filename will make it unreadable forothers again. Note that for someone to be able to actually look at the file the directories itis in need to be at least executable. See help protection for more details.

    •  File Compressiono  gzip filename --- compresses files, so that they take up much less space. Usually

    text files compress to about half their original size, but it depends very much onthe size of the file and the nature of the contents. There are other tools for thispurpose, too (e.g. compress), but gzip usually gives the highest compression rate.Gzip produces files with the ending '.gz' appended to the original filename.

  • 8/19/2019 fcpc notes

    41/147

    UNIT 1

    World Institute Of Technology

    8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.Website : www.wit.net.in E-mail : [email protected] 

    o  gunzip filename --- uncompresses files compressed by gzip.o  gzcat filename  --- lets you look at a gzipped file without actually having to

    gunzip it (same as gunzip -c). You can even print it directly, using gzcatfilename | lpr 

    •  printingo  lpr filename --- print. Use the -P option to specify the printer name if you want to

    use a printer other than your default printer. For example, if you want to printdouble-sided, use 'lpr -Pvalkyr-d', or if you're at CSLI, you may want to use 'lpr -Pcord115-d'. See 'help printers' for more information about printers and theirlocations.

    o  lpq --- check out the printer queue, e.g. to get the number needed for removal, orto see how many other files will be printed before yours will come out

    o  lprm jobnumber --- remove something from the printer queue. Yo