Senin, 30 November 2009

What is Systems Programming?

Computer programming can be categorized into two categories .i.e

INPUT Process OUTPUT

While designing software the programmer may determine the required inputs for that program, the wanted outputs and the processing the software would perform in order to give those wanted outputs. The implementation of the processing part is associated with application programming. Application programming facilitates the implementation of the required processing that software is supposed to perform; everything that is left now is facilitated by system programming.

Systems programming is the study of techniques that facilitate the acquisition of data from input devices, these techniques also facilitates the output of data which may be the result of processing performed by an application.

Three Layered Approach

A system programmer may use a three layered approach for systems programming. As you can see in the figure the user may directly access the programmable hardware in order to perform I/O operations. The user may use the trivial BIOS (Basic Input Output System) routines in order to perform I/O in which case the programmer need not know the internal working of the hardware and need only the knowledge BIOS routines and their parameters.

DOS

BIOS

H/W

In this case the BIOS programs the hardware for required I/O operation which is hidden to the user. In the third case the programmer may invoke operating systems (DOS or whatever) routines in order to perform I/O operations. The operating system in turn will use BIOS routines or may program the hardware directly in order to perform the operation.

Methods of I/O

In the three layered approach if we are following the first approach we need to program the hardware. The hardware can be programmed to perform I/O in three ways i.e
1: Programmed I/O
2: Interrupt driven I/O
3:Direct Memory Access

In case of programmed I/O the CPU continuously checks the I/O device if the I/O operation can be performed or not. If the I/O operations can be performed the CPU performs the computations required to complete the I/O operation and then again starts waiting for the I/O device to be able to perform next I/O operation. In this way the CPU remains tied up and is not doing anything else besides waiting for the I/O device to be idle and performing computations only for the slower I/O device.

In case of interrupt driven the flaws of programmed driven I/O are rectified. The processor does not check the I/O device for the capability of performing I/O operation rather the I/O device informs the CPU that it’s idle and it can perform I/O operation, as a result the execution of CPU is interrupted and an Interrupt Service Routine (ISR) is invoked which performs the computations required for I/O operation. After the execution of ISR the CPU continues with whatever it was doing before the interruption for I/O operation. In this way the CPU does not remain tied up and can perform computations for other processes while the I/O devices are busy performing I/O and hence is more optimal.

Usually it takes two bus cycles to transfer data from some I/O port to memory or vice versa if this is done via some processor register. This transfer time can be reduced bypassing the CPU as ports and memory device are also interconnected by system bus. This is done with the support of DMA controller. The DMA (direct memory access) controller can controller the buses and hence the CPU can be bypassed data item can be transferred from memory to ports or vice versa in a single bus cycle.

I/O controllers

I/O device

I/O controller

CPU

No I/O device is directly connected to the CPU. To provide control signals to the I/O device a I/O controller is required. I/O controller is located between the CPU and the I/O device. For example the monitor is not directly collected to the CPU rather the monitor is connected to a VGA card and this VGA card is in turn connected to the CPU through busses. The keyboard is not directly connected to CPU rather its connected to a keyboard controller and the keyboard controller is connected to the CPU. The function of this I/O controller is to provide

1: I/O control signals
2: Buffering
3:Error Correction and Detection
We shall discuss various such I/O controllers interfaced with CPU and also the techniques and rules by which they can be programmed to perform the required I/O operation.

Some of such controllers are

  • DMA controller
  • Interrupt controller
  • Programmable Peripheral Interface (PPI)
  • Interval Timer
  • Universal Asynchronous Receiver Transmitter

We shall discuss all of them in detail and how they can be used to perform I/O operations.

Operating systems

Systems programming is not just the study of programmable hardware devices. To develop effective system software one needs to the internals of the operating system as well. Operating systems make use of some data structures or tables for management of computer resources. We will take up different functions of the operating systems and discuss how they are performed and how can the data structures used for these operations be accessed.

File Management

File management is an important function of the operating systems. DOS/Windows uses various data structures for this purpose. We will see how it performs I/O management and how the data structures used for this purpose can be directly accessed. The various data structures are popularly known as FAT which can be of 12, 16 and 32 bit wide, Other data structures include BPB(BIOS parameter block), DPB( drive parameter block) and the FCBs(file control block) which collectively forms the directory structure. To understand the file structure the basic requirement is the understanding of the disk architecture, the disk formatting process and how this process divides the disk into sectors and clusters.

Memory management

Memory management is another important aspect of operating systems. Standard PC operate in two mode in terms of memory which are

  1. Real Mode
  2. Protected Mode


In real mode the processor can access only first one MB of memory to control the memory within this range the DOS operating system makes use of some data structures called

  1. FCB (File control block )
  2. PSP (Program segment prefix)


We shall discuss how these data structures can be directly accessed, what is the significance of data in these data structures. This information can be used to traverse through the memory occupied by the processes and also calculate the total amount of free memory available.
Certain operating systems operate in protected mode. In protected mode all of the memory interfaced with the processor can be accessed. Operating systems in this mode make use of various data structures for memory management which are

  1. Local Descriptor Table
  2. Global Descriptor Table
  3. Interrupt Descriptor Table


We will discuss the significance these data structures and the information stored in them. Also we will see how the logical addresses can be translated into physical addresses using the information these tables



Viruses and Vaccines

Once an understanding of the file system and the memory Management is developed it is possible to understand the working of viruses. Virus is a simple program which can embed itself within the computer resources and propagate itself. Mostly viruses when activated would perform something hazardous.
We will see where do they embed themselves and how can they be detected. Moreover we will discuss techniques of how they can be removed and mostly importantly prevented to perform any infections.
There are various types of viruses but we will discuss those which embed themselves within the program or executable code which are
Executable file viruses
Partition Table or boot sector viruses
Device Drivers


Just connecting a device to the PC will not make it work unless its device drivers are not installed. This is so important because a device driver contains the routines which perform I/O operations on the device. Unless these routines are provided no I/O operation on the I/O device can be performed by any application.
We will discuss the integrated environment for the development of device drivers for DOS and Windows.

We shall begin our discussion from means of I/O. On a well designed device it is possible to perform I/O operations from three different methods

  1. Programmed I/O
  2. Interrupt driven I/O
  3. DMA driven I/O

In case of programmed I/O the CPU is in a constant loop checking for an I/O opportunity and when its available it performs the computations operations required for the I/O operations. As the I/O devices are generally slower than the CPU, CPU has to wait for I/O operation to complete so that next data item can be sent to the device. The CPU sends data on the data lines. The device need to be signaled that the data has been sent this is done with the help of STROBE signal. An electrical pulse is sent to the device by turning this signal to 0 and then 1. The device on getting the strobe signal receives the data and starts its output. While the device is performing the output it’s busy and cannot accept any further data on the other and CPU is a lot faster device and can process lot more bytes during the output of previously sent data so it should be synchronized with the slower I/O device. This is usually done by another feed back signal of BUSY which is kept active as long as the device is busy. So the CPU is only waiting for the device to get idle by checking the BUSY signal as long as the device is busy and when the device gets idle the CPU will compute the next data item and send it to the device for I/O operation.
Similar is the case of input, the CPU has to check the DR (data Ready) signal to see if data is available for input and when its not CPU is busy waiting for it.




Selasa, 05 Mei 2009

Digital Data Communication System

An Actual Digital Data Communication System Key Data Communication Terminology
Session: communication dialog between network users or applications
Different Types of this session for Info Exchange
Network: interconnected group of computers and communication devices
We will look into it in a little bit
Node: a network-attached device
Node can be any device in the network

Summary
  • Data Communication
  • Brief History of Communication
  • Data Communication System
  • Key Data Communication Terminology
Reading Sections
  • Section 1.2, “Data Communications and Networking” 2nd Edition by Behrouz A.Forouzan
  • Sections 1.1, 1.2, “Data and Computer Communication” 6th Edition by William Stallings

Selasa, 28 April 2009

A little more complex Comm System

A little more complex Comm System


  • User of a PC wishes to send a message ‘m’
  • User activates electronic mail package e.g hotmail
  • Enters the message via input device (keyboard)
  • Character string is buffered in main memory as a sequence of bits ‘g’
  • PC is connected to some trans system such as a Telephone Network via an I/O Transmitter like Modem
  • Transmitter converts incoming stream ‘g’ into a signal ‘s’
RECEIVER SIDE
  • The transmitted signal ‘s’ is subject to a number of impairments depending upon the medium
  • Therefore, received signal ‘r’ may differ from ‘s’.
  • Receiver attempts to estimate original ‘s’ based on its knowledge of the medium and received signal ‘r’
  • Briefly buffered in the memory
  • Data is presented to the user via an output device like printer, screen etc.
  • The data viewed by user m’ will usually be an exact copy of the data sent ‘m’
  • Receiver produces a bit stream g’(t)
  • Briefly buffered in the memory
  • Data is presented to the user via an output device like printer, screenetc.
  • The data viewed by user m’ will usually be an exact copy of the data sent ‘m’
EXAMPLE-Telephone System
  • Input to the Telephone is a message ‘m’ in the form of sound waves
  • The sound waves are converted by telephone into electric signals of the same frequency
  • These signals are transmitted w/o any modification over the telephone line
  • Hence g(t) and s(t) are identical
  • S(t) will suffer some distortion so that r(t) will not be the same as s(t)
  • R(t) is converted back to sound waves with no attempt of correction or improvement of signal quality
  • Thus m’ is not an exact replica of m

Selasa, 24 Februari 2009

Components of a Data Comm. Systems


Components of a Data Com Systems
Components of a Data Com Systems
Any system is made up of more than one component. Similarly, a data communication
system is made up of 5 components as shown in the fig:
  • Message
  • Sender
  • Receiver
  • Medium
  • Protocol
MESSAGE
  • Information or Data to be communicated
  • Can be text, numbers, video or any combination of these
  • In short anything that can be represented using binary bits
Data Communication Messages
Files (meaningful collections of records)
Data/information requests (database queries, Web page requests,
etc.)
Responses to requests and commands or error messages
Status messages (about the network’s functional status)
Control messages transmitted between network devices to control
network traffic
Correspondence among network users

MESSAGE TYPES
SENDER
  • Device that sends the data message
  • Can be a Computer , Workstation, Video camera etc
  • As already discussed, the data from the sender might not be in the appropriate format for the transmission medium and will need to be processed
RECEIVER
  • Device that receives the message
  • Can be a computer, workstation, Television etc
  • At times, the data received from the transmission medium may not be in a proper form to be supplied to the receiver and it must be processed
MEDIUM
  • Physical path that a message uses to travel from the Sender to the Receiver
  • Can be a Copper Cable (Telephone), Coaxial Cable (Cable TV), Fiber Optic Cable, LASERS or Radio Waves (Wireless Medium)
  • We will see that Data needs to be transferred in the form of ELECTROMAGNETIC signals and The Transmission Medium should be capable of carrying these EM Signals
Transmission Media

PROTOCOL
  • Set of Rules Governing Communication
  • Represents an Agreement between communication devices
  • Without Protocol, two devices may be connected but they will not be able to communicate
EXAMPLE: Consider the communication between two
individuals. They can only communicate provided they
both speak the same language.

Kamis, 08 Januari 2009

VAGUE DEFINITIONS We will clarify

Data Communication System
For Data Communication to occur, the communicating devices must be a part of a
communication system made up of some specific kind of hardware and software
This type of a system is known as a
“DATA COMMUNICATION SYSTEM”

Effectiveness of Data Comm. System
Effectiveness depends upon three fundamental characteristics:
  • Delivery
  • Accuracy
  • Timeliness (Better NEVER than LATE)
Example of the POSTAL MAIL

Selasa, 06 Januari 2009

TODAY’S EVERGHANGING & BUSY WORLD

  • Today’s fast world demands better, secure and most of all FAST ways of communication
  • Gone are the days when you had to wait a couple of weeks to get a letter from USA
  • Why wait ONE week when you can get the information you require in just a split of a second, using what we know by the name of “DATA COMMUNICATION”.
HOW TO ACHIEVE THIS?
  • How to achieve this ACCURACY, SECURITY and SPEED for the transfer of this information?
  • What HARDWARE, and the SOFTWARE is needed ?
  • And, what should be the MEANS of sending this info?
ARE SOME OF TOPIC WE WILL BE EXPLORING DURING THE COURSE OF
OUR STUDY

DATA COMMUNICATION
  • When we communicate , we share information
  • Information can be LOCAL or REMOTE
  • Between Individuals LOCAL communication occurs face to face
  • REMOTE communication occurs over a long distance
  • When we refer to COMPUTER SYSTEMS, Data is represented in the form of Binary Units (Bits) in the form of Zeros (0’s) and One’s (1’s)
  • Also the entities can most of the times be considered to be COMPUTERS
Data Communication Definition (Modified)

Therefore , our earlier definition can easily be modified to:
“Data Communication is the exchange of data (in the form of 0’s and 1’s)
between two devices (computers) via some form of the transmission medium.”


LOCAL and REMOTE Data Communication

LOCAL
Data communication is considered to be local if the communicating devices
are present in the same building or a similarly restricted geographical area
REMOTE
Data Communication is considered remote, if the devices are farther apart.



Senin, 05 Januari 2009

INTRODUCTION TO DATA COMMUNICATION

DEFINITION OF DATA COMMUNICATION
“Data Communication is the exchange of Information from one entity to the other
using a Transmission Medium”.

DEFINITION OF DATA COMMUNICATION (Cont’d)
As you can clearly notice, the definition of Data Communication although Simple
leaves many questions unanswered:
  • Exchange??????
  • Information?????
  • Entities???????
  • Transmission????
  • Medium????
We will try to answer all these Questions in this Course

History of Data Communication
Data communications history represents a blend of histories, including:
  • The history of the telecommunications industry
  • The history of data communications, and
  • The history of the Internet
  • Telegraph 1837 Samuel Morse
Telegraph 1837 Samuel Morse
Modern telecommunication industry began in 1837 with the invention of
the telegraph by Samuel Morse
This led to building a telecommunications infrastructure of poles and
wires as well as to the development of communication hardware and
protocols

Telephone 1876 Alexander Graham Bell
Invention of telephone by Alexander Graham Bell in 1876 and the
development of wireless communication technology by Guglielmo
Marconi in the 1890s set the stage for today’s communication industry

By 1950’s
By 1950s, telephone and telegraph companies had developed a network of
communication facilities throughout the industrialized world

1970’S
Although development of databases, languages, operating systems, and
hardware was strong from 1950s to 1970s, large-scale data communication
systems did not emerge until the 1970s.


This was stimulated by 3 major developments:

  • Large-scale integration of circuits reduced cost and size of terminals and communication equipment
  • New software systems that facilitated the development of data communication networks
  • Competition among providers of transmission facilities reduced the cost of data circuits