=========================================== Dumping DOS Directory Structure using DEBUG =========================================== -IAN! idallen@ncf.ca This file gives a disk dump (using DEBUG) of the ROOT directory on a disk and then asks you questions about it. ------------------------------ Output of the DOS DIR command: ------------------------------ Volume in drive A is DAT2343DEMO Volume Serial Number is FEED-FACE Directory for A:/ FINLEXAM WPD 37976 04-05-2000 8:19 finlexam.wpd DIRECT~1 04-13-2000 10:31 directory PROJECT4 TXT 1569 04-03-2000 6:46 project4.txt TOTAL ASM 4908 04-03-2000 7:16 total.asm GETSHOW ASM 5493 04-03-2000 10:15 getshow.asm MERCURY TXT 0 04-13-2000 10:37 mercury.txt EARTH TXT 0 04-13-2000 10:37 earth.txt 8 files 53 291 bytes 1 401 856 bytes free ------------------------------------------------------- DEBUG output for the same (root) directory on the disk: ------------------------------------------------------- Note the Volume Label and deleted files: 1585:2600 44 41 54 32 33 34 33 44-45 4D 4F 28 00 00 00 00 DAT2343DEMO(.... 1585:2610 00 00 00 00 00 00 83 44-EA 22 00 00 00 00 00 00 .......D."...... 1585:2620 41 66 00 69 00 6E 00 6C-00 65 00 0F 00 0C 78 00 Af.i.n.l.e....x. 1585:2630 61 00 6D 00 2E 00 77 00-70 00 00 00 64 00 00 00 a.m...w.p...d... 1585:2640 46 49 4E 4C 45 58 41 4D-57 50 44 20 00 6A F3 42 FINLEXAMWPD .j.B 1585:2650 85 28 85 28 00 00 77 42-85 28 B1 00 58 94 00 00 .(.(..wB.(..X... 1585:2660 41 64 00 69 00 72 00 65-00 63 00 0F 00 6F 74 00 Ad.i.r.e.c...ot. 1585:2670 6F 00 72 00 79 00 00 00-FF FF 00 00 FF FF FF FF o.r.y........... 1585:2680 44 49 52 45 43 54 7E 31-20 20 20 10 00 47 FC 53 DIRECT~1 ..G.S 1585:2690 8D 28 8D 28 00 00 FD 53-8D 28 4D 00 00 00 00 00 .(.(...S.(M..... 1585:26A0 41 70 00 72 00 6F 00 6A-00 65 00 0F 00 48 63 00 Ap.r.o.j.e...Hc. 1585:26B0 74 00 33 00 2E 00 74 00-78 00 00 00 74 00 00 00 t.4...t.x...t... 1585:26C0 50 52 4F 4A 45 43 54 34-54 58 54 20 00 8A D7 42 PROJECT4TXT ...B 1585:26D0 85 28 85 28 00 00 D9 35-83 28 98 00 21 06 00 00 .(.(...5.(..!... 1585:26E0 41 74 00 6F 00 74 00 61-00 6C 00 0F 00 11 2E 00 At.o.t.a.l...... 1585:26F0 61 00 73 00 6D 00 00 00-FF FF 00 00 FF FF FF FF a.s.m........... 1585:2700 54 4F 54 41 4C 20 20 20-41 53 4D 20 00 A7 D8 42 TOTAL ASM ...B 1585:2710 85 28 85 28 00 00 17 3A-83 28 9C 00 2C 13 00 00 .(.(...:.(..,... 1585:2720 41 67 00 65 00 74 00 73-00 68 00 0F 00 A7 6F 00 Ag.e.t.s.h....o. 1585:2730 77 00 2E 00 61 00 73 00-6D 00 00 00 00 00 FF FF w...a.s.m....... 1585:2740 47 45 54 53 48 4F 57 20-41 53 4D 20 00 49 D9 42 GETSHOW ASM .I.B 1585:2750 85 28 85 28 00 00 E3 51-83 28 A6 00 75 15 00 00 .(.(...Q.(..u... 1585:2760 41 6D 00 65 00 72 00 63-00 75 00 0F 00 64 72 00 Am.e.r.c.u...dr. 1585:2770 79 00 2E 00 74 00 78 00-74 00 00 00 00 00 FF FF y...t.x.t....... 1585:2780 4D 45 52 43 55 52 59 20-54 58 54 20 00 55 B4 54 MERCURY TXT .U.T 1585:2790 8D 28 8D 28 00 00 B5 54-8D 28 00 00 00 00 00 00 .(.(...T.(...... 1585:27A0 E5 76 00 65 00 6E 00 75-00 73 00 0F 00 CA 2E 00 .v.e.n.u.s...... 1585:27B0 74 00 78 00 74 00 00 00-FF FF 00 00 FF FF FF FF t.x.t........... 1585:27C0 E5 45 4E 55 53 20 20 20-54 58 54 20 00 A5 B4 54 .ENUS TXT ...T 1585:27D0 8D 28 8D 28 00 00 B5 54-8D 28 AB 00 78 56 00 00 .(.(...T.(...... 1585:27E0 41 65 00 61 00 72 00 74-00 68 00 0F 00 A5 2E 00 Ae.a.r.t.h...... 1585:27F0 74 00 78 00 74 00 00 00-FF FF 00 00 FF FF FF FF t.x.t........... 1585:2800 45 41 52 54 48 20 20 20-54 58 54 20 00 B9 B4 54 EARTH TXT ...T 1585:2810 8D 28 8D 28 00 00 B5 54-8D 28 00 00 00 00 00 00 .(.(...T.(...... 1585:2820 E5 6D 00 61 00 72 00 73-00 2E 00 0F 00 C4 74 00 .m.a.r.s......t. 1585:2830 78 00 74 00 00 00 FF FF-FF FF 00 00 FF FF FF FF x.t............. 1585:2840 E5 41 52 53 20 20 20 20-54 58 54 20 00 1A B5 54 .ARS TXT ...T 1585:2850 8D 28 8D 28 00 00 B6 54-8D 28 F0 01 34 12 00 00 .(.(...T.(...... 1585:2860 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 1588:2870 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 1585:2880 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 1585:2890 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ ========== Exercises: ========== ------- Part I: ------- 1) List the names and attributes of all entries that are not ordinary files. 2) Find the DOS names of all deleted entries in this directory. 3) List the sizes and starting clusters of all the ordinary files in both hexadecimal and decimal. 4) What formulas are used to calculate the Absolute (Disk) Sector number of a file? 5) Using information about the disk geometry from the following BOOT block DEBUG dump, give the absolute sector number of the first sector of every non-empty file in both decimal and hexadecimal: C:\>DEBUG -L 0 0 0 1 -D 0 9876:0000 EB 45 90 2B 4A 59 73 35-49 48 43 00 02 02 01 00 9876:0010 02 E0 00 40 0B F0 09 00-12 00 02 00 00 00 00 00 ... -------- Part II: -------- 6) Calculate (in decimal) the C/H/S (Cylinder/Head/trackSector) location of every starting sector from the previous question. Which sectors are on the top and which are on the bottom of the disk? Bonus: Write a program that, given sectors per track, number of heads, and an absolute sector number, returns the C/H/S of the given sector.