1- Introduction to Computer Systems

download 1- Introduction to Computer Systems

of 85

Transcript of 1- Introduction to Computer Systems

  • 8/10/2019 1- Introduction to Computer Systems

    1/85

    Introduction to Computer Systems

    The Objective of this course is to have an insight on what a computer is, how it works in

    collaboration with another computer or various devices that connect to it with or

    without wires. The collaboration of various physically and geographically distantcomputers serves as the medium for communication, information sharing and

    processing. This collaboration of computers forms a computing environment. In

    addition, this course explains the basics of system software and the different programs

    associated with system software like assemblers, compilers, loaders, linkers and

    interpreters.

    1.Introduction to Computer Technology Page No.

    1.1.hat is a !omputer "1.".!omponents in a !omputer #ystem $1.%.!omputer &anguage 1$

    2.Computer Organization and Architecture

    ".1. Organi'ation of a #mall !omputer 1(

    ".". )us %*

    ".%. +ddressing odes %1

    3.Systems Sot!are

    %.1. +ssembler %%

    %.". +ssembly &anguage %-%.%. &oaders and &inkers %

    %./. !ompilers /*

    %.-. Interpreters /1

    ".Introduction to Operating System

    /.1. )asic 0esources anaged by Operating #ystems //

    /.". 0esource #haring anagement -

    #.Computing $n%ironments

    -.1. ainframe !omputing nvironment $*

    -.". 2etworks $/

    -.%. Internet 3/

    -./. ebsites 3

    Page 1ASPIRE 2014 ( Introduction to Computer systems )

    https://campuscommune.tcs.com/communities/aspire-2014/content/1-introduction-to-computer-technologyhttps://campuscommune.tcs.com/communities/aspire-2014/content/2-computer-organization-and-architecturehttps://campuscommune.tcs.com/communities/aspire-2014/content/3-systems-softwarehttps://campuscommune.tcs.com/communities/aspire-2014/content/4introduction-to-operating-systemhttps://campuscommune.tcs.com/communities/aspire-2014/content/5-computing-environmentshttps://campuscommune.tcs.com/communities/aspire-2014/content/1-introduction-to-computer-technologyhttps://campuscommune.tcs.com/communities/aspire-2014/content/2-computer-organization-and-architecturehttps://campuscommune.tcs.com/communities/aspire-2014/content/3-systems-softwarehttps://campuscommune.tcs.com/communities/aspire-2014/content/4introduction-to-operating-systemhttps://campuscommune.tcs.com/communities/aspire-2014/content/5-computing-environments
  • 8/10/2019 1- Introduction to Computer Systems

    2/85

    1.Introduction to Computer Technology

    1.1. &hat is a Computer

    !omputers have become an indispensable part of our daily life. )e it connecting with our

    friends, shopping, gaming, booking tickets, getting the score updates, listening to music,

    watching movies as well as live T4 programs and so on 5refer 6igure 1.1, 1.", 1.% and 1./7.

    !omputers have made our life not only easy but more interesting as well. It is an advantage for

    us, that we are living in the period of such technological revolutions. #o, let us explore what

    !omputer Technology actually is and how it works.

    Page 2ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    3/85

    &hat is a Computer

    + computer is a machine that executes a set of arithmetic or logical instructions. The se8uence of

    these instructions can be changed to perform a variety of operations and get various outputs.

    6or example, it can perform arithmetic instructions 5instructions used for calculations7 like +dd,

    ultiply, #ubtract or 9ivide. It can calculate and store " : % ; - as result in the memory.

    &ogical instructions have some conditions that evaluate to either true or false 5called )oolean

    values7. )ased on these conditions they derive a result. 6or example, we want to calculate the

    grade of a student based on the total marks as follows< If total marks is greater than 1* then,

    =rade of #tudent should be +. lse if total marks is in between 1-* and 1* then =rade of

    #tudent should be ). Otherwise 5that is both the previous conditions evaluated to false7 the

    =rade of #tudent will be !. #o, if Tom has his total marks as 13- then, his grade will be ) as thesecond logical condition evaluates to true, in this case.

    If simply put, we can describe computer as an electronic device which takes some input like your

    name and birth date and displays your age. +lso it can remember your name and greet you the

    next time you start it. >ence it uses information to calculate results. +lso it stores and remembers

    information.

    6or example, if you have entered your name as Tom and birth date as 1st ?anuary 1((- and if the

    current year is "*1/, the computer will display the result as elcome Tom. @our age is 1( years.

    The evolution of !omputer Technology has been an interesting journey and starts with itspioneer !harles )abbage.

    !harles )abbage, the father of computer, designed the first automatic computing engine. It was

    to operate on steam and was called the 9ifference ngine 5refer 6igure 1.-7.

    Page 3ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    4/85

    >arvard arkAI 5refer 6igure 1.$7 computer was built as a partnership between >arvard and I)

    in 1(//. It was the first programmable digital computer made in the B.#.

    )ut it was not a purely electronic computer. The arkAI computer was constructed out of

    switches, clutches, relays and rotating shafts.

    The machine weighed - tons, contained -** miles of wire, was -1 feet long and feet tall, and

    had a -* ft rotating shaft, turned by a - horsepower electric motor.

    The first completely electronic computer is well known as 2I+! 5lectronic 2umerical

    Integrator +nd !alculator A refer 6igure 1.(7 and was developed by the Bniversity of

    Cennsylvania in 1(/$. This was followed by many evolutions and then came +pple I computer

    5refer 6igure 1.37 in 1(3$, which could be setup as a 9o It @ourself Dit.

    Page 4ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    5/85

    The computers that we use today is a transformation which was a result of the invention of the

    microprocessor. + microprocessor 5uC7 is a computer that is fabricated on an Integrated !ircuit

    5I! A refer =lossary and 6igure 1.7.

    It is a single integrated circuit that is sufficiently complex enough to perform the processing part

    of the information processing cycle 5that is the arithmetic and logical calculations discussed

    above in this section A by considering information like marks, we have derived the grade of a

    student7. In other words, it must have enough circuitry to process data, perform calculations, and

    facilitate interface with memory, input, output and storage devices 5refer section ".1.b for more

    details on Input, Output and #torage devices7.

    + microprocessor can perform calculation at a super speed with accuracy. 6or example, the

    following calculation is performed really fast producing accurate results.

    1/3%$(-" E -(%3./" E $(-%"./3 E $-(%.$-(; %((3""""*33(/1(1%-$3%.$(-(3(*/

    Page 5ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    6/85

    !omputers had been around for "* years before the first microprocessor was developed by Intel

    5one of the leading companies that manufactures hardware7 in 1(31. The micro in the name

    microprocessor refers to the small physical si'e. Intel did not invent the electronic computer. )ut

    they were the first to succeed in designing an entire computer on a single chip 5I!7.

    Thus Intel /**/, the first microprocessor 5uC7 came into existence. The /**/ consisted of "%**

    transistors and was clocked at 1* k>' 51*,*** times per second7. !ompare this to the /"

    million transistors and the " =>' clock rate 5",***,***,*** times per second7 used in a Centium

    /. Cioneer 1* spacecraft, the manAmade object farthest from the earth has IntelFs /**/ chips.

    Intel followed the /**/ with the ** and **.The Intel Centium / used in todayFs C!s is still

    compatible with the Intel * used in I)Fs first C!.

    In 1((% +pple released its first tablet computer named 2ewton essage Cad 1** and then iCad

    in "*1* followed by a series of tablets 5refer 6igure 1.(7 and we still have more innovations on

    the way.

    The evolution of computer has changed it from that of the si'e of a room to the one that fits in

    your palm with multiple times more computational ability and speed.

    6ew of the latest use of computer technology can be listed as below 5refer =lossary for details7.

    9igital #ignature 4erification

    2atural &anguage #peech to Text

    +ugmented 0eality

    !loud !omputing

    Chablets

    Page ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    7/85

    Omnidirectional Imaging

    #ocial 2etworking

    1.2. Components in a Computer System

    + computer consists of following componentsardware

    #oftware

    6irmware

    1.2.1. 'ard!are

    >ardware constitutes the tangible parts of computer like its keyboard, mouse, 4isual 9isplay

    Bnit 549B or monitor7, circuits etc. It is best described as all the physical parts of a computer,

    the parts you can actually see and touch.

    >ardware constitutes the following parts of computerere also the 6+T will only contain a single entry for each file, indicating

    file name and position of the first sector. It is easy to retrieve a single block because the

    information about its location is stored in the first block.

    The disadvantage of indexed allocation is that for each file an additional sector is needed to keep

    track of the location of a file. + very small file also always occupies at least two blocks, where as

    the data could have easily fit in one block. This results in secondary storage space wastage.

    Indexed allocation is implemented in all B2IM systems. It is reliable as well as fast. +lso,

    nowAaAdays, the wastage of storage space does not matter much.

    The main concern of file system management is to provide a strategy that lets the 6+T not to

    grow too large and that makes it possible to retrieve a special sector of file such that the storage

    space is not wasted much.

    ".1.d. +e%ice (anagement

    Operating system also deals with device management, specially input and output devices. In a

    multiAuser system, there are shared devices like printer, scanner, etc. anagement of these

    devices by sending them appropriate commands is the major task of operating system.+ software

    routine which knows how to deal with each device is called a VdriverW and operating system

    re8uires drivers for the peripherals attached to computer. hen a new peripheral is added, device

    driver is installed in to the operating system.Operating system also deals with the access time of

    these devices. It helps make the device access fast and in the most efficient way possible.ajorconcern of operating system in device management is to prevent dead lock situation.

    +ead 4oc)

    Page 5$ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    60/85

    +bove diagram depicts a typical dead lock situation, that serially used devices can have. 9ead

    lock is a situation where each set of processes is waiting for an event that only other process in

    the set can cause.

    6or example, in the above diagram, Crocess Task 1 re8uests a mutex or lock on object which isalready held by Crocess Task ". In turn, Crocess Task " needs a resource to complete its process

    which is already held by Crocess Task 1. #o neither of the processes are releasing their resources

    or mutex and waiting for another process to release a mutex so that they can get it to complete its

    pending task. This situation would cause an indefinite wait for processes leading to a situation

    known as dead lock.

    utex is the short form for utual xclusion Object. + mutex is a logical unit. It is a program

    object that allows multiple program threads to share the same resource, but not simultaneously.

    6ile access is an example of mutex. + mutex with uni8ue name is created when the program

    starts. utex must be locked by a thread that needs the resource. hen data is no longer needed,the mutex is set to unlock.

    O# helps in dealing with dead lock situation up to a certain extent. )elow are some of the

    strategies for dealing with deadlockard disk, main memory, etc are some of the examples of space

    multiplexing. These resources are most of the times divided e8ually between all the users.

    To summari'e, operating system is one of major programs, without which it would be almost

    impossible for us to access the computer as we are accessing it these days. ithout operating

    system, computer would be nothing but a monitor executing binary and machine language data.

    Page 2ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    63/85

    #.Computing $n%ironments

    #.1. (ainrame Computing $n%ironment

    !omputing nvironment is a collection of computers, software, and networks that support the

    processing and exchange of electronic information. It can collaborate across various software

    installed on different machines at different physical and geographical locations as well, such an

    environment is called 9istributed !omputing nvironment. 6igure -. 1 shows how different

    computers are connected with each other globally, also they can be connected with different

    devices like cell phones.

    !ritical applications 5refer glossary7 and bulk data processing re8uire computer environments

    which can guarantee high reliability and stability. ost such large scale,high end commercial

    system architectures 5refer glossary7 are referred as ainframes.

    (ainrame Computing $n%ironment

    It usually refers to one or more very big computer5s7 capable of supporting a large number of

    simultaneous users and doing bulk calculations and data processing. It is usually used for

    extensive operations like nterprise 0esource Clanning 5refer glossary7 or transaction processing.

    The ainframe environment 50efer 6igure -. "7 is expensive and ensures very high level of

    security and reliability supporting massive throughput 5refer glossary7 . 6or example consider

    banking applications like calculating balance of multiple customers who are doing their

    transaction simultaneously from different locations. +lso generating account statements for all

    customers at the end of every month. These are all bulk operations re8uiring speed and accuracy.

    ainframes have come a long way from the 2I+! 5lectronic 2umerical Integrator +nd

    !alculator7 developed in 1(/" to todayFs I) ' series of mainframes which are used in

    organi'ations like 2ational +eronautics and #pace +dministration 52+#+7.

    Page 3ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    64/85

    #oftware for mainframes are written in following languagesere, every character uses storage of one byte in

    memory.

    6or example, in )!9I!,

    The number 1 is represented as 1111 ***1.

    The number " is represented as 1111 **1*.

    #.1.2. (ainrame +atasets

    On a mainframe the information is stored in datasets 5files Arefer glossary 7. ach dataset should

    have an uni8ue name of maximum // characters long in this formatighAlevel Yualifier 5>&Y7.

    9atasets should have meaningful names. 6or example, !ustomers data should be stored

    in a file named !B#TO0.9+T+. >ere customer and data are the two segments or

    8ualifiers of your dataset name.

    To access or logAin to ainframes, we need a T#O 5refer glossary7 B#0AI9, which is similar touserAid that we use to login to a windows machine.

    #uppose your T#OAid is +=@*"%". #o give the >ighAlevel 8ualifier +=@*"%" to all your

    datasets. This way you can identify the datasets belonging to you.

    6or example, name your !ustomer dataset as +=@*"%".!B#TO0.9+T+.

    ainframes have #ecurity software products like 0+!65 0esource +ccess !ontrol 6acility7

    which control access to datasets. 6or example, you may want to grant readAonly access to the file

    +=@*"%".!B#TO0.9+T+ to other users. This will prevent other users from making anychanges to your dataset.

    #.1.3. (ainrame Programing

    >igh level language like !O)O& is used for ainframe programing. There are online

    mainframe compilers available as well as software like >ercules can be installed on any

    Operating #ystem to simulate a mainframe environment.

    I)Fs 4# Operating system5ultiple 4irtual #torage 5refer glossary7 7 up to release

    %.j5released in the year 1(17 is also available. I) provides a preAconfigured starter system inwhich you can do some coding to describe the configuration to be installed. This is called #ystem

    =eneration 5#ysgen7 that is, the process of setting up or installing an operating system on the

    mainframe.

    e can code !O)O&ACrograms and run them using a ?ob 5?!& L ?ob !ontrol &anguage7 on a

    ainframeA!omputer using its T#O BserAid for a given time. 0efer 6igure -. % for the basic

    Page 5ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    66/85

    skeleton of a !O)O& Crogram. + !O)O& program is written in structures called divisions.

    9ivisions in turn can have many sections. #ections can have many paragraphs.

    The ainframe terminal has * columns on a line for coding. The area from columns to 11 is

    called +rea +. The area between columns 1" to 3" is called +rea ). 0efer 6igure -. / for a

    sample program to display a message >ello orld.

    + !O)O& program has following divisions ere each node has the responsibility of propagating the data.

    Ad%antage

    This arrangement of the network nodes makes it is possible to transmit data from one

    node to many other nodes at the same time.

    +isad%antage

    In an arrangement where each node is connected to every other node of the network,

    many of the connections may serve no major purpose as they behave as redundant

    connections.

    ully Connected Net!or)

    ach node connects with all the other nodes in the network.

    Ad%antages

    + fault in one terminal on the network will not effect other nodes, as the data has multiple

    redundancy paths that can be used.

    9ata transfer rates can be kept at an acceptable level as whenever network usage is high

    the data can be transmitted via different route hence reducing network clogging.

    +isad%antage

    It re8uires a large amount of wiring.

    Page "4ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    75/85

    #.2.". Net!or) Programming

    !omputer network programming involves writing computer programs that communicate with

    each other across a computer network. e need two separate programs for this. The !lient

    program initiates the communication and The server program which waits or listens for the

    communication from client. )oth endpoints of the communication flow are called networksockets. 2etwork programming is also known as socket programming.

    2etwork Crograming can be implemented using any language which needs to provide following

    network layer functions. 0efer 6igure -.1%.

    socket57 creates a new socket, identified by an integer number, and allocates system

    resources to it.

    bind57 is used on the server side to associate a socket with a socket address structure, that

    is a specified local port number and IC address.

    listen57 is used on the server side and it causes a bound T!C socket to enter listening

    state.

    connect57 is used on the client side to assign a free local port number to a socket. 6or T!C

    socket, it causes an attempt to establish a new T!C connection.

    Page "5ASPIRE 2014 ( Introduction to Computer systems )

  • 8/10/2019 1- Introduction to Computer Systems

    76/85

    accept57 is used on the server side to accept a received incoming attempt to create a new

    T!C connection from the remote client. It creates a new socket associated with the socket

    address pair of this connection.

    send57Arecv57, write57Aread57 or sendto57Arecvfrom57 can be used to send and receive data

    toNfrom a remote socket.

    o The methods send57 and recv57 are used for sockets using T!C that is

    Transmission !ontrol Crotocol like >TTC. This mechanism has error checking

    and guarantees no data loss. It is used for all such applications where you can not

    allow data loss like browsing websites.

    o The methods sendto57 and recvfrom57 are used for sockets using B9C 5Bser

    9atagram Crotocol like 4oice over Internet Crotocol or 4OIC used to make phone

    calls using internet. This has lower level of security and does not guarantee that

    the data will reach its destination.7

    close57 causes the system to release resources that are allcated to a socket. The connection

    is terminated in case of T!C sockets.

    unlink57 removes the file names created for the socket. #o now the socket is removed and

    new socket with same name can be created when re8uired.

    #ome additional methods that can be used are as follows