Presentation is loading. Please wait.

Presentation is loading. Please wait.

mPMCI Introduction Basic block diagram of computer

Similar presentations


Presentation on theme: "mPMCI Introduction Basic block diagram of computer"— Presentation transcript:

1 mPMCI Introduction Basic block diagram of computer
What is a microprocessor? Existing microprocessors Basic concepts- Address bus Data bus Control bus Use of ALE Memory segmentation etc.

2 Block Diagram of Computer

3 Unit - I MSDOS FAT Device Drivers 8255 – PPI

4 Ms-dos file system C:\>dir Volume in drive C has no label.
Volume Serial Number is 54CA-076A Directory of C:\ 08/01/ :16 AM AUTOEXEC.BAT 04/18/ :16 PM <DIR> CompleteChatApplication 03/11/ :41 PM CONFIG.SYS 03/11/ :45 PM <DIR> Documents and Settings 04/04/ :08 PM <DIR> MATLAB7 03/11/ :22 PM nvscnrpt.log 03/11/ :12 PM <DIR> Old Ibm Driver 04/09/ :20 PM <DIR> Program Files 04/09/ :58 AM qhdebug.log 03/11/ :19 PM <DIR> temp 04/19/ :28 PM <DIR> WINDOWS 4 File(s) bytes 7 Dir(s) 3,813,830,656 bytes free C:\>

5 Fig.1 An MS-DOS File System Structure
Drive Identifier Root Directory (‘ \ ’) File A Directory X File B Directory Y File C File D Directory Z File E Fig.1 An MS-DOS File System Structure

6 D : \ VMP \ fasm \ EXAMPLES>
Root Directory Sub-Directory Current Drive Identifier Current Directory This is called as “Path.” A complete path from root directory, prefixed by a logical drive code and followed by a filename & extension is called as “Fully Qualified Filename”.

7 FAT(File Allocation Table)
The File Allocation Table itself is the area on the hard drive that stores information concerning every cluster on the drive. By storing this information in a single area, the operating system can find the nearest free sections of memory without searching the entire drive. This helps to avoid major wear and tear on the memory device. The File Allocation Table system ensures that files can be found and accessed anywhere on a drive with minimal time spent seeking. This not only helps to minimize the wear on the physical components of the drive, it also ensures that files can be accessed quickly. This leads to increased performance and efficiency. The simplicity and availability of the FAT system make it ideal for use on memory devices that are accessed by many different operating systems.

8 FAT(File Allocation Table)
A File Allocation Table (FAT) is a system used by computers in order to store file information. MS-DOS assigns, for each newly created file, groups of sectors from files area in powers of 2. These are called as “Allocation units” or “clusters”. The no. of sectors/cluster is defined in BPB. The FAT system stores information in a series of clusters. Disk Type Power of 2 Sectors/cluster 5.25” 180kb FD 1 5.25” 360kb FD 2 PC/AT fixed Disk 4 PC/XT fixed disk 3 8

9 FAT(File Allocation Table)contd…
FAT gives information about how he disk space in files area is used: Space used for files Space that is not in use Space that can not be used due to defects DOS maintains two or more identical copies of FAT. FAT has a 32-bit entry for every cluster in the files area. First two entries contain media descriptor value Special code used in FAT: ‘EOF’ ‘0’(i.e. Zero) ‘BAD’ Descriptor Medium 0F0H 3.5” Floppy Disk, 2 sided, 18 sector 0F8H Fixed Disk 0FCH 5.25” floppy disk,1 sided, 9 sector

10 Ms-dos boot record A boot sector is the portion of a hard disk or floppy disk that has the code stored on it to boot special programs, and to reference other key features to keep the disk working. There are many types of boot sectors, but there are two main ones: the master boot record and the volume boot record. A master boot sector exists on a drive that has been partitioned, and it usually finds the active partition and run its own volume boot record. The volume boot record, in turn, often contains code to run the operating system on the computer.

11 E9XXXX OR EB XX 90 00H OEM NAME & VERSION ( 8 BYTES) 03H MSDOS VERSION 2.0 BYTES / SECTOR (2 BYTES) 0BH SECTORS / ALLOCATION UNIT (1 BYTE) 0DH RESERVED SECTORS, STARTING AT 0 (2 BYTES) 10H NUMBER OF FATS ( 1 BYTE) 11H NUMBER OF ROOT DIRECTORY ENTRIES(2 BYTES) 13H TOTAL SECTORS IN LOGICAL VOLUME(2 BYTES) 15H MEDIA DESCRIPTOR BYTE 16H NUMBER OF SECTORS / FAT (2 BYTES) 18H MSDOS VERSION 3.0 SECTORS / TRACK (2 BYTES) 1AH NUMBER OF HEADS(2 BYTES) 1CH NUMBER OF HIDDEN SECTORS(4 BYTES) 20H MSDOS VERSION 4.0 TOTAL SECTORS IN LOGICAL VOLUME (MSDOS 4.0 & VOLUME SIZE > 32MB) 24H PHYSICAL DRIVE NUMBER 25H ADDITIONAL MSDOS VERSION 4.0 INFORMATION RESERVED 26H EXTENDED BOOT SIGNATURE RECORD 27H 32 BIT BINARY VOLUME ID 2BH VOLUME LABEL( 11 BYTES) 36H RESERVED( 8 BYTES) 3EH BOOT STRAP BPB

12 Byte Capacity Media Size and Type
Media Descriptor: This byte provides information about the media being used. The following table lists some of the recognized media descriptor values and their associated media. Note that the media descriptor byte may be associated with more than one disk capacity. Byte Capacity Media Size and Type F MB 3.5-inch, 2-sided, 36-sector F MB 3.5-inch, 2-sided, 18-sector F9 720 KB 3.5-inch, 2-sided, 9-sector F9 1.2 MB 5.25-inch, 2-sided, 15-sector FD 360 KB 5.25-inch, 2-sided, 9-sector FF 320 KB 5.25-inch, 2-sided, 8-sector FC 180 KB 5.25-inch, 1-sided, 9-sector FE 160 KB 5.25-inch, 1-sided, 8-sector F Fixed disk

13 Interaction between user & hardware
User level User applications Various OS components Device drivers Device controllers I/O devices OS level Hardware level

14 Device drivers A device driver is a program that a computer's operating system uses to control a particular hardware device that is attached to a computer. There are device drivers for printers, displays, CD-ROM readers, diskette drives, and so on. In Windows operating systems, a device driver file usually has a file name suffix of DLL or EXE. A virtual device driver usually has the suffix of VXD. There are 2 types: Resident device drivers Installable device drivers

15 Device drivers contd… DEVICE TYPES Block-oriented
information is stored in fixed sized blocks transfers are made a block at a time used for disks and tapes Stream-oriented/character devices transfer information as a stream of bytes used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage

16 Device drivers contd… Accordingly, there are two types of
installable device drivers: Block device drivers Character device drivers There are two modes of operation: ASCII mode – waits for some special character such as CTRL+C,CTRL+Z etc. Binary mode – reads/writes exact no. of requested bytes.

17 Structure of device driver
Device Driver Header Strategy Routine(strat) Interrupt Routine(intr)

18 Fig. General Structure Of MSDOS Installable Device Driver
INTERRUPT ROUTINE INITIALIZATION MEDIA CHECK BUILD BPB IOCTL READ & 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 Fig. General Structure Of MSDOS Installable Device Driver

19 FIG. DEVICE DRIVER HEADER
LINK TO NEXT DRIVER, OFFSET 02H LINK TO NEXT DRIVER, SEGMENT 04H DEVICE ATTRIBUTE WORD 06H STRATEGY ENTRY POINT, OFFSET 08H INTERRUPT ENTRY POINT, OFFSET 0AH LOGICAL NAME(8-BYTES) IF CHARACTER DEVICE OR NO. OF UNITS(1-BYTE) IF BLOCK DEVICE FOLLOWED BY RESERVED SPACE(7 BYTES) FIG. DEVICE DRIVER HEADER

20 FIG. FORMAT OF REQUEST HEADER
Request Struc Rlength db ? Unit db ? Command db ? Status dw ? Reserve db 8 Dup(?) Media db ? Address dd ? Count dw ? Sector dw ? Request Ends ;request header template structure ;0 – length of Request header ;1 – unit no. For this request ;2 – request header’s command code ;3 – driver’s return status word ;5 – reserved area ;13 – Media descriptor byte ;14 – Memory address for transfer ;18 – byte/sector count value ;20 – starting sector value ;request header template ends FIG. FORMAT OF REQUEST HEADER

21 Interrupt routine A collection of subroutines to implement the various function types called command codes. A centralized entry point – that saves all the affected registers, extracts the desired function code from the request header & branches to appropriate command code routine. A centralized exit point – that stores status & error codes into the request header & restores the previous contents of the affected registers.

22 .com files a COM file is a type of executable file; the name is derived from the file name extension .COM. Originally, the term stood for "Command file", a text file containing commands to be issued to the operating system. The COM format is the original binary executable format used in CP/M and MS-DOS. It is very simple; it has no header, and contains no metadata, only code and data i.e.it resides on disk as absolute image. Since it lacks relocation information, it is loaded by the operating system at a pre-set address, at offset 0x0100, where it is executed

23 .exe file No limit on size.
.exe program can be fit in the small,medium or large module in which segment register contain different value i.e. Code, data & stack will reside in different segments. .EXE program may have multiple code & data segments. A .EXE program resides in a special file with extension .EXE. It also contains a unique header, checksum & relocation map etc.

24 .COM FILE .EXE FILE 1. Max. Size of these programs is 64KB 1. They can be as large as available memory space. 2.In Intel 8086, .COM file is fixed in tiny module in which all segment register contain same value i.e. Code & data are mixed together. 2. .EXE program fit into small, medium or large module in which segment register contain different value 3. It reside on disk as absolute memory image in file. 3. It also contains a unique header, checksum & relocation map etc.

25 I/o port address decoder
Two methods are available: 1. I/O mapped I/O (isolated I/O) • I/O Ports are isolated from memory in a separate I/O address space. • Memory can be expanded to full size • Data transfer from/to I/O is restricted to IN and OUT instructions. Two forms: 1.Fixed Port e.g. IN AL, 38h IN AL, C000H 2.Variable Port e.g. MOV DX,FFF8H IN AL,DX • Separate control signals using M/IO, WR, RD enable I/O ports. • Intel-based PC’s use isolated I/O

26 I/o port address decoder contd…
2. Memory Mapped I/O • I/O device is treated as a memory location. • Any memory transfer instruction can used to access the device. e.g.ADD AL,DS:BYTE PTR[0C000H] • Reduces amount of system memory available to applications. • Reserves fixed portion(s) of the memory map for I/O. • 6800, uses memory-mapped I/O.

27 I/o port address decoder
Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 A A14 A15 G1 G2# G3# C B A3

28 TRUTH TABLE FOR GIVEN ADDRESS DECODER
- A6 A5 A4 A3 A2 A1 A0 PORT ADDRESS 1 X C000 C008 C010 C018 C020 C028 C030 C038

29 Direct I/O v.s. Memory-Mapped I/O
FFFFF FFFFF Memory addressing space I/O FFFF I/O addressing space Memory addressing space 00000 00000 0000 Memory-mapped I/O Direct I/O Direct I/O: I/O addresses are separated from memory address Advantage: Do not take memory addressing space Disadvantage: Use only AL or AX transferring data Memory-mapped I/O: I/O ports are treated as memory locations Advantage: Accessing I/O ports is like accessing memory locations Can use other instructions to access I/O ports Disadvantage: Take memory addressing space

30 Methods of parallel data transfer
Simple I/O Strobed I/O SENDER RECEIVER DATA LINES SENDER RECEIVER DATA LINES STB

31 Pinout of 8255

32 8255 ppi

33 Mode select control word

34 BSR control word

35 Mode selection of the 8255 While ports A, B, and C are used for I/O data, it is the control register that must be programmed to select the operation mode of the three ports A, B, and C. The ports of the 8255 can be programmed in any of the following modes It has three modes of operation

36 Mode 0(Basic Input/Output)
Simple I/O mode Any of the ports A, B, CL, and CU can be programmed as input or output All bits are out or all are in There is no control of individual bits

37 Mode 1(Strobed Input/Output)
Simple I/O with handshaking capabilities Ports A and B can be used as input or output ports with handshaking capabilities Handshaking signals are provided by the bits of port C The device provides the handshaking signals PA[7:0] STBA IBFA INTRA PC3 PC5 PC4 PB[7:0] STBB IBFB INTRB PC0 PC1 PC2 PC6, 7 8255 OBFA ACKA PC6 PC7 OBFB ACKB PC4, 5

38 Mode 2(Bi-Directional Bus)
Bidirectional port A with handshaking capabilities Port A can be used as a bidirectional I/O port with handshaking capabilities whose signals are provided by port C. The device provides the handshaking signals PA[7:0] OBFA ACKA INTRA PC4 PC6 PC7 STBA IBFA PC0 PC3 PC5 8255 PB[7:0] In Out Mode 0 STBB OBFB IBFB ACKB INTRB INTRB Mode 1

39 Summary of modes


Download ppt "mPMCI Introduction Basic block diagram of computer"

Similar presentations


Ads by Google