You are on page 1of 20

Computer Concepts

Introduction to Computer System


Computer:
A computer is an electronic device that processes data, converting it into information that is
useful to people. A computer is controlled by programmed instructions, which give the machine a
purpose and tell it what to do.

A computer is a programmable device, usually electronic in nature that can store, retrieve, and
process data. The first programmable electronic computers date to the mid-20th century (around 1940 -
1941), although the concept and various non-electronic and analog models date back before this. Early
electronic computers were the size of a large room, and demanded huge amounts of power. Today,
computers are based upon tiny integrated circuits, are hundreds of millions to hundreds of billions of
times more powerful, and simpler computers can be made small enough to fit into a wrist watch and
powered by a simple watch battery.

A computer accepts the data and produces the desired output. In a nutshell, the computer does
the following tasks:
- Accepts the data
- Process or manipulate data
- Output the result
- Store the data, instructions and results.

Categorization of computers based on technology:


Based on the technology, the computers are broadly classified into two categories;
1. Digital Computers 2. Analog Computers

Digital computers:
Digital computers represent data as having one distinct value or another, with no other
possibilities. They accept the data and process the data in terms of digital, the binary digits 0 or 1. The
digital computers are more precise and reliable.
Data represented by binary bits 0s and 1s
Program controlled
Operations controlled by logic circuits
High quality data transmission
More precise and reliable
Ex: Modern day PCs, PDA etc.

Analog Computers:
Analog computers represent data as variable points along a continuous spectrum of values.
They accept the data whose values keep changing with respect to time. The data may be in the form of
continuous voltages, frequencies, temperature etc. The processing is done on these continuously
varying signals. Analog computers are more flexible than digital ones. Early analog computers were
mechanical devices, weighing several tons and using motors and gears to perform calculations.
Data represented in form of continuously variable electric currents and voltages
Not Program controlled
Operations controlled by operational amplifiers
No high quality data transmission
More flexible but less precise and reliable
Ex: Speedometer, thermometer, slide-rule etc.
Dept of Information Science & Engg, PESIT 1 Narendra U.P
Computer Concepts

Computer Hardware
Computer hardware is the physical part of a computer, including the digital circuitry, as
distinguished from the computer software that executes within the hardware. The hardware of a
computer is infrequently changed, in comparison with software and data, which are "soft" in the sense
that they are readily created, modified or erased on the computer. Firmware is a special type of
software that rarely, if ever, needs to be changed and so is stored on hardware devices such as read-
only memory (ROM) where it is not readily changed (and is, therefore, "firm" rather than just "soft").

A computer hardware’s devices falls onto the following four categories:

1. Processor
2. Memory
3. Input and Output
4. Storage
Functional Units of a Computer:
A general purpose computer has four main sections: the arithmetic and logic unit (ALU), the control
unit, the memory, and the input and output devices (collectively termed I/O). These parts are
interconnected by busses, often made of groups of wires.

The control unit, ALU, registers, and basic I/O (and often other hardware closely linked with these) are
collectively known as a central processing unit (CPU). Early CPUs were comprised of many separate
components but since the mid-1970s CPUs have typically been constructed on a single integrated
circuit called a microprocessor.

System Unit
CPU
ALU

Input Unit Control Unit Output Unit

Memory
Main Memory

Secondary Memory
Control Line

Data Line

Dept of Information Science & Engg, PESIT 2 Narendra U.P


Computer Concepts

Control Unit:
The control unit (often called a control system or central controller) directs the various
components of a computer. It reads and interprets (decodes) instructions in the program one by one.
The control system decodes each instruction and turns it into a series of control signals that operate the
other parts of the computer. Control systems in advanced computers may change the order of some
instructions so as to improve performance. The following functions are performed by the Control Unit:
• Fetching data and instructions from the main memory
• Interpreting these instructions
• Controlling the transfer of data and instructions to and from the main memory
• Controlling input and output devices
• Overall supervision of computer systems

Arithmetic Logic Unit:


The ALU is capable of performing two classes of operations: arithmetic and logic. It consists of
an electronic circuitry which performs a base arithmetic operation. It also consists of a logic circuitry
which performs logical operations.

Memory:
A computer's memory is a storage device and can be viewed as a list of cells into which
numbers can be placed or read. Each cell has a numbered "address" and can store a single number. The
computer can be instructed to "put the number 123 into the cell numbered 1357" or to "add the number
that is in cell 1357 to the number that is in cell 2468 and put the answer into cell 1595". The
information stored in memory may represent practically anything. Letters, numbers, even computer
instructions can be placed into memory with equal ease. Since the CPU does not differentiate between
different types of information, it is up to the software to give significance to what the memory sees as
nothing but a series of numbers. Computer memory is classified into:
• Main memory
• Secondary memory
• Cache memory

Input/Output Devices:
I/O is the means by which a computer receives information from the outside world and sends
results back. Devices that provide input or output to the computer are called peripherals. On a typical
personal computer, peripherals include input devices like the keyboard and mouse, and output devices
such as the display and printer. Hard disks, floppy disks and optical discs serve as both input and
output devices. Computer networking is another form of I/O.

Processing Devices
The processing of data uses two components – Processor and Memory.
Processor:
The brain of the computer that organizes and carries out instructions that comes from either the user or
the software. A Central Processing Unit (CPU) or simply a Processor is the component in a Digital
Computer that interprets instructions and processes data contained in computer programs.

Dept of Information Science & Engg, PESIT 3 Narendra U.P


Computer Concepts

CPUs provide the fundamental digital computer trait of programmability, and are one of the necessary
components found in computers of any era, along with primary storage and input/output facilities. A
CPU that is manufactured using integrated circuits is known as a microprocessor.

Microprocessor:
A microprocessor (sometimes abbreviated µP) is a digital electronic component with transistors on a
single semiconductor integrated circuit (IC). One or more microprocessors typically serve as a central
processing unit (CPU) in a computer system or handheld device.

Microprocessors made possible the


advent of the microcomputer. Before
this, electronic CPUs were typically
made from bulky discrete switching
devices (and later small-scale integrated
circuits) containing the equivalent of
only a few transistors. By integrating the
processor onto one or a very few large-
scale integrated circuit packages
(containing the equivalent of thousands
or millions of discrete transistors), the
cost of processor power was greatly
reduced.

Since the advent of the IC in the mid-1970s, the microprocessor has become the most
prevalent implementation of the CPU, nearly completely replacing all other forms.
The microprocessor is plugged into the computer’s motherboard.

Motherboard:

A motherboard, also known as a mainboard, system board, or logic boards on Apple


Computers, and sometimes abbreviated as mobo (generally credited to the magazine

Dept of Information Science & Engg, PESIT 4 Narendra U.P


Computer Concepts

Maximum PC). It is the central or primary circuit board making up a complex electronic
system, such as a computer.

A typical computer is built with the microprocessor, main memory, and other basic
components on the motherboard. Other components of the computer such as external
storage, control circuits for video display and sound, and peripheral devices are typically
attached to the motherboard via ribbon cables, other cables, and power connectors.

Memory Devices
Memory is one or more sets of chips that store data and/or program instructions, either
temporarily or permanently. The two most important used memory are Random Access
memory(RAM) and Read-only-Memory(ROM).

Random Access Memory:

Random-access memory (usually known by its acronym, RAM) refers to data storage
formats and equipment that allow the storing data to be accessed in any order — that is,
at random, not just in sequence. In contrast, other types of memory devices (such as
magnetic tapes, disks, and drums) can access data on the storage medium only in a
predetermined order due to constraints in their mechanical design.

Dept of Information Science & Engg, PESIT 5 Narendra U.P


Computer Concepts

Generally, RAM in a computer is considered main memory (or primary storage):


the working area used for loading, displaying and manipulating applications and data.
This type of RAM is usually in the form of integrated circuits (IC). These are commonly
called memory sticks or RAM sticks because they are manufactured as small circuit
boards with plastic packaging and are about the size of a few sticks of gum. Most
personal computers have slots for adding and replacing memory chips.

Å Samsung 512 MB DDR-SDRAM


module on motherboard.

Most RAM can be both written to and


read from, so "RAM" is often used
interchangeably with "read-write
memory." In this sense, RAM is the
opposite of Sequential Access Memory.

Early main memory systems built from vacuum tubes behaved much like modern RAM,
except that they failed frequently. Core memory, which used wires attached to small
ferrite electromagnetic cores, also had roughly equal access time. The term “core” is still
used by some programmers to describe the RAM main memory of a computer. The basic
concepts of tube and core memory are used in modern RAM implemented with integrated
circuits.

Many types of RAM are volatile, which means that unlike some other forms of computer
storage such as disk storage and tape storage, they lose all data when the computer is
powered down. Modern RAM generally stores a bit of data as either a charge in a
capacitor, as in dynamic RAM, or the state of a flip-flop, as in static RAM.

Currently, several types of non-volatile RAM are under development, which will
preserve data while powered down. The technologies used include carbon nanotubes and
magnetic tunnel effect.

RAM has a tremendous impact on the speed and power of a computer. Generally, the
more RAM a computer has, the more it can do and the faster it can perform certain tasks.
The most common measurement unit for describing a computer’s memory is the byte.
Today’s personal computer’s generally have at least 256 million bytes (256MB)/ 512 MB
or more.

Units of Measure for Computer memory and storage:

A bit refers to a digit in the binary numeral system (base 2). For example, the number
10010111 is 8 bits long. Binary digits are almost always used as the basic unit of
information storage and communication in digital computing and digital information
theory.

Dept of Information Science & Engg, PESIT 6 Narendra U.P


Computer Concepts

A byte is a collection of bits, originally variable in size but now almost always eight bits.
Eight-bit bytes, also known as octets, can represent 256 values (28 values, 0–255). A
four-bit quantity is known as a nibble, and can represent 16 values (24 values, 0–15).

"Word" is a term for a slightly larger group of bits, but it has no standard size. It
represents the size of one register in a Computer-CPU. In the IA-32 architecture, 16 bits
are called a "word" (with 32 bits being a double word or dword), but other architectures
have word sizes of 8, 32, 64, 80 or others.

Units of Measure for computer Memory and Storage:

Name Symbol Approx Value Actual Value

Kilobyte KB 1000 1024


Megabyte MB 1000000 1048576
Gigabyte GB 109 1073741824
Terabyte TB 1012 1099511627776
Petabyte PB 1015
Exabbyte EB 1018
Zettabyte ZB 1021
Yottabyte YB 1024

Read-Only Memory (ROM):

Read-only memory (ROM) is a class of storage media used in computers and other
electronic devices. Because it cannot (easily) be written to, its main uses lie in the
distribution of firmware (software that is very closely related to hardware and not likely
to need frequent upgrading).

ROM permanently stores its data, even when the power


is shut off. It is called non-volatile memory because it
never looses its contents. ROM holds instructions that
the computer needs to operate. Whenever the
computer’s power is turned on, it checks ROM for
directions that help it start up, for information about its
hardware devices
An EPROM

Types of ROMs:
1. PROM - (Programmable Read-Only Memory) can be written to (programmed) via a
special device, a PROM programmer.
2. EPROMs (Erasable Programmable Read-Only Memory) can be erased by exposure to
ultraviolet light then rewritten via an EPROM programmer.

Dept of Information Science & Engg, PESIT 7 Narendra U.P


Computer Concepts

3. EAROMs (Electrically Alterable Read-Only Memory) can be modified a bit at a time,


but writing is intended to be an infrequent operation; most of the time the memory is used
as a ROM. EAROM may be used to store critical system setup information in a non-
volatile way.
4. EEPROM such as Flash memory (Electrically Erasable Programmable Read-Only
Memory) allow the entire ROM (or selected banks of the ROM) to be electrically erased
(flashed back to zero) then written to without taking them out of the computer (camera,
MP3 player, etc.).

Cache Memory:

A cache (pronounced "cash") is a collection of data duplicating original values stored


elsewhere or computed earlier, where the original data is expensive to fetch (due to slow access
time) or to compute, relative to the cost of reading the cache. In other words, a cache is a
temporary storage area where frequently accessed data can be stored for rapid access. Once the
data is stored in the cache, future use can be made by accessing the cached copy rather than re-
fetching or re-computing the original data, so that the average access time is lower. A
cache is a block of memory for temporary storage of data likely to be used again.

Storage Devices
The purpose of storage is to hold data permanently, even when the computer is turned off. The
Storage and the Memory, although functions similar, they work in different ways. Following are
the differences:
1. Storage has large capacity as compared to the Memory.
2. Storage retains the contents even when the power is off, whereas it disappears in the case
of memory.
3. Storage devices operate much slower than memory chips, but storage is much cheaper
than memory.
The 2 main types of Storage are: Magnetic and optical.

Magnetic Storage

The most common magnetic storage is the Magnetic Disc, which is a round, flat object that spins
around its center and housed inside a case. Read/Write heads are used to read data from the disk
or write onto the disk. The device that holds a disk is called a disk drive.

Optical Storage:

The Optical Storage is the device that uses lasers to read data from or write data to the reflective
surface of an optical disc.The CD-ROM is the most common type of optical storage device.
Compact discs can hold data of upto 700 MB or 80 minutes of audio. A CD-R (Recordable)
gives the option of creating CDs. A CD-RW (Re-Writable) lets the user to write multiple times.

Another popular technology is the Digital Video Disc (DVD), which is revolutionizing home
entertainment. DVDs can hold a minimum of 4.7 GB of data and as much as 17GB. The future
technology Blue-Ray gives a storage capacity of almost 30 GB to 60 GB.

Dept of Information Science & Engg, PESIT 8 Narendra U.P


Computer Concepts

Input and Output Devices


Input Devices – accept data and instructions from the user or from another computer system.
Output Devices – return processed data to the user or to another computer system.

Input Devices:
Keyboard – accepts letters, numbers, and commands from the users.
Mouse – Lets user select options from on-screen menus.
Trackball & Touchpad – varations of a mouse that enables user to drae or point on the screen.
Joystick – A swiveling lever mounted on a stationary base that is well suited for playing video
games.
Scanner – Copy page of text or a graphic into the computer’s memory.
Digital camera – Record still/moving images, and later view/edit on the computer.
Microphone – Enables user to input voice or music as data.

Output devices:
Monitor – When the user needs only to see the output.
Printer – When the user needs a hard copy of the document.
Speakers/ Headphones – To produce sounds.
Touch Screen – Acts both as an input device as well as output device.

A communication device also acts as both input device as well as output device. These devices
connect one computer to another – a process known as Networking.
Modems – enables computers to communicate through telephone lines or cable television
systems.
Network Interface Cards (NICs) – let users connect a group of computers to share data and
devices.

Von Neumann Architecture

Memory
MAR MDR

Input Unit Processing Unit Output Unit


ALU Temp

Control Unit

PC IR

Control Line

Data Line

Ref:
1. Peter Norton, Introduction to computers, 6th Edition, Tata McGraw Hill Pub
2. http://wikipedia.org

Dept of Information Science & Engg, PESIT 9 Narendra U.P


Computer Concepts

Von Neumann Architecture


The Von Neumann architecture is a computer design model that uses a processing unit
and a single separate storage structure to hold both instructions and data. It is named after
mathematician and early computer scientist John Von Neumann. The term “stored program
computer” is generally used to mean a computer of this design, although as modern computers
are usually of this type, the term has fallen into disuse.

The earliest computing machines had fixed programs. Some very simple computers still
use this design, either for simplicity or training purposes. For example, a desk calculator is a
fixed program computer. It can do basic mathematics, but it cannot be used as a word processor
or to run any applications. To change the program of such a machine, you have to re-wire, re-
structure, or even re-design the machine.

The idea of the stored-program computer changed all that. By creating instruction set
architecture and detailing the computation as a series of instructions (the program), the machine
becomes much more flexible. By treating those instructions in the same way as data, a stored-
program machine can easily change the program, and can do so under program control. A stored-
program design also lets programs modify themselves while running.

Memory Address Register:


The MAR is the register of a computer’s Control Unit that contains the address of a
register to fetch or store from or to the computer storage

Memory Data Register:


The MDR is the register of a computer’s Control Unit that contains the data to store in
the computer storage (e.g. RAM, ROM), or the data after a fetch from the computer storage.

Instruction Register:
In computing, an instruction register is the part of a CPU’s control unit that stores the
instruction currently being executed. In simple processors each instruction to be executed is
loaded into the instruction register which holds it while it is decoded, prepared and ultimately
executed, which can take several steps.

Program Counter:
The Program Counter is a register in a computer processor which indicates where the
computer is in its instruction sequence. The PC holds the address of the next instruction to be
executed. The PC is automatically incremented for each instruction cycle so that instructions are
normally retrieved sequentially from memory.

Dept of Information Science & Engg, PESIT 10 Narendra U.P


Computer Concepts

Operating Systems

An operating system (OS) is a computer program that manages the hardware and software
resources of a computer. At the foundation of all system software, the OS performs basic tasks
such as controlling and allocating memory, prioritizing system requests, controlling input and
output devices, facilitating networking, and managing files. It also may provide a graphical user
interface for higher level functions.

An Operating System is a program that controls the execution of an application program and acts
as an interface between the user and the computer hardware. It provides an interface in which a
user can execute programs in a convenient and efficient manner.

Functions of an OS:
1. File Management
The OS manages the secondary memory. It also manages the creation, deletion of files,
folders. Also the storing, retrieving, naming and protection of files are taken care of.
2. Device Management
The OS manages the peripheral devices. It manages the i/p, o/p and any failures of the
devices
3. Memory Management
The OS manages the primary Memory (RAM). It should ensure the sufficiency of
memory for program execution.
4. Security Management
The OS manages the security of the data. It protects the data from catastrophic failures,
corruption of data and prevention from illegal access.
5. Process Management
The OS manages the processes, which are the sequences of instructions executed by the
CPU. It is responsible for the creation, deletion, suspension, resumption, scheduling and
synchronization of processes.
6. Providing User Interface
Provide a friendly environment to the User to use the resources effectively.

What are the different types of Operating Systems?


1. Real Time OS
2. Single User/ Single Tasking OS
3. Single User/ Multitasking OS
4. Multi User/ Multi Tasking OS

Real-Time OS:
It is an OS required to run a real time applications. It may support multiple simultaneous tasks or
single tasking. A real time application is an application that responds to certain inputs extreme
quickly (milliseconds/ microseconds).
Ex: Medical diagnosis equipment, Life support systems, machinery, scientific instruments, and
Industrial systems.

Single User/ Single Tasking OS:


These OS allows a single User to perform only one task at a time. Any process can be executed
only after the completion of the current process.
Ex: MS-DOS, Palm-OS
Dept of Information Science & Engg, PESIT 11 Narendra U.P
Computer Concepts

Adv – Less memory space


Powerful or expensive computer not required
Disadv- One User at a time
Only one task at a time

Single User/ Multitasking OS:


These OS allows a single User to perform multiple tasks at a time. The multitasking has
increased the productivity as multiple jobs can be accomplished in a shorter time.
Ex: Microsoft Windows, Macintosh OS,
Adv- simultaneous task execution
Increased productivity
Easily switch between multiple programs
Disadv – Only one user supported
Large memory space
Increased complexity

Multi-user/ Multitasking OS:


These OS allows multiple users to use programs that are simultaneously running on a single
network server, termed Terminal Server.
Ex: UNIX, VMS, MVS (Mainframe OS)
Adv- Multiple access to the terminal server via the terminal client
Multiple programs can be run by multiple users
Simple changes on the server is only required rather than on every individual systems.

Disadv – Increased memory space


If network connection to the server is broken, no work can be done.

Providing User Interface


User interfaces are the services provided by the OS to enable the interaction between the User
and the hardware. The two common types of User Interfaces are the graphical and the command
line.

Command Line Interfaces (CLI):


CLI uses typewritten commands rather than graphical objects. The CLI interface displays in
character mode, which uses only alphanumeric and some simple symbols. The commands are
typed at a prompt at the screen.
Ex: MS-DOS
- Type all the commands
- Remembering command sis a tedious task
- Difficult to use

Graphical User Interfaces GUI):


GUI provides user various graphical objects viz., windows, menus, icons, buttons and other tools
to issue commands. This minimized the disadvantages of the CLI.
Ex: Windows
- Interaction easier with graphical representations
- Need not remember any commands
- Easy to Use
Dept of Information Science & Engg, PESIT 12 Narendra U.P
Computer Concepts

PC Operating Systems
The following section deals with the various types of Operating Systems.

DOS
DOS, or the Disk Operating System is the simplest OS, which uses CLI. This came into
prominence during 1980s with the appearance of IBM PC. The two versions of the DOS are: PC
DOS and MS DOS.
Advantages:
- Uses less memory space and storage space
- Simplicity
- Used as an Embedded OS to run simple and single tasking applications.
Disadvantages:
- Supports only one user at a time.
- Can run only one program at a time
- No build in support for networking
- Manually install drivers to install any new hardware components
- Limited RAM and storage space
- Supports only 16 bit programs
- Uses CLI, hence need to remember cryptic command names

Windows NT
Windows New Technology is a 32 bit OS, which was originally designed to succeed DOS. But
the complexity led it to be repositioned it as a high end OS for powerful workstations and
network servers used in business. It has two versions namely:
1.Windows NT Workstation –
Used in typical standalone PCs.
Supports networking
Used in Architectural firms, audio & video production studios and graphic studios
2.Windows NT Server
Runs on dedicated network servers

Windows 9x
It refers to the Windows 95/ 98/ Me series.

Windows 95:
Did not require separate installation of MS-Dos, unlike its predecessors (3.0/ 3.1/ 3.11 which ran
on top of DOS).
Contains 16 bit programming that supports older version of 3.x
First 32 bit processing- Exchange information in 32 bit pieces. i.e twice the speed of DOS
Improved multitasking
First OS to support Plug and Play standard for connecting new hardware.
Integrated Networking support
Improved GUI – ex: Taskbar & START buttons

Windows 98:
- Just an update to Win - 95
- Inclusion of IE with new feature Active Desktop – that lets users browse internet and local
computer in a similar manner.
Dept of Information Science & Engg, PESIT 13 Narendra U.P
Computer Concepts

Windows ME:
- Improved Multimedia capabilities
- Built in support for digital video editing
- Enhanced internet features
- Unstable unlike 95/98, hence subject to frequent crashes.

Windows 2000 Professional:


- UI features of Win 98
- Also supports file system, networking, power and stability of Win NT
- Designed primarily for PCs in offices and small businesses.
- Supports Symmetric multiprocessing (SMP) with up to 2 processors.

Windows XP:
- More 3D look with rounded corners and more shading
- 64 bit computing
- Digital Media support – Digital broadcast support, audio, video
- Advanced Networking and Communications –
Plug and Play support
Multiple Internet connection sharing –Single internet connection to multiple computers
- Advanced Mobile Computing – Connect cellular/ Laptops with automatic configuration
- Added security
- More robust OS

Macintosh OS:
- Works only on Macintosh computers
- Largely used by Publishers, Multimedia developers, graphic artists and schools.

UNIX for Desktop:


- Less used in Desktops.
- Users of CAD/ CAM
- Popular for high powered workstations.
- Uses CLI, cryptic instructions.
- Any simple tasks done by CLI

LINUX for Desktop:


- 32 bit multitasking OS
- Supports multiple users and multiple processors
- Can run on any computer and support almost any type of applications.
- Uses CLI and also GUI environments called SHELLS.
- Freely available
- Developers can contribute modifications and enhancements

Evolution of Operating Systems


Operating system and computer architecture have had a great deal of influence on each other. To
facilitate the use of the hardware, OS’s were developed. As operating systems were designed and
used, it became obvious that changes in the design of the hardware could simplify them.

Dept of Information Science & Engg, PESIT 14 Narendra U.P


Computer Concepts

Simple Batch Systems

When punched cards were used for user jobs, processing of a job involved physical actions by
the system operator, e.g., loading card, pressing switches etc. These actions wasted a lot of CPU
time. To speed up processing, jobs with similar needs were batched together and were run as a
group. Batch processing was implemented by a component of BP Systems, called batch monitor
in computers’ memory. The remaining memory was used to process a user job.

In a Simple batch system, users left jobs with the


operator and came back the next day for the results.
Users had no interaction with computer during
program execution. The delay between the job
submission and completion was considerable in
batch processed system as a number of programs
were put in a batch and the entire batch had to be
processed before the results were printed

Multi Programmed Batch Systems

Even though disks are faster than card reader/ printer


they are still two orders of magnitude slower than CPU.
It is thus useful to have several programs ready to run
waiting to run in the main program in the CPU. When
one program needs input/output from disk it is
suspended and another program whose data is already in
main memory is taken up for execution. This is called
Multiprogramming.

Multiprogramming increases CPU utilization by organizing jobs such that the CPU always has a
job to execute. Multiprogramming is the first instance where the OS must make a decision for
the user. It ensures concurrent operation of the CPU and I/O subsystem. It ensures that the CPU
is allocated to a program only when it is not performing an I/O operation.

Time Sharing System

Multiprogramming features were superimposed on Batch Programming to ensure good


utilization of CPU but from the point of view of a user the service was poor as the response time,
i.e., the time elapsed between submitting a job and getting the results was unacceptably high.

Dept of Information Science & Engg, PESIT 15 Narendra U.P


Computer Concepts

Development of interactive terminals changed the scenario. Computation became an on-line


activity. A user could provide inputs to a computation from a terminal and also examine the
output of the computation on the same terminal. Hence, the response time needed to be
drastically reduced. This was achieved by storing programs of several users in memory and
providing each user a slice of time on CPU to process his/her program.

Time sharing system provides a mechanism for


concurrent executions, which requires sophisticated
CPU scheduling schemes. To ensure orderly execution,
the system must provide, mechanism for job
synchronization and communication, and must ensure
that jobs do not get stuck.

Distributed Systems

A recent trend in computer system is to distribute


computation among several processors. The processors
in a distributed system may vary in size and function,
and referred by a number of different names, such as
sites, nodes, computers and so on. The processors
communicate with one another using communication
lines, such as an Ethernet.

The major reasons for building distributed systems are:

• Resource sharing: A user at one site may be able to use the resources at the other.
• Computation speed up: A computations may be divided into sub-computations and distribute
computations at various sites and run them concurrently.
• Reliability: Failure of one site still ensures potential continuation of operations.
• Communication: Programs can exchange data with one another.

The OS Shell
The OS Shell defines the interface between OS and Users. Windows GUI and UNIX Command
line are the examples for a Shell.

The OS Kernel
The internal part of the OS is often called the KERNEL. The Kernel Components are:
File Manager - Manages mass memory
Device Drivers – Communicate with peripherals
Memory Manager – Manages main memory
Scheduler – Manages processes
Dispatcher – Manages processes

Dept of Information Science & Engg, PESIT 16 Narendra U.P


Computer Concepts

Introduction to LINUX Environment

What is a Command Shell?


A Shell is a program that interprets commands. It allows a user to execute commands by typing
them manually at a terminal, or automatically in programs called shell scripts. A Shell is not an
operating system. It is a way to interface with the operating system and run commands.

What is BASH?
BASH = Bourne Again Shell
Bash is a shell written as a free replacement to the standard Bourne Shell (/bin/sh)
It has all of the features of the original Bourne Shell, plus additions that makes it easier to
program with and use from the command line.
Since it is free software, it has been adopted as the default shell on most Linux systems.
Executing Commands:

The Command PATH:


Most common commands are located on your Shell’s “PATH”, meaning that you can just type
the name of the program to execute it.
Example: Typing “ls” will execute the “ls” command.

Command Syntax
Commands can be run by themselves, or you can pass in additional arguments to make them do
different things. Typical command syntax can look something like this:

command [-argument] [-argument] [--argument] [file]


Examples: ls List files in current directory
ls –l List files in “long” format
ls –l --color As above, with colorized output
cat filename Show contents of a file
cat –n filename Show contents of a file, with line numbers

Getting Help

Availing of help on any LINUX commands is only a few keystrokes away.


1. Using a command’s Built in Help
Many commands have simple “help” screens that can be invoked with special command flags.
These flags usually look like “-h” or “--help".
Example: cat --help

2. Online Manuals: “Man Pages”


The best source of information for most commands can be found in the online manual pages,
known as “man pages” for short. To read a command’s man page, type “man command”.
Example: man ls Get help on the “ls” command
man man A manual about how to use the manual!

Commands for Navigating the LINUX File systems


The following Linux file system commands will a) tell you where you are, b) take you
somewhere else, and c) show you what’s there

Dept of Information Science & Engg, PESIT 17 Narendra U.P


Computer Concepts

LINUX Command Description


pwd “Print Working Directory”. Shows the current location in the directory tree.
cd “Change Directory”. When typed all by itself, it returns you to your home directory
cd directory Change into the specified directory name
Example: cd /usr/home
cd ~ “~” is an alias for your home directory. It can be used as a shortcut to your “home”
cd .. Move up one directory.
Example: If you are in /home/new and you type cd .. you will end up in /home
cd - Return to previous directory. An easy way to get back to your previous location
ls List all files in the current directory, in column format.
ls directory List all files in the specified directory
Example: ls /usr/new
ls –l List files in “long” format, one file per line. This also shows you additional info about
the file, such as ownership, permissions, date and size.
ls –a List all files, including “hidden” files. Hidden files are those files that begin with a “.”
Example: .bash_history file in your home directory
ls –ld directory A “long” list of “directory, but instead of showing the directory contents, show the
directory’s detailed information.
ls /home/d* List all files whose names begins with the letter “d” in the /home directory

Piping and Re-Direction


Piping Commands together
The Pipe character “|”, is used to chain two or more commands together. The output of the first
command is ”piped” into the next program, and if there is a second pipe, the output is sent to the
third program, etc. For example:

ls –la /home/new | less


In this example, we run the command “ls –ls ‘home/new”, which gives us a long listing of all of
the files in /home/new. Because the output of this command is typically very long, we pipe the
output to a program called “less”, which displays the output for us one screen at a time.

Redirecting Program Output to Files


If we want to save the output of a command to a file, instead of displaying it on the screen, we
can redirect it to a file. using the “>” redirection character. For example, if we want to create a
file that lists all of the MP3 files in a directory, we can do so by:
ls –l /home/MP3/*.mp3 > mp3files.txt
A similar command can be written so that instead of creating a new file called mp3files.txt, we
can append to the end of the original file:
ls –l /home/MP3/*.mp3 >> mp3files.txt

Working with Files and Directories

LINUX Command Description


file Find out what kind of file it is.
Example: file new.txt
cat Displays the contents of a text file on the screen.
Example: cat new.txt

Dept of Information Science & Engg, PESIT 18 Narendra U.P


Computer Concepts

head Displays the first few lines of a text file.


Example: head new.txt
tail Displays the last few lines of a text file.
Example: tail new.txt
tail -f Displays the first few lines of a text file, and then output appended data as the file
grows
Example: tail –f /var/log/messages
cp Copies a file from one location to another
Example: cp new.txt /prog (Copies the new.txt to /prog directory)
mv Moves a file to a new location, or renames it.
Example: mv new.txt /prog
(Copy the file to /prog, and delete it from the original location.)
rm Delete a file. Example: rm /prog/new.txt
mkdir Make directory. Example: mkdir /prog/myfiles/
rmdir Remove Directory. Example: rmdir /prog/myfiles/

Finding Things
LINUX Command Description
which Shows the full path of shell commands found in your path.
Example: which cat (Shows the path of cat command)
whereis Locates the program, source code, and manual page for a command.
Example: whereis ls (Finds out where ls command and its man page is)
locate A quick way to search for files anywhere on the filesystem
. Example: locate computer (Finds all files and directories containing name computer)
find A powerful command used to search for files matching certain patterns, as well as
many other types of searches.
Example: find . –name \*mp3
This starts searching in the current directory “,” and all sub directories, looking for files
with “mp3” at the end of their names.
Other Utilities

LINUX Command Description


clear clear the screen
echo Display text on the screen
Example: echo “Hello World”
more Display a file, or program output one page at a time
. Example: more new.txt
ls –la | more
less An improved replacement for the “more” command. Allows you to scroll backwards as
well as forwards.
grep Search for a pattern in a file or program output.
Example: grep “hello” new.txt
This looks for any line that contains the string “hello” in the file new.txt and displays
only those lines.
lpr Print a file or program output.
Examples: lpr new.txt - Prints the new.txt file
ls –la | lpr - Prints the output of the “ls –la” command
sort Sort a file or program output. Example: sort new.txt
Dept of Information Science & Engg, PESIT 19 Narendra U.P
Computer Concepts

LINUX Quick Reference

Command Task Command Task


File/ Directory Basics File Location
ls List files find Locate files
cp Copy files slocate Locate files via index
mv Rename files which Locate commands
rm Delete files whereis Locate standard files
ln Link files
cd Change Directory
pwd Print current Working Dir File Text Manipulation
mkdir Create Directory grep Search text for matching lines
rmdir Delete Directory cut Extract columns
paste Append Columns
File Viewing tr Translate Characters
cat View files sort Sort lines
less Page through files uniq Locate identical lines
head View file before beginning tee Copy stdin to a file and to
tail View file ending stdout simultaneously
nl Number lines
od View binary data
xxd View binary data File Compression
gv View Postscript/PDF files gzip Compress files (GNU Zip)
zip Compress files
File creation and Editing compress Compress files
emacs Text Editor
vim Text Editor
File comparison
File Properties diff Compare files line by line
stat Display File attributes comm. Compare sorted files
wc Count bytes/words/lines cmp Compare files byte by byte
du Measure disk usage
file Identify file types
touch Change file timestamps Disks and Filesystems
chown Change file owner df Show free disk space
chgrp Change File group mount Make a disk accessible
chmod Change file protections fsck Check a disk for errors
chattr Change advanced file attributes sync Flusj disk caches
lsattr List advanced file attributes

Dept of Information Science & Engg, PESIT 20 Narendra U.P

You might also like