Frequently Asked Questions

Q: How does Disk Defragmenter work in Windows98?

A:

Windows 98 boasts a significant change to the Disk Defragmenter (Defrag). In this revision, Defrag relocates the executable and supporting files of Windows programs to a single contiguous area of the hard disk. This placing of a program and all of its supporting files into contiguous disk space can significantly increase the speed at which the application loads and executes.

Defrag is also different in that it can literally fragment program files to improve start times.

Essentially there are three steps to disk optimization:

  • Generating a disk trace during the launch of an application
  • Generating a cluster from/to list for disk rearrangement to minimize seeks
  • Using the Disk Defragmenter to reorder the clusters on the disk
There is a small program - Taskmon.exe - that is constantly running and watches the Create_Process routine. When Create_Process is called, it checks registry settings for that process to determine whether or not it needs to log. If not, it does nothing. Otherwise, it loads Fiolog.vxd, which performs the disk trace.

Fiolog stops logging after 2.5 seconds of no loader activity for that process, and Fiolog.vxd is unloaded automatically after 10 minutes if it is not executing. This log is written to disk through file system lazy writing, to minimize the impact of computer performance while the log is recorded. This generally happens shortly after the application has finished launching.

When Defrag is run, the from/to list is calculated based on the available Applog files and the list is fed to the Defrag engine. The Defrag engine then orders the cluster.

Relevant components

  • Clusalgo.dll - DLL used to generate the from/to list determining cluster ordering
  • CvtAplog.exe - 32-bit program that communicates with Clusalgo.dll
  • Defrag.exe - 16-bit Disk Defragmenter program that performs cluster movements
  • Fiolog.vxd - Driver that is used for getting the disk trace while an application launches
  • Taskmon.exe - Utility that monitors when apps are launched to determine when to start a disk trace
  • Tmapi.dll - DLL that produces Applog.dtc from *lc? files, which Cvtaplog uses to reorder disk