Directory Entry-System Programming-Lecture Notes, Study notes of System Programming

This lecture handout is for System Programming course. It was provided by Prof. Indubhushan Vijayabhas at Ambedkar University, Delhi. It includes: Program, Command, Directory, Dump, Entry, Long, Name, Drive, Parameter, Block, Slide

Typology: Study notes

2011/2012

Uploaded on 08/07/2012

anishay
anishay 🇮🇳

4.2

(25)

118 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture # 37
Lets now perform few more experiments to see how long file names are managed.
Windows can have long file names up to 255 characters. For This purpose a file is
created with a long file name as shown in the slide below.
Following shows the result of DIR command on the same volume.
Long FileName
Volume in drive H is NEW VOLUME
Volume Serial Number is 8033-3F79
Directory of H:\
09/14/2005 10:00 AM <DIR> New Folder
10/23/2005 11:20 AM 0 I am new file to experiment long file
names.txt
1 File(s) 0 bytes
1 Dir(s) 409,944,064 bytes free
docsity.com
pf3
pf4
pf5
pf8

Partial preview of the text

Download Directory Entry-System Programming-Lecture Notes and more Study notes System Programming in PDF only on Docsity!

Lecture # 37

Lets now perform few more experiments to see how long file names are managed.

Windows can have long file names up to 255 characters. For This purpose a file is

created with a long file name as shown in the slide below.

Following shows the result of DIR command on the same volume.

Long FileName

Volume in drive H is NEW VOLUME

Volume Serial Number is 8033-3F

Directory of H:\

09/14/2005 10:00 AM New Folder

10/23/2005 11:20 AM 0 I am new file to experiment long file

names.txt

1 File(s) 0 bytes

1 Dir(s) 409,944,064 bytes free

In the following slide the DPB of the volume is being read.

Drive Parameter Block

-a 0AFC:0100 mov ah, 0AFC:0102 int 21 0AFC:

-p AX=3200 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 D I= DS=0AFC ES=0AFC SS=0AFC CS=0AFC IP=0102 NV UP EI PL NZ NA PO NC 0AFC:0102 CD21 INT 21

-p AX=3200 BX=13D2 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 D I= DS=00A7 ES=0AFC SS=0AFC CS=0AFC IP=0104 NV UP EI PL NZ NA PO NC 0AFC:0104 06 PUSH ES

-d a7:13d

00A7:13D0 07 07 00 02 0F 04-08 00 02 00 02 B0 01 87 ..............
00A7:13E0 C3 C4 00 90 01 56 34 12-00 F8 0A FF FF FF FF 00 .....V4.........

00A7:13F0 00 7A C3 00 00 00 00 00-00 00 00 00 00 00 00 00 .z.............. 00A7:1400 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00A7:1410 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00A7:1420 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00A7:1430 00 00 00 00 00 00 00 0C-00 00 80 00 06 0B 10 00 ................ 00A7:1440 2E 0A 4D 5A 9A 00 29 00-00 00 20 00 C5 00 FF FF ..MZ..)... ..... 00A7:1450 A7 05 ..

Using the information in DPB the root directory entries are read and are being shown in

the slide below.

Directory Entry

-l 1000 7 190 20

-d 1000 0AFC:1000 4E 45 57 20 56 4F 4C 55-4D 45 20 08 00 00 00 00 NEW VOLUME ..... 0AFC:1010 00 00 00 00 00 00 04 4F-2E 33 00 00 00 00 00 00 .......O.3...... 0AFC:1020 41 4E 00 65 00 77 00 20-00 46 00 0F 00 DD 6F 00 AN.e.w. .F....o. 0AFC:1030 6C 00 64 00 65 00 72 00-00 00 00 00 FF FF FF FF l.d.e.r......... 0AFC:1040 4E 45 57 46 4F 4C 7E 31-20 20 20 10 00 41 09 50 NEWFOL~1 ..A.P 0AFC:1050 2E 33 2E 33 00 00 0A 50-2E 33 02 00 00 00 00 00 .3.3...P.3...... 0AFC:1060 42 20 00 49 00 6E 00 66-00 6F 00 0F 00 72 72 00 B .I.n.f.o...rr. 0AFC:1070 6D 00 61 00 74 00 69 00-6F 00 00 00 6E 00 00 00 m.a.t.i.o...n... 0AFC:1080 01 53 00 79 00 73 00 74-00 65 00 0F 00 72 6D 00. S.y.s.t.e...rm. 0AFC:1090 20 00 56 00 6F 00 6C 00-75 00 00 00 6D 00 65 00 .V.o.l.u...m.e. 0AFC:10A0 53 59 53 54 45 4D 7E 31-20 20 20 16 00 44 09 50 SYSTEM~1 ..D.P 0AFC:10B0 2E 33 2E 33 00 00 0A 50-2E 33 03 00 00 00 00 00 .3.3...P.3...... 0AFC:10C0 E5 6D 00 65 00 6E 00 74-00 2E 00 0F 00 9F 74 00. m.e.n.t......t. 0AFC:10D0 78 00 74 00 00 00 FF FF-FF FF 00 00 FF FF FF FF x.t............. 0AFC:10E0 E5 4E 00 65 00 77 00 20-00 54 00 0F 00 9F 65 00. N.e.w. .T....e. 0AFC:10F0 78 00 74 00 20 00 44 00-6F 00 00 00 63 00 75 00 x.t. .D.o...c.u. 0AFC:1100 E5 45 57 54 45 58 7E 31-54 58 54 20 00 9D 11 50 .EWTEX~1TXT ...P 0AFC:1110 2E 33 2E 33 00 00 12 50-2E 33 00 00 00 00 00 00 .3.3...P.3...... 0AFC:1120 E5 79 00 73 00 74 00 65-00 6D 00 0F 00 A4 2E 00. y.s.t.e.m...... 0AFC:1130 74 00 78 00 74 00 00 00-FF FF 00 00 FF FF FF FF t.x.t........... 0AFC:1140 E5 6C 00 20 00 74 00 68-00 65 00 0F 00 A4 20 00 .l. .t.h.e..... 0AFC:1150 66 00 61 00 74 00 31 00-36 00 00 00 20 00 73 00 f.a.t.1.6... .s. 0AFC:1160 E5 66 00 69 00 6C 00 65-00 20 00 0F 00 A4 74 00. f.i.l.e. ....t.

Now lets move our discussion to FAT32. In theory the major difference between FAT 16

and FAT 32 is of course the FAT size. FAT32 evidently will contain more entries and

can hence manage a very large disk whereas FAT16 can manage a space of 2 GB

maximum practically.

Following slide shows the structure of the BPB for FAT32. Clearly there would be some

additional information required in FAT32 so the structure for BPB used in FAT32 is

different.

Fat32 BPB Structure

Fat Type Determination

if(BPB_ FATSz16 != 0)

FATSz = BPB_ FATSz16 ;

else

FATSz = BPB_ FATSz32 ;

if(BPB_TotSec16 != 0)

TotSec = BPB_TotSec16;

else

TotSec = BPB_TotSec32;

DataSec = TotSec – (BPB_ResvdSecCnt + (BPB_Num FATs * FATSz) +

RootDirSectors);

CountofClusters = DataSec / BPB_SecPerClus ;

if(CountofClusters < 4085)

/* Volume is FAT12 */

else if(CountofClusters < 65525)

/* Volume is FAT16 */

else

/* Volume is FAT32 */