Understanding File Systems and Viruses
File Allocation Table (FAT)
The first file system used by Microsoft operating systems was FAT. It uses a file allocation table, which is an index listing the disk’s contents and recording file locations. Since a file’s data blocks aren’t always stored contiguously (fragmentation), the allocation table maintains the file system structure by linking these blocks.
FAT16, a 16-bit system, allows file names up to eight characters with a three-character extension. Windows 95, originally using FAT16, introduced VFAT (Virtual FAT), a 32-bit system supporting file names up to 255 characters. VFAT ensured backward compatibility with 16-bit DOS environments.
FAT16’s 16-bit cluster addressing limits the number of clusters to 216 (65,536). A cluster’s fixed size (e.g., 4, 8, 16, 32 sectors of 512 bytes) determines the maximum partition size. With 32KB clusters, the maximum FAT16 partition size is 2GB. Files occupy whole clusters, leading to wasted space, especially with larger clusters.
File Allocation Table Structure
The File Allocation Table lists values describing cluster allocation within a partition. Each cell represents a cluster and contains a number indicating its status. A non-zero value indicates usage and points to the next cluster in the file, forming a chain. FAT entries are 16 or 32 bits (FAT16 or FAT32). The first two entries hold table information, while subsequent entries refer to clusters. Special values indicate unused clusters (0000), bad clusters (FFF7), and end-of-file markers (FFF8-FFFF). Each partition has two FAT copies for redundancy.
FAT32 File System
VFAT’s limitations led to FAT32 in Windows 95 OSR2. FAT32 uses 32-bit values (28 bits, with 4 reserved) for FAT entries, increasing the cluster limit to 228-1 (268,435,455). This allows for partitions up to 8 terabytes (theoretically, though Microsoft limited it to 32GB on Windows 9x). FAT32’s smaller clusters reduce wasted space compared to FAT16. However, it’s incompatible with older Windows versions.
FAT16 vs. FAT32
Partition size depends on cluster size and the file system. Microsoft DOS (MS-DOS), a disk operating system from Microsoft, was widely distributed for IBM PCs.
MS-DOS Versions
- PC DOS 1.0 (1981): Supported 16KB RAM, 160KB floppy disks, .COM and .EXE files, and COMMAND.COM.
- PC DOS 1.1: Bug fixes and double-density floppy support.
- MS-DOS 2.0 (1983): Supported IBM XT, new commands, and hard drives (around 5MB).
- PC DOS 2.1: Supported IBM PCjr.
- MS-DOS 2.11: Added language support.
- MS-DOS 2.25: Improved Japanese and Korean character set support.
Internal Commands
CD
orchdir
: Change directory.COPY
: Copy files.
Computer Viruses
A computer virus is malware that alters computer function without user consent. It often replaces executable files with malicious code, potentially destroying data or causing annoyance.
Virus Characteristics
Viruses consume resources, leading to productivity loss, system disruptions, and data damage. They replicate and spread, especially through networks lacking security. Each virus presents unique risks.
Propagation Methods
Viruses spread through user interaction (running infected files) or network replication (worms).
Common user interaction vectors:
- Automatically running programs (e.g., email attachments).
- Social engineering.
- Infected media.
- Pirated software.
Protection Methods
Active Protection
- Antivirus: Detects, removes, and sometimes contains malware. Monitors system activity and notifies users of threats.
- File Filters: Block malicious files on networks (e.g., firewalls).
Passive Protection
- Avoid potentially infected removable media.
- Don’t install pirated software.
- Be cautious with downloaded software.
- Don’t open emails from unknown senders.
Virus Types
- Trojan: Steals information, disrupts hardware, or allows external control.
- Worm: Self-replicates.
- Logic/Time Bomb: Activates under specific conditions.
- Hoax: False messages prompting user action.
Virus Effects
- Attaches to programs.
- Displays messages or images.
- Slows or crashes the computer.
- Destroys data.
- Reduces disk space.