2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

Preview:

Citation preview

2/17 How Disk Storage Works

• Roll call.

• Video: disk storage.

• Step-by-step lecture.

1. Formatting a disk: Why bother?

• Formatting provides a “street map” for the data to be laid out on.

• Where’s that data?

Image courtesy of Mapquest.com

1A. Formatting a disk

• A grid of wedges and tracks, made with magnetic “signposts”is laid out across the disk.

1B. Formatting a disk: wedges

• Wedges are wedge-shaped areas on a disk.

• Divided radially.

1C. Formatting a disk: tracks

• Tracks are ring-shaped sections of the disk.

1D. Formatting a disk

• The read/write heads check these signposts as it reads the disk to know where it is.

2. Sectors

• The junction of a wedge and a track is called a sector.

• Sectors can be thought of as city blocks: the 3600 block of Lindell Boulevard -- 1 sector, 1 block.

2A. Sectors make up clusters

• A cluster is two or more sectors.

• A cluster is the smallest unit of storage for the disk.

2B. How many sectors to a cluster?

• EX: a file needs 8K of space. Each sector is 12K big.

• How much disk space will the file take up?ANS: 24K (2 sectors is the minimum space)

2C. Operating systems differ

• Different operating systems divide up the disk in different portions.

• Some are more efficient than others.

3. The FAT and the VFAT

• A directory file -- File Allocation Table is created in sector 0 of the disk.

• DOS: FAT

• Win95: VFAT -- Virtual File Allocation Table

3A. Differences: FAT and VFATname length bits

read

FAT <=11 char. 16 bits

VFAT <=255 32

VFAT is faster at

accessing data than

FAT.

4. Writing a file to a disk

• The program is holding the file in the RAM.

• When you click “Save”, it asks the CPU to move the file from RAM to a disk.

RAM

HARD DRIVE

5. First, list it in the VFAT

• The operating system changes the VFAT to list where the file will be stored in the folders in the directory.

6. Second, find a spot for the file

• The VFAT also tells the operating system where an available cluster is on the disk.

• The cluster address lists the track and sectors that make up the cluster.

7. The VFAT to the OS to the BIOS

• The VFAT tells the OS what the address is of the cluster.

• The OS hands off the info to the BIOS.

8. The BIOS sends the file

• The BIOS grabs the file out of the RAM. It tells the disk controller to save the file, starting at the beginning point of the cluster.”

9. Oops! The file’s too big

• If the file is bigger than the cluster, the VFAT tells the OS where another available cluster is.

• The BIOS continues sending the file, but now directed to the next cluster.

9A. Oops! The file’s too big

• The VFAT keeps track of the chain of clusters that the file uses.

10. File’s done!

• An end of file marker tells the BIOS and VFAT that the transfer is complete.

11. Update the VFAT

• The file’s record in the VFAT is updated with the various clusters that make up the file.

On 2/19:

• Reading a file from a disk

• How a hard drive works

• 2nd individual assignment discussion

Recommended