MIM3122 Computer Exercise #2
 

 For exercises 1. through 4. below, you will need a blank formatted 3 1/2" floppy disk. All exercises should be done in a DOS window.

1. Explore the boot record of a the formatted floppy using DEBUG. In DEBUG, the command L DS:100 0 0 1 will load the boot record from a disk in drive A: (L DS:100 1 0 1 will load the boot record from a disk in drive B:). Verify that entries such as the number of sectors per cluster, number of bytes per sector, and number of sectors agree with the disk type you are using. Check the boot record for volume label and volume serial number. Using the LABEL command, assign or change the volume name of the disk. Check results with the VOL command and a dump of the boot record. Observe some of the data sectors. What is in a blank data sector?

2. Beginning with a blank floppy disk, copy a text file at least 2000 bytes long to the disk. Find the starting cluster from the directory entry for the file (use DEBUG to display the sector with this information). Observe the FAT (again using DEBUG to display the appropriate sector). Convert at least one three-byte FAT entry into the requisite two cluster numbers. Check your results using CLUSTER.EXE (download from the course web page or assemble from CLUSTER.ASM found on the text's CDROM). Convert the first two cluster numbers into DOS sectors and look at these with DEBUG. Do you see the first part of your file?

To decode a three-byte FAT entry into two cluster numbers recall that the FAT entries begin in byte offset 3 and may be decoded using the following diagram or the algorithm contained in the FAT handout.

FAT entry:         0 3 4 0 0 0
                   | | | | | |
Cluster Nos.     0 0 3 | | 0 0 4
                 |     |_|_____|
                 |_______|

3. Delete the text file on the floppy disk. Using DEBUG, note what happens to the directory and the FAT entries.

4. With the computer booted from DOS, begin with a freshly formatted floppy disk and establish a directory and file structure as follows. To do this, set the default drive to A: and enter the following commands. Press "Enter" after each of the command lines, and after each line on which you enter text, indicated by: <enter text>.

Command                                                                             Action
COPY CON A:FILE1                       Open a file in root dir
<enter text>
^Z (ctrl-z)                            Close the file
MD SUB1                                Create the subdirectory SUB1
CD SUB1                                Go to SUB1
COPY CON A:FILE2                       Open/close a file in SUB1
<enter text>
^Z
MD SUB2                                Create the subdirectory SUB2
CD SUB2                                Go to SUB2
COPY CON A:FILE3                       Open/close a file in SUB2
<enter text>
^Z
 
You now have a directory structure with a root directory and two levels of subdirectories. Use the DIR command to verify this. Using DEBUG, examine the directory entries for root, SUB1, and SUB2.