Escolar Documentos
Profissional Documentos
Cultura Documentos
Prepared By
Prof. A.N.Bandal
Prof.S.M.Nalawade
TEACHING SCHEME
EXAMINATION SCHEME
PRACTICAL : 4 HRS/WEEK
1
Computer Department. SCOE VADGAON
PREFACE
: Tasm, Tlink
HARDWARE REQUIRED
OPERATING SYSTEM
: Windows-XP, Windows-98
GOAL OF LAB
2
Computer Department. SCOE VADGAON
CERTIFICATE
- 20
Staff In-charge
Head of Department
Principal
3
Computer Department. SCOE VADGAON
HARDWARE LAB
INDEX
Sr.
No
Title
Date of
Date of
Marks
Commencem
Submissi
Obtain
ent
on
ed
Signatu
1
2
3
4
5
6
7
8
9
10
11
Lab Lab Inovations
1
2
3
re
HARDWARE LAB
ASSIGNMENT NO: 1
HARDWARE LAB
The Program Segment Prefix (PSP) is a data structure used in DOS systems to store the
state of a program. It has the following structure:
Offset Size
Contents
00-01
2 bytes (code)
02-03
word (2 bytes)
04
byte
Reserved
05-09
5 bytes (code)
0A-0D dword (4 bytes) Terminate address of previous program (old INT 22)
0E-11 dword
12-15
dword
16-17
word
18-2B 20 bytes
2C-2D word
Environment segment
2E-31 dword
32-33
word
34-37
dword
38-4F
24 bytes
Reserved
50-52
3 bytes (code)
53-5B 9 bytes
Reserved
5C-6B 16 bytes
6C-7F 20 bytes
80
1 byte
2. About FCB: We will refer to set of file & record function that are compatible with CP/M as FCB
function. These function present on data structure called a file control block. To maintain
certain block keeping information about open files. This structure resides in the
application programs memory space. The FCB function allow the programmer to create,
open, close & delete files to read or write records of any size of any record position
written such files. These functions do not support the hierarchical file structure that was
HARDWARE LAB
first introduced in MS-DOS version 2.0. So, they can be used to access files in the current
subdirectory for a given disk device driver.
We use handle functions, the OS maintain the data structure that contain bookkeeping
information about the file inside its own memory space & these structures are not
accessible to the application program. The handle function fully support the hierarchical
file structure allowing the file programmer to create, open, close & delete files in any
subdirectory on any disk drive to read or write records of any size at any byte offset
within such files.
Using The FCB Functions:Understanding the function of file control block is the key to success with the FCB
family of file & record function. An FCB is a 37 byte data structure allocated within the
application programs memory space; it is divided into many field. Typically, the program
initialize an FCB with drive code, a filename & an extension & then passes the address of
the FSB. This information include with file exact size in bytes & the date & time of file
was created or last updated. MS-DOS also places certain other information within a
reserved area of the FCB, however this area is used by the operation system for its own
purpose & various among different version of MS-DOS.
For compatibility with PC/M MS-DOS automatically sets the record size field of FCB to
128 bytes. If program does not want to use this default record-size, it must place the
desired size into record, size field after open or create operation, subsequently when the
program record size needs to read or write records from the file, it must pass the address
of the FCB to MS-DOS. MS-DOS in turn keeps the FCB updated with information about
the current position of the pointer & the size of the file.
In general MS-DOS function that use FCBs accept the full address of the FCB in the
DS:DX register & pass back a return code in the AL register.
The handle file & record-managed calls may be gathered into the following broad
classification for study.
Function
Action
HARDWARE LAB
3 DH
Open File
3 EH
Close File
3 FH
Read File
40 H
Write File
Delete File
43 H
44 H
45 H
Duplicate Handle
46 H
Redirect Handle
56 H
Rename File
57 H
5AH
5BH
Create File
5CH
67H
68H
Commit File
6CH
Handle File Access Skeleton :The following is a typical program sequence to access file using the handle family of
function.
1] Get filename from user by mean of buffered i/p service or from the command tail
supplied by MS-DOS in the PSP.
2] Put a zero at the EOF specification in order to create an ASCII string.
3] Open the file using INT 21H function 3DH & mode2 (create/write) or create the file
using INT 21 function 3CH. Save the file that is returned.
HARDWARE LAB
4] Set the pointer using INT 21 function 42H. You may set the file pointer position
relative to one of three different locations, the start of file, the current pointer position or
the end of file.
5] Read from the file (INT 21H function 3 FH) or write to the file (INT 21H function
40H). Both of these function requires that the BX register contain the file handle, the CX
register contain the length of the record on the DS:DX registers point to the data being
transferred.
In read operation if file no of bytes read is less than no of requested, the End Of File has
been reached. In a write operation if no of byte returned is less than the no of required the
disk containing the file is full. Neither of these condition is required as an error code, i.e.
carry flag is not set.
6] If the program is not finished processing the file go to step 4 otherwise close the file
(INT 21H function 3EH). Any normal exit from the program will also close file all active
handles.
ALGORITHM:
I.
Create a file:
a) Algorithm:
1) Start
2) Initialize data segment
3) Display message to create file.
4) Set attribute of file.
5) Create file.
6) Stop.
II.
Rename a File:
a) Algorithm:
1) Start
2) Initialize data segment
3) Display message to create file.
HARDWARE LAB
4) Rename file.
5) Stop.
III.
Input File:
a) Algorithm:
1) Start
2) Initialize data segment
3) Display message to create file.
4) Set attribute of file.
5) Open file.
6) Write file.
7) Close file
8) Stop.
IV.
Display a File:
a) Algorithm:
1) Start
2) Initialize data segment
3) Open file.
4) Write file.
5) Read file
6) Stop.
V.
Delete a File :
a) Algorithm:
1) Start
2) Initialize data segment
3) Open file..
4) Delete file
5) Stop.
HARDWARE LAB
HARDWARE LAB
CONCLUSION:
________________________________________________________________
________________________________________________________________
________________________________________________________________
HARDWARE LAB
ASSIGNMENT NO: 2
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7
Syntax
Copies one or more files to another location.
HARDWARE LAB
COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A
| /B]] [/V] [/Y | /-Y]
Examples
copy *.* a:
Copy all files in the current directory to the floppy disk drive.
File handling and Record-managing calls: The handle file & record-managed calls may be gathered into the following broad
classification for study.
Function
Action
3 DH
Open File
3 EH
Close File
HARDWARE LAB
3 FH
Read File
40 H
Write File
Delete File
43 H
44 H
45 H
Duplicate Handle
46 H
Redirect Handle
56 H
Rename File
57 H
5AH
5BH
Create File
5CH
67H
68H
Commit File
6CH
ALGORITHM:
VI.
Create a file:
a) Algorithm:
1) Start
2) Initialize data segment
3) Display message to create file.
4) Set attribute of file.
5) Create file.
6) Stop.
VII.
Rename a File:
a) Algorithm:
1) Start
2) Initialize data segment
HARDWARE LAB
Input File:
a) Algorithm:
1) Start
2) Initialize data segment
3) Display message to create file.
4) Set attribute of file.
5) Open file.
6) Write file.
7) Close file
8) Stop.
IX.
Display a File:
a) Algorithm:
1) Start
2) Initialize data segment
3) Open file.
4) Write file.
5) Read file
6) Stop.
X.
Delete a File :
a) Algorithm:
1) Start
2) Initialize data segment
3) Open file..
4) Delete file
5) Stop.
HARDWARE LAB
HARDWARE LAB
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
CONCLUSION:
________________________________________________________________
________________________________________________________________
________________________________________________________________
ASSIGNMENT NO: 3
TITLE:
Study of floppy
a) Boot record
PLATFORM:
DOS/Win-98
THEORY:
BOOT RECORD:
Computer Department. SIT, Lonavala
HARDWARE LAB
The boot record contains the instructions that load (or "boot") system files (if present)
from disk into memory. All formatted disks contain a boot record even if the system files
are not stored on it.
HARDWARE LAB
Cylinder:
-
A cylinder is a vertical set of all of the tracks with the same number on each
surface of a diskette or hard disk. Thus cylinder 0 is the set of all tracks numbered
0 on every side, cylinder 1 is the set of all tracks numbered I, and so forth. For a
diskette, then, cylinder 0 consists of track 0 on side 1 and track 0 on side 2;
cylinder I consists of track 1 on side 1 and track 1 on side 2; and so forth. Side
number and head are the same; for example, disk head 1 access the data on side 1.
Each track, and thus each cylinder, on a modern HDD has a width of only a few
microns (i.e., millionths of a meter). There can be tens of thousands of tracks on
each platter, and thus the same number of cylinders in the HDD.
HARDWARE LAB
Arm assembly
Physical Sector:
A smallest unit to store data on disk of capacity 512 bytes.
Relative sector:
Sectors are numbered relative to the start of the disk so that first on the disk,on
cylinder 0, track 0 is addressed as relative sector 0.
DISK CONTROLLER:
The disk controller, which is located between the processor and the disk drive,
handles all communication between them. The controller accepts data from the
processor and converts the data into a form that is usable by the device.
HARDWARE LAB
The role of the controller is to provide the appropriate commands to move the
access arm to the required cylinder, select the read/write head, and accept the data
from the sector when the data reaches the read/write head.
Two factors govern the data transfer rate, the speed with which the disk drive
delivers data to the computer: access time and rotation rate.
1.
Access (or seek) time is concerned with the movement required for the
read/write heads to reach the required cylinder/track. For sequential
processing, the heads move at most one cylinder; for random
processing, head movement may involve many cylinders.
2.
The rate of rotation determines the time taken for the required sector to
reach the head and to transfer the data from the sector to the computer's
memory. The average time for this operation is, of course, a half
revolution, and is known as latency. For a rotation rate of 6,000 rpm, the
speed per second is 6,000/60 = 100 revolutions. A single rotation
requires 11100 seconds, which equals 10 milliseconds. Latency is
therefore 5 milliseconds.
Clusters:
-
A cluster is a group of sectors that the system treats as a unit of storage space.
SECTOR
CLUSTER
SECTOR
SECTOR
CLUSTER
HARDWARE LAB
SECTOR
SECTOR
SECTOR
SECTOR
CLUSTER
Disk capacity:
Capacity
3.5" 720KB
3.5" 1.44MB
Tracks per
Sectors
Bytes
Total
Sectors
Side
Per
Per
Two Sides
per
(Cylinders)
80
80
Track
9
18
Sector
512
512
737,280
1,474,560
Cluster
2
1
For hard disks, capacities vary considerably by device and by partition. Useful
operations for determining the number of cylinders, sectors per track, or read-write heads
include INT 2lH functions IFH and 440DH with minor code 6OH.
Disk area:
The data area for a bootable disk or diskette begins with two system files named
IO.SYS and MSDOS.SYS. When we use FORMAT/S to format a disk, DOS copies its
system files onto the first sectors of the data area. User files either immediately follow the
system files or, if there are no system file begin at the start of the data area.
BOOT RECORD
SYSTEM
FAT
DIRECTORY
SYSTEM FILES
DATA AREA
HARDWARE LAB
The system area is the first area of a disk on the outer most track beginning with
side 0, track 0 and sector 1.
The following list gives the organization of 3.5 diskettes device, showing starting
and ending sector number:
BOOT
FAT
1-18
DIRECTORY
19-32
3.5 / 1.44MB
The next section explains the boot record, directory and FAT.
BOOT RECORD:
It helps the operating system to load the operating system from disk into memory.
The boot record contains the following information, in order of offset address:
00H
03H
0BH
0DH
0EH
10H
11H
13H
15H
16H
18H
1AH
1CH
HARDWARE LAB
1EH
20H
24H
Physical drive number (for diskette, A = 0; for hard disk, 80H = drive C)
25H
26H
27 H
Volumes ID
2BH
Volume label
36H
3EH-1FFH
Floppy disk
80H-FFH
Fixed disk
Returns:If successful
Carry flag= clear
AH => 00H
AL => no. of sectors
HARDWARE LAB
If unsuccessful
Carry flag= set
FAQs:1) What is BOOT RECORD?
__________________________________________________________________
__________________________________________________________________
2) What is Directory?
__________________________________________________________________
__________________________________________________________________
3) What is permanent on BOOT Record
__________________________________________________________________
__________________________________________________________________
4) List the characteristics of Disk Storage Device?
__________________________________________________________________
__________________________________________________________________
5) What is track?
__________________________________________________________________
__________________________________________________________________
6) What is sector?
__________________________________________________________________
__________________________________________________________________
Computer Department. SIT, Lonavala
HARDWARE LAB
7) What is cylinder?
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
CONCLUSION:
________________________________________________________________
________________________________________________________________
_
HARDWARE LAB
ASSIGNMENT NO: 4
TITLE:
Study of floppy
a) Root directory
b) Fat
PLATFORM:
DOS/Win-98
THEORY:
ROOT DIRECTORY:
All files on a disk begin on a cluster boundary, which is the first sector of the cluster. For
each file, the system creates a 32-byte (20H) directory entry that describes the name of
the file, the date of creation, its size, and the location of its starting cluster.
00H
08H
0CH
16H
18H
File Name
Time attribute or Last updated
Extension
File Attribute
RESERVED
HARDWARE LAB
Value
00H
05H
2EH
Meaning
Dir. Entry has never been used ;end of occupied portion of directory
First character of file name is actually E5H
Entry is an Alias for the current or parent directory.If the next byte is also
2EH,the cluster field contains the cluster number of the parent directory
File has been erased.
E5H
Bit
0
1
2
3
4
5
6
7
Meaning
Read-only; attempts to open for write or to delete will fail
Hidden file; excluded from normal searches
System file; excluded from normal searches
Volume label; can exist only in root directory
Directory; excluded from normal searches.
Archive bit; set whenever file is modified.
Reserved
Reserved
FAT:
It allows disk space for files.
HARDWARE LAB
- Both diskettes and hard disk devices are run by a controller that handles the placement
of read/write heads on the disk surface and transfer data between disk and memory.
- Tracks are divided into a number of segments called sectors. Each sector generally
contains 512 bytes and is the smallest unit of data that can be accessed by a disk drive
(although software makes it possible to access individual bytes and even individual bits).
- Tracks on each platter are assigned consecutive numbers by the operating system,
beginning with zero for the outermost track. The operating system remembers where data
is stored by noting these numbers as well as those of the cylinders, heads and sectors.
HARDWARE LAB
Cylinder:
-
A cylinder is a vertical set of all of the tracks with the same number on each
surface of a diskette or hard disk. Thus cylinder 0 is the set of all tracks numbered
0 on every side, cylinder 1 is the set of all tracks numbered I, and so forth. For a
diskette, then, cylinder 0 consists of track 0 on side 1 and track 0 on side 2;
cylinder I consists of track 1 on side 1 and track 1 on side 2; and so forth. Side
number and head are the same; for example, disk head 1 access the data on side 1.
Each track, and thus each cylinder, on a modern HDD has a width of only a few
microns (i.e., millionths of a meter). There can be tens of thousands of tracks on
each platter, and thus the same number of cylinders in the HDD.
Arm assembly
HARDWARE LAB
Physical Sector:
A smallest unit to store data on disk of capacity 512 bytes.
Relative sector:
Sectors are numbered relative to the start of the disk so that first on the disk,on
cylinder 0, track 0 is addressed as relative sector 0.
DISK CONTROLLER:
The disk controller, which is located between the processor and the disk drive,
handles all communication between them. The controller accepts data from the
processor and converts the data into a form that is usable by the device.
The role of the controller is to provide the appropriate commands to move the
access arm to the required cylinder, select the read/write head, and accept the data
from the sector when the data reaches the read/write head.
Two factors govern the data transfer rate, the speed with which the disk drive
delivers data to the computer: access time and rotation rate.
3.
Access (or seek) time is concerned with the movement required for the
read/write heads to reach the required cylinder/track. For sequential
processing, the heads move at most one cylinder; for random
processing, head movement may involve many cylinders.
4.
The rate of rotation determines the time taken for the required sector to
reach the head and to transfer the data from the sector to the computer's
memory. The average time for this operation is, of course, a half
revolution, and is known as latency. For a rotation rate of 6,000 rpm, the
speed per second is 6,000/60 = 100 revolutions. A single rotation
HARDWARE LAB
Clusters:
-
A cluster is a group of sectors that the system treats as a unit of storage space.
SECTOR
SECTOR
CLUSTER
SECTOR
CLUSTER
SECTOR
SECTOR
SECTOR
SECTOR
CLUSTER
Disk capacity:
HARDWARE LAB
Capacity
3.5" 720KB
3.5" 1.44MB
Tracks per
Sectors
Bytes
Total
Sectors
Side
Per
Per
Two Sides
per
(Cylinders)
80
80
Track
9
18
Sector
512
512
737,280
1,474,560
Cluster
2
1
For hard disks, capacities vary considerably by device and by partition. Useful
operations for determining the number of cylinders, sectors per track, or read-write heads
include INT 2lH functions IFH and 440DH with minor code 6OH.
Disk area:
The data area for a bootable disk or diskette begins with two system files named
IO.SYS and MSDOS.SYS. When we use FORMAT/S to format a disk, DOS copies its
system files onto the first sectors of the data area. User files either immediately follow the
system files or, if there are no system file begin at the start of the data area.
BOOT RECORD
FAT
DIRECTORY
DATA AREA
SYSTEM
SYSTEM FILES
The system area is the first area of a disk on the outer most track beginning with
side 0, track 0 and sector 1.
The following list gives the organization of 3.5 diskettes device, showing starting
and ending sector number:
BOOT
0
FAT
1-18
DIRECTORY
19-32
3.5 / 1.44MB
HARDWARE LAB
The next section explains the boot record, directory and FAT.
THE ROOT DIRECTORY:
It contains name location and status of each file on the disk. The top directory in a
file system. The root directory is provided by the operating system and has a special
name; for example, in DOS systems is called the root directory. The root directory is
sometimes referred to simply as the root.
PURPOSE
Filename, as defined in the program that created the file. The first byte can
also indicate the file status:
OOH File has never been used
05H
2EH
File is a subdirectory
E5H
08H-0AH
0BH
File attribute, defining the type of file (note that a file may have more than
one attribute):
HARDWARE LAB
02H
04H
08H
Volume label (if this is a volume label record, the label itself is in
the filename and extension fields)
1OH
Subdirectory
20H
Archive file, which indicates whether the file was rewritten since
the last update.
(For example, code 07H means system file (04H) that is read-only
(RO) and hidden (02H).)
0CH-15H
16H-17H
Time of day when the file was created or last updated; stored as 16 bits in
binary format as hhhhhmmmmmmsssss.
18H-19H
Date when the file was created or last updated, stored as 16 bits in binary
format as yyyyyyymmmmddddd. Year can be 000-119 (with 1980 as the
starting point), month can be 01-12, and day can be 01-31.
1AH-1BH
Starting cluster of the file. The number is relative to the last two sectors of
the directory. Where there are no system files, the first data file begins at
relative cluster 002. The actual side, track, and cluster depend on disk
capacity. A zero entry means that the file has no space allocated to it.
1CH-1FH
Size of the file in bytes. When a file is written, the system calculates and
stores its size in this field.
HARDWARE LAB
if successful
Carry flag= clear
If unsuccessful
Carry flag=set
AX=error code
Purpose of FAT is to allocate disk space for files. FAT contain entry for each
cluster on disk.
Original designer provide for 2 copies of FAT (FAT 1 and FAT 2).
FAT as it applies to flexible/floppy and optical disk cartridges (FAT12 and FAT16
without long file name support) has been standardized as ECMA-107 and
ISO/IEC 9293.
HARDWARE LAB
FAT12
Microsoft
FAT16
Full Name
Introduced
Developer
Partition
FAT32
BASIC)
95 OSR2)
0x01 (MBR)
0x0B,
identifier
0x0C
(MBR)
EBD0A0A2-B9E5-4433
-87C0-68B6B72699C7
(GPT)
FAT12:
-
This initial version of FAT is now referred to as FAT12. As a file system for
floppy disks, it had a number of limitations: cluster addresses were "only" 12 bits
long (which limited cluster count to 4096 and made FAT manipulation a bit
tricky) and the disk size was stored as a 16-bit count of sectors, which limited the
size to 32 MB.
FAT12 was used by several manufacturers with different physical formats but a
typical floppy diskette at the time was 5.25", single-sided, 40 tracks, with 8
sectors per track, resulting in a capacity of slightly less than 160 KB.
FAT16:
-
In 1984 IBM released the PC AT, which featured a 20 MB hard disk. Microsoft
introduced MS-DOS 3.0 in parallel. Cluster addresses were increased to 16-bit,
allowing for a greater number of clusters (up to 65,517) and consequently much
greater file-system sizes.
FAT32:
-
HARDWARE LAB
sector uses a 32 bit field to limit volume size to 2 32 sectors (2TB on a hard disk
with 512 byte sectors).
2) What is Directory?
__________________________________________________________________
__________________________________________________________________
3) What is FAT and What it includes?
__________________________________________________________________
__________________________________________________________________
4) List the characteristics of Disk Storage Device?
__________________________________________________________________
__________________________________________________________________
5) What is track?
__________________________________________________________________
__________________________________________________________________
6) What is sector?
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
7) What is cylinder?
__________________________________________________________________
__________________________________________________________________
Design Problem:-
HARDWARE LAB
CONCLUSION:
________________________________________________________________
________________________________________________________________
_
ASSIGNMENT NO: 05
HARDWARE LAB
HARDWARE LAB
Printers
In computers, a printer driver or a print processor is a piece of software that converts the
data to be printed to the form specific to a printer. The purpose of printer drivers is to
allow applications to do printing without being aware of the technical details of each
printer model.
HARDWARE LAB
3.
UNIX
On UNIX systems and other systems which use the Common UNIX Printing System,
such as Mac OS X, printer drivers are typically implemented as filters. They are usually
named the front end of the printing system, while the printer spoolers constitute the back
end.
Backend are also used to determinate the available devices. On startup, each backend is
asked for a list of devices it supports, and any information that is available.
DOS
On MS-DOS, there have been no system-wide printer drivers; each application was
shipped with its own printer drivers, which were essentially descriptions of printer
commands. Printers, too, have been supplied with drivers for the most popular
applications. In additions, applications included tools for editing printer description, in
case there was no ready driver. In the days when DOS was widely used, many printers
had emulation modes for Epson FX80 and IBM Proprinter commands. It appears that
these also worked with Windows 3.0,
Windows
On Microsoft Windows systems, printer drivers make a part of GDI or XPS . Programs
then use the same standard APIs to draw text and pictures both on screen and on paper.
Printers which use GDI natively are commonly referred to as Win printers and are
considered incompatible with other operating systems.
Win32 APIs also allow applications to send data directly to the spooler, bypassing the
printer driver; however, few applications actually use this option.
HARDWARE LAB
4. Printing mode
The data received by a printer may be:
1. a string of characters
2. a bitmapped image
3. a vector image
5. Computer printer
A computer printer, or more commonly a printer, produces a hard copy (permanent
human-readable text and/or graphics) of documents stored in electronic form, usually on
physical print media such as paper transparencies]]. Many printers are primarily used as
computer peripherals, and are attached by a printer cable to a computer which serves as a
document source. Other printers, commonly known as network printers, have built-in
network interfaces (typically wireless or Ethernet), and can serve as a hardcopy device
for any user on the network.
Dot-matrix printers
In the general sense many printers rely on a matrix of pixels, or dots, that together form
the larger image. However, the term dot matrix printer is specifically used for impact
printers that use a matrix of small pins to create precise dots. The advantage of dot-matrix
over other impact printers is that they can produce graphical images in addition to text;
however the text is generally of poorer quality than impact printers that use letterforms
(type).
Dot-matrix printers can be broadly divided into two major classes:
1. Ballistic wire printers
2. Stored energy printers
HARDWARE LAB
Dot matrix printers can either be character-based or line-based (that is, a single horizontal
series of pixels across the page), referring to the configuration of the print head.
At one time, dot matrix printers were one of the more common types of printers used
for general use - such as for home and small office use. Such printers would have either 9
or 24 pins on the print head. 24-pin print heads were able to print at a higher quality.
Once the price of inkjet printers dropped to the point where they were competitive with
dot matrix printers, dot matrix printers began to fall out of favor for general use.
Dot matrix printers are still commonly used in low-cost, low-quality applications like
cash registers, or in demanding, very high volume applications like invoice printing. The
fact that they use an impact printing method allows them to be used to print multi-part
documents using carbonless copy paper (like sales invoices and credit card receipts),
whereas other printing methods are unusable with paper of this type. Dot-matrix printers
are now (as of 2005) rapidly being superseded even as receipt printers.
The installable device drivers that were introduced in MS-DOS version 2 give the
user great flexibility. They allow the user to customize and configure the computer
for a wide range of peripheral devices, with a minimum of troublesome interactions
and without having to "patch" the operating system. Even the most inexperienced
user can install a new device into a system by plugging in a card, copying a driver
file to t~ disk, and editing the system configuration file.
For those inclined to do their own programming, the MS-DOS installable device
drivers are interfaced to the hardware-independent kernel through a simple and
clearly defined scheme Of function codes and data structures. Given adequate
information about the hardware, any competent assembly-language programmer can
expect to successfully interface even the most bizarre device to MS-DOS without
altering the operating system in the slightest and without acquiring any special or
proprietary' knowledge about its innards.
In retrospect, installable device drivers have proven to be one of the key usability
features of MS-DOS. I feel that they have been largely responsible for the rapid
proliferation and competitive pricing of high-speed mass storage devices for MSComputer Department. SIT, Lonavala
HARDWARE LAB
DOS machines, an~ for the growing confidence of the average user toward
"tampering with" (upgrading) his or her machine.
HARDWARE LAB
A block driver can support more than one hardware unit; map a single physical unit
onto two or more logical units, or both. Block devices do not have file-like logical names,
as character devices do. Instead, MS-DOS assigns drive designators to the block-device
units or logical drives in an alphabetic sequence: A, B, and so forth. Each logical drive
contains a file system: boot block, file allocation table, root directory, and so forth.
A block-device driver's position in the chain of all drivers determines the first letter
assigned to that driver. The number of logical drive units that the driver supports
determines the total number of letters assigned to it. Block -device drivers always read or
write exactly the number of sectors requested (barring hardware ) and never filter or
otherwise manipulate the contents of the blocks being transferred.
Initialization
Media check
Build BPB
IOCTL read and write
Status
Read
Write, write/verify
Output until busy
Flush buffers
Device open
Device close
Check whether removable
Generic IOCTL
Get/Set logical device
Strategy routine
Device-driver header
HARDWARE LAB
Byte offset
00H
02H
04H
06H
08H
0AH
Fig: Device-driver header. The offsets to the start and inter routines are offsets from rum
the same segment used to point to the device header.
Bit
Significance
15
14
13
1
,
12
Reserved (should be 0)
11
7-10
6
Reserved (should be 0)
1if generic IOCTL and get/set logical drive supported (MS-DOS 3.2 )
HARDWARE LAB
Reserved (should be 0)
Fig: Devices attribute word in device header. In block-device drivers, only bits 6, 11, and
13-15 (and bit 1 in MS-DOS version 4.0) have significance; the remainder should always
be zero.
HARDWARE LAB
struc
db
Unit
db
Command
db
Status
dw
Reserve
db
8 dup (?)
5 reserved area
Media
db
Address
dd
Count
dw
Sector
dw
Request
ends
Format of request header. Only the first 13 bytes are common to all driver functions; the
number and definition of the subsequent bytes vary, depending upon the function type.
The structure shown here is the one used by the read and write sub functions of the driver.
HARDWARE LAB
operation. It can use other fields in the request header to pass back such useful
information as counts of the actual sectors or bytes transferred.
The interrupt routine usually consists of the following elements:
A centralized exit point that stores status and error codes into the request header
(Figures 14-5 and 14-6) and restores the previous contents of the affected registers
The command-code routines that implement the various functions supported by an
installable device driver are discussed in detail in the following pages.
Bit(s) Significance
15
Error
12-14
Reserved
Busy
Done
0-7
Fig. Values for the return status word of the request header.
Code
Meaning
Write-protect violation
Unknown unit
Unknown command
Seek error
Unknown medium
HARDWARE LAB
OBH
Read fault
OCH
General failure
OD-OEH
Reserved
OFH
Fig: Driver error codes returned in bits 0 through 7 of the return status word of the
request header.
Although its name suggests otherwise, the interrupt routine is never entered
asynchronously (on an I/O completion interrupt, for example). Thus, the division of
function between strategy and interrupt routines is completely artificial in the current
versions of MS-DOS.
THE COMMAND-Code Routines
A total of 20 command codes are defined for MS-DOS device drivers. The command
codes (which are not consecutive), the names of the associated driver-interrupt routines,
and the MS-DOS versions in which they are first supported are as follows:
Command
Function
Code
Character
Block
MS-DOS
driver
driver
version
2.0
Init (Initialization)
Media Check
2.0
Build BPB.
2.0
. IOCTL Read
2.0
2.0
Read"
Nondestructive Read
2.0
Input Status
2.0
2.0
Write
2.0
2.0
HARDWARE LAB
10
Output Status
2.0
11
2.0
12
IOCTL Write
2.0
13
Device Open
3.0
14
Device Close
3.0
15
Removable Media
3.0
16
19
Generic IOCTL
23
24
3-0
x
3-2
3-2
3.2
As you can see from the preceding table, a driver's interrupt section must support
functions 0 through 12 under all versions of MS-DOS. Drivers tailored for MS-DOS 3-0
and 31 can optionally support an additional four functions, and MS-DOS drivers for
versions 3-2 and later can support three more (for a total of 20). MS-DOS inspects the
bits in the attribute word of the device-driver header to determine which of the optional
functions a driver supports, if any.
Some of the functions are relevant only for character-device drivers and some only for
block-device drivers; a few have meaning to both types. In any case, both driver types
should have an executable routine present for each function, even if it does nothing
except set the done flag in the status word of the request header.
Function 00H (0): Driver Initialization
MS-DOS requests the driver's initialization function Unit) only once, when the driver is
first loaded. This function performs any necessary device hardware initialization, setup of
interrupt vectors, and so forth. The initialization routine must return the address of the
position where free memory begins after the driver code (the break address), so that MSDOS knows where it can build certain control structures and then load the next installable
driver. If this is a block-device driver, init must also return the number of units and the
address of a BPB pointer array.
HARDWARE LAB
MS-DOS uses the number of units returned by a block driver in the request header to
assign drive identifiers. For example, if the current maximum drive is D and the driver
being initialized supports four units, MS-DOS will assign it the drive letters E, F, G, and
H. Although the device-driver header also has a field for number of units, MS-DOS does
not inspect it.The BPB pointer array is an array of word offsets to BIOS parameter blocks
. Each unit defined by the driver must have one entry in the array, although the entries
can all point to the same BPB to conserve memory. During the operating-system boot
sequence, MS-DOS scans all the BPBs defined by all the units in all the block-device
drivers to determine the largest sector size that exists on any device in the system and
uses this information to set its cache buffer size.
The operating-system services that the initialization code can invoke at load time are very
limitedonly Int 21H Functions 01H through OCH and 30H. These are just adequate to
check the MS-DOS version number and display a driver-identification or error message.
. Many programmers position the initialization code at the end of the driver and return
that address as the location of the first free memory, so that MS-DOS will reclaim the
memory occupied by the initialization routine after the routine is finished with its work.
If the initialization routine finds that the device is missing or defective and wants to abort
the installation of the driver completely so that it does not occupy any memory, it should
Byte(s)
Contents_
00-01H
02H
03H-O4H
05H
06H-07H
08H-09H
OAH
OBH-OCH
ODH-OEH
OFH-10H
11H-12H
HARDWARE LAB
13H-14H
15H-18H
If bytes 8-9 are zero, total number of sectors in medium (version 4.0)
19H-1EH
Fig Structure of a BIOS parameter block (BPB). Every formatted disc contains a copy of
its BPB in the boot sector.
Number of units as zero and set the free memory address to CS: 0000H. (A characterdevice driver that wants to abort its installation should clear bit 15 of the attribute word in
the driver header and then set the units field and free memory address as though it were a
block-device driver.)
The initialization function is called with
RH + 2
BYTE
RH + 18
DWORD
Command code = 0
Pointer to character after equal sign on CONFIG.SYS line
That loaded driver (this information is read-only)
RH + 22
BYTE
It returns:
RH + 3
WORD
Status
RH + 13
BYTE
RH + 14
DW6RD
RH + 18
DWORD
HARDWARE LAB
the media-check routine returns a code indicating whether the disk has been changed
since the last transfer. If the media-check routine can assert that the disk has not been
changed, MS-DOS can bypass rereading the FAT before a directory access, which
improves overall-performance.
Code
Meaning
0F0H
0F8H
fixed disk
0F9H
0F9H
OFCH
OFDH
OFEH
OFFH
Current valid MS-DOS codes for the media descriptor byte of the request header,
assuming bit 13 in the attribute word of the driver header is zero.
FAQs:1) What is device driver?
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
HARDWARE LAB
CONCLUSION:
________________________________________________________________
________________________________________________________________
________________________________________________________________
ASSIGNMENT NO: 6
HARDWARE LAB
THEORY:
Introduction to RS-232:
RS232 is the most known serial port used in transmitting the data in communication
and interface. Even though serial port is harder to program than the parallel port, this is
the most effective method in which the data transmission requires less wires that yields to
the less cost. The RS232 is the communication line which enables the data transmission
by only using three wire links. The three links provides transmit, receive and common
ground.
The transmit and receive line on this connecter send and receive data between
the computers. As the name indicates, the data is transmitted serially. The two pins are
TXD & RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI.
The 1 and 0 are the data which defines a voltage level of -3V to -25V and +3V to
+25V respectively.
The electrical characteristics of the serial port as per the EIA (Electronics Industry
Association) RS232C Standard specifies a maximum baud rate of 20,000bps, which is
slow compared to todays standard speed. For this reason, we have chosen the new RS232D Standard, which was recently released.
The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and D-TYPE
9 pin connector, which are male connectors on the back of the PC. You need a female
connector on your communication from Host to Guest computer. The pin outs of both D9 & D-25 are show below.
HARDWARE LAB
HARDWARE LAB
several times faster than our DCE to DCE speed the PC can send data to your modem at
115,200 BPS
NULL MODEM
Null modem is used to connect two DTE's together. This is used to transfer files between
the computers using protocols like Z modem protocol, x modem protocol, etc
HARDWARE LAB
Data Terminal Ready (DTR) is looped back to Data Set Ready and Carrier Detect on
both computers. When the Data Terminal Ready is asserted active, then the Data Set
Ready and Carrier Detect immediately become active. At this point, the computer thinks
the Virtual Modem to which it is connected is ready and has detected the carrier of the
other modem.
All left to worry about now is the Request to Send and Clear To Send. As both computers
communicate together at the same speed, flow control is not needed thus these two lines
are also linked together on each computer. When the computer wishes to send data, it
asserts the Request to Send high and as it is hooked together with the Clear to Send, It
immediately gets a reply that it is ok to send and does so.
The Ring indicator line is only used to tell the computer that there is a ringing signal on
the phone line. As we do not have, a modem connected to the phone line this is left
disconnected
Using bioscom:
The macro bioscom () and function _bios_serialcom() are used in the serial
communication using RS-232 connecter.
Declaration:
bioscom(int cmd, char abyte, int port)
_bios_serialcom(int cmd ,int port, char abyte)
bioscom() and _bios_serialcom() uses the bios interrupt 0x14 to perform various
communicate the serial communication over the I/O ports given in port.
cmd: The I/O operation to be performed.
HARDWARE LAB
HARDWARE LAB
For example, if
abyte = 0x8B = (0x80 | 0x03 | 0x00 | 0x08)
= (_COM_1200 | _COM_CHR8 | _COM_STOP1 | _COM_ODDPARITY)
the communications port is set to
1200 baud
(0x80 = _COM_1200)
HARDWARE LAB
port to com2 of the same computer and change the port id in the program. The data sent
to the port com1 should come to port com2. then also whatever you type in the keyboard
should appear on the screen.
FAQs:1) What is RS232?
__________________________________________________________________
__________________________________________________________________
2) Which 3 lines of RS232 are used for data transmission?
__________________________________________________________________
__________________________________________________________________
3) What is baud rate?
__________________________________________________________________
__________________________________________________________________
4) What is DCE?
__________________________________________________________________
__________________________________________________________________
5) What is DTE?
__________________________________________________________________
__________________________________________________________________
6) What is function of NUL Modem?
__________________________________________________________________
__________________________________________________________________
7) Which protocols asre used by NULL Modem?
__________________________________________________________________
__________________________________________________________________
8) What is function of BIOSCOM?
__________________________________________________________________
__________________________________________________________________
9) What is syntax of bioscom?
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
10) What is syntax of bios_serialcom?
__________________________________________________________________
__________________________________________________________________
CONCLUSION:
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
ASSIGNMENT NO: 7
TITLE: Write an ALP to understand working of mouse.
THEORY:
General 8086 software interrupt interfaces
Declaration:
int86(int no, union REGS *inregs, union REGS *outregs);
Computer Department. SIT, Lonavala
HARDWARE LAB
HARDWARE LAB
int86x
intdos
intdosx
union REGS
{
struct WORDREGS x;
struct BYTEREGS h;
};
UNION(Keyword)
A union is similar to a struct, except it allows you to define variables
that share storage space.
Syntax:
union [<union type name>] {
<type> <variable names> ;
...
} [<union variables>] ;
For example,
union int_or_long {
int
long
i;
l;
} a_number;
Turbo C++ will allocate enough storage in a_number to accommodate the
largest element in the union.
HARDWARE LAB
Unlike a struct, the variables a_ number.i and a_number.l occupy the same
location in memory. Thus, writing into one will overwrite the other.
Elements of a union are accessed in the same manner as a struct.
ALGORITHM:
1. Start
2. Initialise the mouse pointer
3. If mouse is not initialize then display error message
4. else show mouse pointer and X,Y co-ordinates of mouse pointer using int86
If 1 then right button pressed
If 2 then left button pressed
If 3 then both button pressed
5. Stop.
2) What is INT86X ?
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
5) What is REGS ?
__________________________________________________________________
__________________________________________________________________
6) What is UNION?
__________________________________________________________________
__________________________________________________________________
8) What is the function code and Interrupt for hide mouse Pointer in case of an
interrupt?
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
9) What is the function code and Interrupt for Show mouse pointer , Mouse Status ?
__________________________________________________________________
__________________________________________________________________
10) What is the function code and Interrupt for Status code of Mouse ?
__________________________________________________________________
__________________________________________________________________
Design Problem:1) Design ALP to set Mouse Pointer position.
2) Design ALP to get button press information.
3) Design ALP to set horizontal / Vertical limits for Mouse Pointer .
CONCLUSION:
________________________________________________________________________
________________________________________________________________________
ASSIGNMENT NO: 08
TITLE: Study of protected mode.
PROBLEM STATEMENT: Write a ALP of real to protected mode switching (DPMI)
THEORY:
Introduction to Protected-Mode
When introduced in the late 1970's, the 8086 was considered a technological
breakthrough. It was a cheap, powerful 16 bit processor which could address *huge*
Computer Department. SIT, Lonavala
HARDWARE LAB
amounts of memory (up to 1MB). The 8086 gained an enormous popularity soon after its
introduction, since it was chosen by IBM engineers when they designed the first personal
computer (they actually used a variant of the 8086 known as the 8088 but the differences
are minor). Since 1MB of memory was considered an overkill for a personal computer,
IBM decided to utilize only the first 640KB for RAM and reserve the remaining 384KB
for the BIOS and ISA add-on cards. At first, most applications were rather compact and
therefore were not affected by the 640KB barrier, but eventually some memory hogging
applications hit the market and Intel had to devise a solution.
The solution came in 1982 when Intel introduced its new processor : The 80286.
As opposed to the 8086 which offered only one operating mode, the 80286 actually
incorporated two: A backward compatible 8086 operating mode called Real-Mode and a
secondary advanced mode called Protected-Mode.
Protected-Mode Memory Management
When the processor is running in protected-mode, two mechanisms are involved in the
memory translation process: Segmentation and Paging. Although working in tandem,
these two mechanisms are completely independent of each other. In fact, the paging unit
can be disabled by clearing a single bit in an internal processor register. In this case, the
linear addresses which are generated by the segmentation unit pass transparently through
the paging unit and straight to the processor address bus.
Segmentation
Computer Department. SIT, Lonavala
HARDWARE LAB
The role of the segmentation unit is the same as on the 8086 processor. It allows the
operating system to divide programs into logical blocks and place each block in a
different memory region. This makes it possible to regulate access to critical sections of
the application and help identify bugs during the development process. The
implementation of the segmentation unit on the 80386 (and above) is simply an extension
of the old 8086 unit. It includes several new features such as the ability to define the
exact location and size of each segment in memory and set a specific privilege level to a
segment which protects its content from unauthorized access.
Not only real-mode applications use segment registers for accessing memory. The same
process takes place under protected-mode. However, there are several differences which
should be considered. First, there is a slight change in terminology. Under protectedmode, segment registers receive the name Selectors which reflects their new role in the
memory translation process. Although still 16-bit in size, their interpretation by the
processor is inherently different. Figure 2 presents the structure of a selector along with
the various bit-fields which comprise it.
HARDWARE LAB
segment in memory. A descriptor entry contains both a pointer to the first byte in the
associated segment and a 20-bit value which represents the size of the segment in
memory. Several other fields contain special attributes such as a privilege level and the
segment's type. Figure 3 presents the exact structure of a descriptor entry along with a
description of each of its internal fields.
Designated Role
Segment
Base
Address
(32-bits)
BASE
D/B
Size
Bit
HARDWARE LAB
segment.
When the bit is clear, a 16-bit segment is assumed.
When the descriptor entry describes a data segment, this
bit is used to control the operation of the stack.
When this bit is set, stack operations use the ESP register.
When this bit is clear, stack operations use the SP register.
Descriptor
Privilege
Level
(2-bits)
DPL
Bit
LIMIT
Bit
one
of
the
segment
registers.
Bit
segment.
HARDWARE LAB
(4-bits)
expand-down
or
expand-up.
Since each selector points to a specific descriptor entry, there is a one to one relationship
between selectors and segments in memory. This concept is demonstrated in the
following figure.
HARDWARE LAB
HARDWARE LAB
Two types of descriptor tables are used by the processor when working in protectedmode. The first is known as the GDT (Global Descriptor Table) and is used mainly for
holding descriptor entries of operating system segments. The second type is known as the
LDT (Local Descriptor Table) and contains entries of normal application segments
(although not necessarily). During initialization, the kernel creates a single GDT which is
kept in memory until either the operating system terminates or until the processor is
switched back to real-mode.
Whenever the user starts an application, the operating system creates a new LDT to hold
the descriptor entries which represent the segments used by the new task. This makes it
possible for the operating system to isolate each task's address space by enabling a
different LDT whenever a task switch occurs. Bugs and other errors in the application
cannot affect other running processes and are limited in scope to the currently mapped
memory segments.
Note that not all operating systems behave exactly as described above (for instance, all
Windows applications share a single LDT). However, this is the recommended
programming practice as offered by Intel.
When looking for a specific descriptor entry, the addressing unit in the processor uses the
TI bit (which is part of the selector) to decide which descriptor table should be used (the
GDT or the currently active LDT). Figure 6 shows this process in clarity.
HARDWARE LAB
far
*pChar;
HARDWARE LAB
pChar
GlobalAlloc(GMEM_FIXED,
100);
pChar[50] = 'A';
This piece of code asks Windows to allocate a 100 bytes buffer and store its address in a
far pointer called pChar. If you examine the code inside GlobalAlloc, you will see that
Windows allocates a selector in its LDT whenever you call this function in your
application. So pChar actually contains both a selector and an offset. To modify the
allocated buffer, the processor uses the LDTR register to index its GDT and find the
currently active LDT descriptor. Then, it accesses the LDT by using the selector part of
pChar as an index to retrieve the segment base address. The offset (50) is added to the
retrieved segment base address and the letter 'A' is written to the calculated memory
location.
Note that the information presented above applies only to the 16-bit implementation of
Windows. The behavior of GlobalAlloc on the Win32 platforms is inherently different.
Paging
Paging is a mechanism which helps the operating system to create unique virtual (faked)
address spaces while it also has a major role in memory simulation using disk space - A
process commonly known as Virtual Memory support.
The 32-bit linear address generated by the segmentation unit can be optionally fed into
the paging unit to undergo a second address manipulation process. There is no
mathematical correlation between a linear address and its associated physical counterpart
but instead, special tables in memory known as the Page Tables assist the paging unit in
transforming the input linear address into a physical address which is sent to the
processor bus.
Applications live inside a 4GB linear address space and have no indication of how
physical memory is organized. This has numerous benefits since no application can see or
modify other applications data structures - One of the features required by most
multitasking operating systems.
Computer Department. SIT, Lonavala
HARDWARE LAB
The paging unit treats the linear and physical address spaces as a collection of
consecutive 4KB pages (The Pentium and Pentium Pro can also handle 4MB pages). A
linear page can be mapped to any of the physical pages or it can be marked as nonpresent to make it sensitive to memory accesses. Trying to read or modify a non-present
page causes the processor to generate a Page Fault Exception (exception 0xEh) which is
usually handled by the operating system internal code.
This is exacly the essence of virtual memory. When programs consume all available
memory, the operating system attempts to free memory by swapping least recently used
(LRU) pages of memory to disk. The swapped pages are marked as non-present so when
they are later accessed by their owning application, they would be automatically reloaded
from disk by the operating system (The code handling the page exception is responsible
for loading these pages and mapping them back to physical memory). You can think of
this process as if the operating system "steals" memory from background tasks in order to
give it to the currently active application.
The real impressive characteristic of the virtual memory mechanism is that it is
completely transparent to application code. After loading a page from disk and remapping
it to physical memory, the operating system reexecutes the instruction which caused the
page fault exception to occur, so the running application is not even aware of the fact that
part of its memory was stored temporarily on disk.
Before enabling the paging unit, the operating system must construct a table in memory
known as the page directory table. The 1024 DWORD entries of the page directory table
hold physical addresses of another set of paging tables called page tables. Page tables
participate in the last stage of the address translation process since they actually contain
the physical addresses of the 4KB chunks of memory.
A close examination of the paging process reveals that the processor breaks the linear
address into three components before turning it into a physical one. The top 10 bits of the
linear address are used by the processor to index the page directory table. The processor
retrieves the entry from the table and uses it to find the physical address of a page table.
HARDWARE LAB
The next 10 bits of the linear address serve as an index into the corresponding page table.
By adding the page table entry value (which represents the physical address of a physical
page in memory) and the 12 lower bits of the linear address (the offset into the page), the
processor can locate the requested physical address and send it to its address bus. Figure
7 shows the internal structure of a linear address and its interpretation by the processor.
HARDWARE LAB
to reflect the new linear to physical mapping scheme and swaps least recently used pages
of memory to disk.
FAQs:1) What is segmentation?
__________________________________________________________________
__________________________________________________________________
2) What is paging?
__________________________________________________________________
__________________________________________________________________
3) What is working of 1687H Function with interrupt 2FH?
__________________________________________________________________
__________________________________________________________________
4) What is descriptor tables?
__________________________________________________________________
__________________________________________________________________
5) What is content of descriptor tables?
__________________________________________________________________
__________________________________________________________________
6) What is GDT?
__________________________________________________________________
__________________________________________________________________
7) What is LDT?
Computer Department. SIT, Lonavala
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
CONCLUSION:
________________________________________________________________
________________________________________________________________
________________________________________________________________
ASSIGNMENT NO: 9
HARDWARE LAB
TITLE:
Study of Pentium Motherboard:
1. Study of Motherboard Layout.
2. Study of CMOS SETUP
PLATFORM:
Windows XP
THEORY:
Motherboard is the largest circuit board inside the computer, it contains the
computers CPU, memory (RAM & ROM) & various support chips for CPU.
Motherboard also contains many expansion slots on which you can connect
smaller circuit board to interface different devices such as monitor pointer sound
card etc. with computer.
A) Functional Components Of Motherboard:1. Reset Logic:
Resetting of PC is done under any of the following conditions
During Power ON (Power up Reset)
a. Pressing Reset push button or switch i. e. manual reset.
b. Pressing CTRL, ALT, DEL key all together (soft reset)
The soft reset is different from power up reset & manual reset, which are
H/W reset. The H/W effectively applies a reset signal to the microprocessors
clock generator. As a result the microprocessor performs reset sequence which
involves clearing of all flags in IP, DS, SS & ES registers & setting up all 1s in
CS register. The soft reset is purely a S/W sequence as a result of which the POST
gets control.
2. DMA Logic:
HARDWARE LAB
It includes DMA controller, 4-bit DMA page register address buffer &
address latch. The DMA controller provides 4 channel but the PC makes the use
of only 3 channels. The channel 1 is not used in PC.
When the DMA controller perform a bus cycle it sends LSB address bits
on the address pins A0 A7 which are connected to XA0 XA7. The 8 MSB
add bit are issued by the DMA controller on its data pins DB0 DB7. This is
present on there only for clock cycle. The latch outputs are connected to A8
A15. When the CPU is circuit 1 of bus the DMA AEN signal at OE I/P pin No1 of
this latch is high making the latch output bi-directional.
The X1OW & XIOR are bidirectional signal whereas XMEMW &
XMEMR are only O/P signals from DMA controller.
3. Keyboard Logic:
The keyboard logic interface receives the scan code in the serial format
from the keyboard assembles the serial data into parallel 8 bit scan code &
generates interrupts request to the interrupt logic. The SYS (IRQ) S/W follows
specific protocol with keyboard up for data transfer & control sequence. The
keyboard I/P H/W consists of following sections.
i) Serial to parallel converter (shift register)
ii) Interrupt generation logic.
iii) Scan code port (Port A) of PPI.
Bidirectional Communication:
The keyboard P transmits the scan code to the PC system over a serial interface,
there are 2 bidirectional lines between keyboard & PC motherboard, one line is
for the serial data bit & other for clock signal. The 4 signal between keyboard &
PC are +5V DC ground, DATA circuit. The keyboard uP checks the status of both,
the check line & data line only if both lines are high, the keyboard constantly
sends data.
4. ROM Logic:-
HARDWARE LAB
In a PC, the last 64KB memory space from F0000 onwards is received for ROM
depending on the ROM(check) chip type used appropriate no. of chips are
mounted 80 as to provide 64KB RAM capacity. However most of the cases 40
KB ROM space is sufficient to provide the following routines.
a. POST
b. BIOS
c. Basic Interface.
ROM Device Logic:
This analysis the MSB of 20 bit address and generate appropriate chip select
control signal. So as to enable the reading of one of the ROM chips which
contains the location addressed bit, either 13, 14 or 15 address bit depending on
the ROM chip type.
5. RAM Logic:It contains the memory chip arranged as 4 banks of 9 chips. Depending on the
capacity of memory chip, the total capacity of RAM on motherboard varies. The
maximum usable RAM permitted by PC. OS CMS DOS for PCs is 640KB.
Usually 640KB RAM is provided by using 2 banks of 41256 chips & 2 banks of
4164 chips. Certain new motherboard use only 1 bank of 1MB chip thus,
providing 1 MB physical memory. However, functionally the first 640 KB only
is supported by the S/W.
B) Components Of Motherboard:1. Expansion slots.
2. CPU.
3. Co-processor.
4. Memory.
5. BIOS.
6. Support circuits or chip set for interrupt DMS.
HARDWARE LAB
1. Expansion Slots:There are long thin connector on the motherboard near the back side of
computer one can connect various expansion cards, such as display card, hard
drive controller, sound card, Network card & modern card etc. on these slots
when an adopter card is connected to the expansion slot, these buses are
categorized according to the no. of bits so that they can be transferred at a time.
On 8 bit data bus transferring 16 bit requires two data transfers. Another very
common term, taking about basic it, H/W on the width & the technology the
expansion slot bus can be driven into.
1. 8 bit ISA
2. 16 bit ISA
3. VSEA local bus or VL bus.
4. PC1 local bus
5. MCA
6. EISA
Types of Expansion Slots:There are long, thin connector on the motherboard rear the backside of the
computer. One can connect various expansion cards, such as display card, hard
drive controller, sound card network card & modem card etc.
HARDWARE LAB
HARDWARE LAB
HARDWARE LAB
4. Memory:
It is the place where computer stores program & data that help computer to
carry out its operation. Basically, two types of memory are-
A)RAM:
RAM is read/write memory used by the processor to sub-program data,
intermediate results during program execution & it is volatile in nature. Two
types of RAM are DRAM & SDRAM.
a). DRAM:
It is cost wise cheaper, than SRAM so used widely. Since, DRAM utilizes
capacitors to store information. It cannot retain data for a longer time unless the
data is referred. After sometimes refreshing is done by retiring the certain of
memory. After every few milliseconds else contents gets loose.
b) SDRAM:
The information stored here remains as long as power supply is provided to the
chip. Refreshing is not needed here. Circuit is also not needed for refreshing
hence is very simple. It uses flip-flops to store information. Physical installation
of RAM memory on motherboard takes place in several ways.
a. DIP (Dual Inline Pin) memory chip were used on initial Motherboards.
b. Later SIMM became common.
c. Currently DIMM are most common.
A) ROM:
It is Read Only Memory data can be written onto it by the manufacturer only.
a. Non-volatile in nature.
b. Does not loose contents, when power supply is turned Off.
HARDWARE LAB
HARDWARE LAB
Features:
1. The Intel Processor Pentium 4 is available ranging from 1.30 to 2.8GHz.
2. Supported by the Intel 850 chipset.
3. Internet streaming & HD extensions architecture based S/W.
Intel Pentium IV processor can be designed for desktop PCs as well as entry
level workstations.
Chipset:
All the devices support functions inside a PC were integrated into few VLSI
components integrating circuit or ASCII collectively calls chipset.
Intel 810E chipset:
The Intel 810E chipset Integrates the Innovative features of the 810 chipset with
performance & except values of the 0.13v or 0.18v Intel Pentium based pro PC.
The 810E chipset embraces stability of 810E chipset by use of solid Integrated
Technology.
Features:
1. It is a unique integral gear arbitration allowing it to run with 66MHz,
100MHz & 133MHz processor buses.
2. Validated & turned for both Celeron & Pentium III processors the
Intel 810E chipset offers a step solution with a single flexible
motherboard for Intel Processor.
Intel 845 Chipset:
The Pentium IV processor was originally introduced with the support of high
performance Intel chipset 850.
Intel introduced 845 chipset with chipper SDRAM support for Pentium IV
processor.
HARDWARE LAB
The Intel 845 chipset complements the 850 chipset by offering support for the
high volume cost effective PCI 33 SDRAM memory for P4 processor system.
This chipset supports up to 3GB memory on 3 DIMM slots for corporate users
then, P4 offers excellence performance on todays office applications.
Features:
1. 400MHz system bus:-Delivers a high BW connection between the PIV
processor & platforms providing 3X. The BW over platform based on Intel
P3 processor.
2. PCI 333 SDRAM:-Excludes support of the highest volume most cost
effective memory shipping today. This allows system receiver points.
3. 2 USB Controller:-Provides high performance peripherals with 24 mbps of
BW while enabling support for upto 4 USB ports.
This result in significant increase over pre integrated +4 ports hubs at 12mbps.
4. The latest AC 97 implementation deliver 8X channels of audio for enhanced
sound quality & full surround capabilities.
Integrated audio solution continues to enjoy success as a very effective at high
performance.
5. LCI (LAN Connect Interface):
Provides flexible network solution such as phone line; 0101100 mbps internet
101100 Mbps internet with LAN manageability.
6. BIOS setup: The BIOS ROM or the basic i/p, o/p system has an onscreen
system configuration setup utility program.
When a system is switched on POST routines the following message
appears on the screen.
HARDWARE LAB
Press <del> if you want to RUN SETUP. Press <del> to change the already
existing configuration of your system or configuring new system.
To reset BIOS and memory password you have two options
1.
2.
Or remove CMOS setup battery & allow 10 min for residual power in
HARDWARE LAB
Disabled
Pgup/Pgdn
Enabled
F1: Help
F2/F3:
Advanced CMOS Setup:Quick Boot:- Set up this option to enable to instruct AMIBIOS to boot quickly
when the comp is turned ON.
1st Boot Device:- This option sets up the types of device for the 1 st boot device
that the AMIBIOS attempts to boot from after AMIBIOS POST completion.
HARDWARE LAB
The settings are disabled. Network option SCSI CD-ROM, IDE-0, IDE-1,
IDE-2 or IDE-3.
The optical & fail safe default are IDE-0.
2nd Boot Device:- This option sets the type of device for the 2 nd book drive that the
AMIBIOS attempt to boot from after AMBIOS port completes.
The settings are disabled floppy or IDE-0. The optical is fail safe default
setting are floppy.
3rd Boot Device:- This option sets the type of device for the third boot device that
the AMIBIOS attempts to boot from after AMIBIOS POST completes.
Try Other Boot Device:- Set this option to yes to instruct AMIBIOS to attempt to
boot, from any other drive in system if it cant find a boot drive among the
devices specified in it boot-device option.
Intel Display Mode:Set this option to BIOS for initial display mode by BIOS. Setting in BIOS are
silent.
Display Mode At Add-On ROM NIT:Set the display mode at add on ROM NIT settings are force or beep current.
Floppy Access CTRL:This option specifies the read/write access that is set when booting from a floppy
drive. The settings read/write or write only.
Hard Disk Access Control:This option specifies the read/write access set when booting from a hard disk.
HARDWARE LAB
The settings are read/write or read only. The optical & fail safe default settings are
read write.
Smart For Hard Disk:Set it to OFF to turn this by off. When, computer boots up so you use the
arrow keys on both the numeric keyboard on the keyboard.
PS12 Mouse Support:Enable it to enable AMIBIOS supply for a PS/2 mouse.
The settings are enabled / disabled.
Primary Display:This option configures the monitor attached to the computer. The optimal is
fail-safe default settings are VGA/BGA password check.
This option enables password check when system boot up or when AMIBIOS
set up is run settings are setup as always.
Boot to OS12 T64MB:Set this option to enable if running OS/2 operating system in using more than
64MB of system memory on the motherboard.
The settings are enabled or disabled.
CPU Serial No.:Set this option to enable to display CPU serial no. these settings are enabled or
disabled.
System BIOS Cacheable:When set to enable the contents of F000H system memory segment can be
read from or written to cache memory. The contents of this memory segment are
always copied from BIOS ROM to system ROM for faster execution.
The settings are disabled or enabled.
HARDWARE LAB
AMIBIOS Setup Advanced CMOS Setup: 1998 American Met trends inc. all rights reserved.
Quick Boot
Enabled
Available Opp.
Floppy
Disabled
IDEO
Enabled
CD-ROM
Yes
BIOS
BIOS
Read/Write
Enabled
ON
Disabled
Disabled
Enabled
Primary Display
VGA/EGA
Setup
Disabled
Pgup/Pgdn
L1 cache
Write Back
Modify
L2 cache
Write Back
F1: Help P2
Power Management:- This page sets some of the parameters for the system power
management operation ROM PC/ISA BIOS C2AS (HH6C)
ACPI function
: Enables
Primary INTR: ON
Power Management
: User defined
PM Ctrl by AM
: Yes
IRQ4: Primary
: Blank Screen
HARDWARE LAB
: Suspend
:3
POZE mode
: Disable
Suspend Mode
: Disable
: Disable
: Relay 4 sec
: Off
**PM events**
: Off
: LPT/COM
: OFF
DMA / Master
: OFF
RT alarm resume
HARDWARE LAB
HDD &FDD: If this is enabled only activity on the hard disk devices or floppy
disk drive resumes, the sys from s/w from s/w power down or a power saving
mode.
DMA/MASTER: If enabled only activity on sys DMA channel can resume
system from a system power down or power saving mode.
RTC ALARM RESUME: If enabled you can use the sole items to set on alarm
time on the sys real time clock.
The alarm can (work the) wake the system up from the power saving mode or
S/W power down.
MODEM RING RESUM: If enabled the system can be resumed from a power
mode or a s/w power down by an incoming call to the fax/modem.
PRIMARY/MTR: If you enable this item you can use the following list to
interrupt, select which interrupt have an effect ever the power mgmt. routine.
IRQ13- IRQ14: Interrupt requests are allocated to various systems resources. Use
these items to determine the effect of any activity on IRQ line. If you select
disabled there is no effect, if you select secondary activity on the IRQ will reset
the power down time outs. If you select the primary activity on the IRQ will reset
the power down or power saving mode.
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
Design Problem:1) Study the latest motherboard and their on-board circuitry.
2) Study the different CMOS setup tools for Motherboard.
3) List the advanced diagnostic tools for new motherboards.
CONCLUSION:
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
ASSIGNMENT NO: 10
TITLE: Write an 8051 ALP for rate generation using Timer0/Timer1 by using
Computer Department. SIT, Lonavala
HARDWARE LAB
a. Polling method
b. ISP method
THEORY:
Introduction:
The Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended.
The Short and Standard chips are often available in DIP form, but the Extended 8051
models often have a different form factor, and are not "drop-in compatable". All these
things are called 8051 because they can all be programmed using 8051 assembly
language, and they all share certain features (although the different models all have their
own special features).
Some of the features that have made the 8051 popular are:
8051 models may also have a number of special, model-specific features, such as UARTs,
ADC, Op Amps, etc.
HARDWARE LAB
PIN 9: PIN 9 is the reset pin which is used reset the microcontrollers internal registers
and ports upon starting up.
PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect
a crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs
+5V 500mA to function properly, although there are lower powered versions like the
Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in
flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If
external memory is connected then PIN 31, also called EA/VPP, should be connected to
ground to indicate the presence of external memory. PIN 30 is called ALE (address latch
enable), which is used when multiple memory chips are connected to the controller and
only one of them needs to be selected. We will deal with this in depth in the later
chapters. PIN 29 is called PSEN. This is "program select enable". In order to use the
external memory it is required to provide the low voltage (0) on both PSEN and EA pins.
There are 4 8-bit ports: P0, P1, P2 and P3.
HARDWARE LAB
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be
used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or
additional functions associated with them based upon the context of their usage.
PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional
functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external
counter inputs, read and write pins for memory access.
PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when
no external memory is present, but if external memory access is required then PORT P2
will act as an address bus in conjunction with PORT P0 to access external memory.
PORT P2 acts as A8-A15, as can be seen from fig 1.1
PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no
external memory is present, but if external memory access is required then PORT P0 acts
as a multiplexed address and data bus that can be used to access external memory in
conjunction with PORT P2. P0 acts as AD0-AD7
Oscillator circuit:
The 8051 requires the existance of an external oscillator circuit. The oscillator circuit
usually runs around 12MHz, although the 8051 (depending on which specific model) is
capable of running at a maximum of 40MHz. Each machine cycle in the 8051 is 12 clock
cycles, giving an effective cycle rate at 1MHz (for a 12 KHz clock) to 3.33MHz (for the
maximum 40MHz clock).
Internal schematics of the 8051.
Data and Program Memory
The 8051 Microprocessor can be programmed in PL/M, 8051 Assembly, C and a number
of other high-level languages. Many compilers even have support for compiling C++ for
an 8051.
Program memory in the 8051 is read-only, while the data memory is considered to be
read/write accessible. When stored on EEPROM or Flash, the program memory can be
rewritten when the microcontroller is in the special programmer circuit.
HARDWARE LAB
Direct Memory
The 8051 has 256 bytes of internal addressable RAM, although only the first 128 bytes
are available for general use by the programmer. The first 128 bytes of RAM (from 0x00
to 0x7F) are called the Direct Memory, and can be used to store data.
Special Function Register
The Special Function Register (SFR) is the upper area of addressable memory, from
address 0x80 to 0xFF. This area of memory cannot be used for data or program storage,
but is instead a series of memory-mapped ports and registers. All port input and output
can therefore be performed by memory mov operations on specified addresses in the
SFR. Also, different status registers are mapped into the SFR, for use in checking the
status of the 8051, and changing some operational parameters of the 8051.
General Purpose Registers
The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means
that there are essentially 32 available general purpose registers, although only 8 (one
bank) can be directly accessed at a time. To access the other banks, we need to change the
current bank number in the flag status register.
A and B Registers
The A register is located in the SFR at memory location 0xE0. The A register works in a
similar fashion to the AX register of x86 processors. The A register is called the
accumulator, and by default it receives the result of all arithmetic operations. The B
register is used in a similar manner, except that it can receive the extended answers from
the multiply and divide operations. When not being used for multiplication and Division,
the B register is available as an extra general-purpose register.
FAQs:1) What is the function of 8051?
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
__________________________________________________________________
__________________________________________________________________
9) What is Mode1?
__________________________________________________________________
__________________________________________________________________
10) What is Mode2?
__________________________________________________________________
__________________________________________________________________
11) What is Mode3?
__________________________________________________________________
__________________________________________________________________
Design Problem:1) Write a Program to keep 8051 in every mode ie Mode0, Mode1, Mode2, Mode3.
2) Write the program to transfer data to port?
3) Write the program to perform data transfer between two ports?
CONCLUSION:
________________________________________________________________________
________________________________________________________________________
HARDWARE LAB
ASSIGNMENT NO: 11
TITLE: Write an 8051 ALP for serial port programming to transfer block of data using
a. Polling method
b. ISP method
THEORY:
Computers transfer data in two ways:
Parallel
Often 8 or more lines (wire conductors) are used to transfer data to a device that is only a
few feet away.
Serial
To transfer to a device located many meters away, the serial method is used The data is
sent one bit at a time.
At the transmitting end, the byte of data must be converted to serial bits using parallel-inserial-out shift register
At the receiving end, there is a serial-in-parallel-out shift register to receive the serial
data and pack them into byte
When the distance is short, the digital signal can be transferred as it is on a simple wire
and requires no modulation
If data is to be transferred on the
telephone line, it must be converted from 0s and 1s to audio tones
Serial data communication uses two methods
1. Synchronous method transfers a block of data at a time.
2. Asynchronous method transfers a single byte at a time.
It is possible to write software to use either of these methods, but the programs can be
tedious and long
There are special IC chips made by many manufacturers for serial communications
1. UART (universal asynchronous Receiver transmitter)
2. USART (universal synchronous-asynchronous Receiver-transmitter)
HARDWARE LAB
ASCII
character
(8-bit
ina
To allow data transfer between the PC and an 8051 system without any error, we must
make sure that the baud rate of 8051 system matches the baud rate of the PCs COM port
Hyperterminal function supports baud rates much higher than listed below
Sender Receiver
Baud Rate
19200
9600
4800
2400
1200
600
300
150
110
With XTAL = 11.0592 MHz, find the TH1 value needed to have the
following baud rates. (a) 9600 (b) 2400 (c) 1200
The machine cycle frequency of 8051 = 11.0592 / 12 = 921.6 kHz,
and 921.6 kHz / 32 = 28,800 Hz is frequency by UART to timer 1 to
Computer Department. SIT, Lonavala
HARDWARE LAB
HARDWARE LAB
SM0, SM1
They determine the framing of data by specifying the number of bits per character,
and the start and stop bits
SM2
This enables the multiprocessing capability of the 8051
SM0
Only mode 1 is
of interest to us
REN (receive enable)
It is a bit-adressable register
When it is high, it allows 8051 to receive data on
RxD pin
If low, the receiver is disable
TI (transmit interrupt)
When 8051 finishes the transfer of 8-bit character
It raises TI flag to indicate that it is ready to transfer another byte
TI bit is raised at the beginning of the stop bit
Computer Department. SIT, Lonavala
HARDWARE LAB
RI (receive interrupt)
When 8051 receives data serially via RxD, it gets rid of the start and stop bits and
places the byte in SBUF register
It raises the RI flag bit to indicate that a byte has been received and should be picked
up before it is lost
RI is raised halfway through the stop bit
The steps that 8051 goes through in transmitting a character via TxD
1. The byte character to be transmitted is written into the SBUF register
2. The start bit is transferred
3. The 8-bit character is transferred on bit at a time
4. The stop bit is transferred
It is during the transfer of the stop bit that 8051 raises the TI flag, indicating that the
last character was transmitted
5. By monit
oring the TI flag, we make sure that we are not overloading the SBUF
If we write another byte into the SBUF before TI is raised, the untransmitted portion of
the previous byte will be lost
6. After SBUF is loaded with a new byte, the TI flag bit must be forced to 0 by CLR TI
in order for this new byte to be transferred
In receiving bit via its RxD pin, 8051goes through the following steps
1. It receives the start bit
Indicating that the next bit is the first bit of the character byte it is about to receive
2. The 8-bit character is received one bit at time
3. The stop bit is received
When receiving the stop bit 8051 makes RI = 1,indicating that an entire character byte
has been received and must be picked up before it gets overwritten by an incoming
character
4. By checking the RI flag bit when it is raised, we know that a character has been
received and is sitting in the SBUF register
We copy the SBUF contents to a safe place in some other register or memory before it
is lost
5. After the SBUF contents are copied into a safe place, the RI flag bit must be forced
to 0 by CLR RI in order to allow the next received character byte to be placed in SBUF
Failure to do this causes loss of the received character
FAQs:1) Explain protocol used by sender and receiver while transmission of data.
__________________________________________________________________
__________________________________________________________________
HARDWARE LAB
HARDWARE LAB
9) With XTAL = 11.0592 MHz, find the TH1 value needed to have the
baud rate = 4800
__________________________________________________________________
__________________________________________________________________
10) With XTAL = 11.0592 MHz, find the TH1 value needed to have the
baud rate = 600
__________________________________________________________________
__________________________________________________________________
Design Problem:1) Write a Program to transfer ASCII character B continuously
2) Write a program to transfer This is 8051 Assignment message using serial port
3) Write program to transfer YES message serially using ISR.
CONCLUSION:
________________________________________________________________________
________________________________________________________________________