Thursday, 14 April 2016

Computer software

The various programs by which a computer controls aspects of its operations, such as those
for translating data from one form to another.

Computer software (or simply software) refers to any of the various programs by which a
computer controls aspects of its operations, such as those for translating data from one form to
another, as contrasted with hardware, which is the physical equipment comprising the installation.
The term is roughly synonymous with computer program but is more generic in scope. In most
computers, the moment-to-moment control of the machine resides in a special software program
called an operating system, or supervisor. Other forms of software include assemblers and
compilers for programming languages and applications for business and home use (see computer
program). Software is of great importance; the usefulness of a highly sophisticated array of
hardware can be severely compromised by the lack of adequate software.

The term "software" was first used in this sense by John W. Tukey in 1957. In computer
science and software engineering, computer software is all information processed by computer
systems, programs and data. The concept of reading different sequences of instructions into the
memory of a device to control computations was invented by Charles Babbage as part of his
difference engine. The theory that is the basis for most modern software was first proposed by Alan
Turing in an essay.

Relationship to hardware

Computer software is so called in contrast to computer hardware, which encompasses the
physical interconnections and devices required to store and execute (or run) the software. In
computers, software is loaded into RAM and executed in the central processing unit. At the lowest
level, software consists of a machine language specific to an individual processor. A machine
language consists of groups of binary values (which may be represented by octal or hexadecimal
numerals) signifying processor instructions (object code), which change the state of the computer
from its preceding state. Software is an ordered sequence of instructions for changing the state of
the computer hardware in a particular sequence. It is generally written in high-level programming
languages that are easier and more efficient for humans to use (closer to natural language) than
machine language. High-level languages are compiled or interpreted into machine language object
code. Software may also be written in an assembly language, essentially, a mnemonic
representation of a machine language using a natural language alphabet. Assembly language must
be assembled into object code via an assembler.

Relationship to data

Software has historically been considered an intermediary between electronic hardware and
data, which later the hardware processes according to the sequence of instructions defined by the
software. As computational math becomes increasingly complex, the distinction between software
and data becomes less precise. Data has generally been considered as either the output or input of
executed software. However, data is not the only possible output or input. For example, (system)
configuration information may also be considered input, although not necessarily considered data
(and certainly not applications data). The output of a particular piece of executed software may be
the input for another executed piece of software. Therefore, software may be considered an
interface between hardware, data, and/or (other) software.

CONFIG.SYS

CONFIG.SYS is the primary configuration file for the MS-DOS and OS/2 operating
systems. It is a special file that contains setup or configuration instructions for the computer system.
The commands in this file configure DOS for use with devices and applications in the system. The
commands also set up the memory managers in the system. After processing the CONFIG.SYS file,
DOS proceeds to load and execute the command shell specified in the shell= line of CONFIG.SYS,
or COMMAND.COM if there is no such line. The command shell in turn is responsible for
processing the AUTOEXEC.BAT file.

The system can still boot if these files are missing or corrupted. However, these two files are
essential for the complete bootup process to occur with the DOS operating system. They contain
information that is used to change the operating system for personal use. They also contain the
requirements of different software application packages. A DOS system would require
troubleshooting if either of these files became damaged or corrupted.

CONFIG.SYS is composed mostly of name=value statements which look like variable
assignments. In fact these will either define some tunable parameters often resulting in reservation
of memory, or load files, mostly TSRs and device drivers, into memory.

In DOS, CONFIG.SYS is located in the root directory of the drive from which DOS was
booted. In some versions of DOS it may have an alternate filename, e.g. FDCONFIG.SYS in
FreeDOS, or DCONFIG.SYS in some versions of DR-DOS.

Both CONFIG.SYS and AUTOEXEC.BAT can still be found included in the system files of
the later Microsoft Windows operating systems. Usually these files are empty files, with no content.
OS/2 did not use the autoexec.bat file, instead using startup.cmd.

In the OS/2 subsystem of Windows NT, what appeared as CONFIG.SYS to OS/2 programs
was actually stored in the registry.

Example CONFIG.SYS file for DOS
device = c:\dos\himem.sys
device = c:\dos\emm386.exe umb
dos = high,umb
devicehigh = c:\windows\mouse.sys
devicehigh = c:\dos\setver.exe
devicehigh = c:\dos\smartdrv.exe
country = 044,437,c:\dos\country.sys
shell = c:\dos\command.com c:\dos /e:512 /p

Windows NT

On Windows NT and its derivatives, Windows 2000 and Windows XP, the equivalent file is
called AUTOEXEC.NT and is located in the %SystemRoot%\system32 directory. The file is not
used during the operating system boot process; it is executed when the MS-DOS environment is
started, which occurs when an MS-DOS application is loaded.

The AUTOEXEC.BAT file may often be found on Windows NT, in the root directory of the
boot drive. Windows only considers the "SET" statements which it contains, in order to define
environment variables global to all users. Setting environment variables through this file may be
interesting if for example MS-DOS is also booted from this drive (this requires that the drive be
FAT) or to keep the variables across a reinstall. This is an exotic usage today so this file remains
almost always empty. The TweakUI applet from the PowerToys collection allows to control this
feature (Parse Autoexec.bat at logon).

AUTOEXEC.BAT

File found on the MS-DOS operating system. It is a plain-text batch file that is located in the
root directory of the boot device.

Usage

AUTOEXEC.BAT is only used on MS-DOS or Microsoft Windows versions based on MSDOS,
such as Windows 3.x, Windows 95, Windows 98, and Windows Me. The file is executed
once the operating system has booted and after the CONFIG.SYS file has been processed. On
Windows, this occurs before the graphical environment has been started.

AUTOEXEC.BAT is most often used to set environment variables and run virus scanners,
system enhancements, utilities, and driver handlers that must operate at the lowest level possible.
Applications that run within the Windows environment upon its loading are listed in the Windows
registry.

Lines prefixed with the string "REM" are remarks and are not run as part of
AUTOEXEC.BAT. The "REM" lines are used for comments or to disable drivers (say, for a CDROM).

Floppy disk


A floppy disk is a data storage device that is composed of a ring of thin, flexible (i.e.
"floppy") magnetic storage medium encased in a square or rectangular plastic wallet. Floppy disks
are read and written by a floppy disk drive or FDD, the latter initialism not to be confused with
"fixed disk drive", which is an old IBM term for a hard disk drive.
Floppy disk format Year introduced
Storage capacity
(binary kilobytes if not
stated)
Marketed
capacity¹
8-inch (read-only) 1969 80 ←
8-inch 1972 183.1 1.5 Megabit
8-inch 1973 256 256 KB
8-inch DD 1976 500 0.5 MB
5¼-inch (35 track) 1976 89.6 110 KB
8-inch double sided 1977 1200 1.2 MB
5¼-inch DD 1978 360 360 KB
3½-inch
HP single sided
1982 280 264 KB
3-inch 1982] 360 ←
3½-inch (DD at release) 1984 720 720 KB
5¼-inch QD 1984 1200 1.2 MB
3-inch DD 1984 720 ←
3-inch
Mitsumi Quick Disk
1985 128 to 256 ←
2-inch 1985 720 ←
5¼-inch Perpendicular 1986] 100 MiB ←
3½-inch HD 1987 1440 1.44 MB
3½-inch ED 1991 2880 2.88 MB
3½-inch LS-120 1996 120.375 MiB 120 MB
3½-inch LS-240 1997 240.75 MiB 240 MB
3½-inch HiFD 1998/99 150/200 MiB] 150/200 MB
Acronyms: DD = Double Density; QD = Quad Density; HD = High Density ED = Extended
Density; LS = Laser Servo; HiFD = High capacity Floppy Disk

¹The marketed capacities of floppy disks frequently corresponded only vaguely to their their actual
storage capacities; the 1.44 MB value for the 3½-inch HD floppies is the most widely known
example. See reported storage capacity.

Dates and capacities marked ? are of unclear origin and need source information; other listed
capacities refer to:

• For 8-inch: standard IBM formats as used by the System/370 mainframes and newer
systems

• For 5¼- and 3½-inch: standard PC formats, capacities quoted are the total size of all sectors
on the disk and include space used for the bootsector and filesystem

Other formats may get more or less capacity from the same drives and disks.

File Allocation Table

A partition is divided up into identically sized clusters, small blocks of contiguous space.
Cluster sizes vary depending on the type of FAT file system being used and the size of the partition,
typically cluster sizes lie somewhere between 2 KB and 32 KB. Each file may occupy one or more
of these clusters depending on its size; thus, a file is represented by a chain of these clusters
(referred to as a singly linked list). However these chains are not necessarily stored adjacent to one
another on the disk's surface but are often instead fragmented throughout the Data Region.

The File Allocation Table (FAT) is a list of entries that map to each cluster on the partition.
Each entry records one of five things:

• the address of the next cluster in a chain
• a special end of file (EOF) character that indicates the end of a chain
• a special character to mark a bad cluster
• a special character to mark a reserved cluster
• a zero to note that that cluster is unused

Each version of the FAT file system uses a different size for FAT entries. The size is
indicated by the name, for example the FAT16 file system uses 16 bits for each entry while the
FAT32 file system uses 32 bits. This difference means that the File Allocation Table of a FAT32
system can map a greater number of clusters than FAT16, allowing for larger partition sizes with
FAT32. This also allows for more efficient use of space than FAT16, because on the same hard
drive a FAT32 table can address smaller clusters which means less wasted space.

FAT12 FAT16 FAT32 Description
0x000 0x0000 0x?0000000 Free Cluster
0x001 0x0001 0x?0000001 Reserved Cluster
0x002 -
0xFEF
0x0002 - 0xFFEF
0x?0000002
-
0x?FFFFFEF
Used cluster; value points to next cluster
0xFF0 -
0xFF6
0xFFF0 - 0xFFF6
0x?FFFFFF0
-
Reserved values

0x?FFFFFF6
0xFF7 0xFFF7 0x?FFFFFF7 Bad cluster
0xFF8 -
0xFFF
0xFFF8 - 0xFFFF
0x?FFFFFF8
-
0x?FFFFFFF
Last cluster in file

Note that FAT32 uses only 28 bits of the 32 possible bits. The upper 4 bits are usually zero
but are reserved and should be left untouched. In the table above these are denoted by a question
mark.

The first cluster of the data area is cluster #2. That leaves the first two entries of the FAT
unused. In the first byte of the first entry a copy of the media descriptor is stored. The remaining
bits of this entry are 1. In the second entry the end-of-file marker is stored. The high order two bits
of the second entry are sometimes, in the case of FAT16 and FAT32, used for dirty volume
management: high order bit 1: last shutdown was clean; next highest bit 1: during the previous
mount no disk I/O errors were detected.[6]

Initial FAT16

In 1984 IBM released the PC AT, which featured a 20 MB hard disk. Microsoft introduced
MS-DOS 3.0 in parallel. Cluster addresses were increased to 16-bit, allowing for a greater number
of clusters (up to 65,517) and consequently much greater filesystem sizes. However, the maximum
possible number of sectors and the maximum (partition, rather than disk) size of 32 MB did not
change. Therefore, although technically already "FAT16", this format was not yet what today is
commonly understood under this name. A 20 MB hard disk formatted under MS-DOS 3.0, was not
accessible by the older MS-DOS 2.0. Of course, MS-DOS 3.0 could still access MS-DOS 2.0 style
8 KB cluster partitions.

MS-DOS 3.0 also introduced support for high-density 1.2 MB 5.25" diskettes, which
notably had 15 sectors per track, hence more space for FAT. This probably prompted a dubious
optimization of the cluster size, which went down from 2 sectors to just 1. The net effect was that
high density diskettes were significantly slower than older double density ones.

Extended partition and logical drives

Apart from improving the structure of the FAT filesystem itself, a parallel development
allowing an increase in the maximum possible FAT storage space was the introduction of disk
partitions. PC hard disks can only have up to 4 primary partitions, due to the fixed structure of the
partition table in the master boot record (MBR). However, by design choice DOS would only use
the partition marked as active, which was also the one the MBR would boot. It was not possible to
create multiple primary DOS partitions using DOS tools, and third party tools would warn that such
a scheme would not be compatible with DOS.

To allow the use of more partitions in a compatible way a new partition type was introduced (in
MS-DOS 3.2, January 1986), the extended partition, which was actually just a container for
additional partitions called logical drives. Originally only 1 logical drive was possible, allowing the
use of hard-disks up to 64 MB. In MS-DOS 3.3 (August 1987) this limit was increased to 24 drives;
it probably came from the compulsory letter-based C: - Z: disk naming. The logical drives were
described by on-disk structures which closely resemble MBRs, probably to simplify coding, and
they were chained/nested in a way analogous to Russian matryoshka dolls. Only one extended
partition was allowed.

Prior to the introduction of extended partitions, some hard disk controllers (which at that
time were separate option boards, since the IDE standard did not yet exist) could make large hard
disks appear as two separate disks. Alternatively, special software drivers, like Ontrack's Disk
Manager could be installed for the same purpose.

Final FAT16

Finally in November 1987, in Compaq DOS 3.31, came what is today called the FAT16
format, with the expansion of the 16-bit disk sector index to 32 bits. The result was initially called
the DOS 3.31 Large File System. Although the on-disk changes were apparently minor, the entire
DOS disk code had to be converted to use 32-bit sector numbers, a task complicated by the fact that
it was written in 16-bit assembly language.

In 1988 the improvement became more generally available through MS-DOS 4.0. The limit
on partition size was now dictated by the 8-bit signed count of sectors-per-cluster, which had a
maximum power-of-two value of 64. With the usual hard disk sector size of 512 bytes, this gives 32
KB clusters, hence fixing the "definitive" limit for the FAT16 partition size at 2 gigabytes. On
magneto-optical media, which can have 1 or 2 KB sectors, the limit is proportionally greater.
Much later, Windows NT increased the maximum cluster size to 64 KB by considering the sectorsper-cluster count as unsigned. However, the resulting format was not compatible with any other FAT implementation of the time, and anyway, generated massive internal fragmentation. Windows 98 also supported reading and writing this variant, but its disk utilities didn't work with it.

Long File Names (VFAT, LFNs)

One of the "user experience" goals for the designers of Windows 95 was the ability to use
long file names (LFNs), in addition to classic 8.3 names. LFNs were implemented using a workaround in the way directory entries are laid out (see below). The version of the file system with this extension is usually known as VFAT after the Windows 95 VxD device driver.

Interestingly, the VFAT driver actually appeared before Windows 95, in Windows for
Workgroups 3.11, but was only used for implementing 32-bit File Access, a higher performance
protected mode file access method, bypassing DOS and directly using either the BIOS, or, better,
the Windows-native protected mode disk drivers. It was a backport; Microsoft's ads for WfW 3.11
said 32-bit File Access was based on "the 32-bit file system from our Chicago project".

In Windows NT, support for long file names on FAT started from version 3.5.

FAT32

In order to overcome the volume size limit of FAT16, while still allowing DOS real-mode
code to handle the format without unnecessarily reducing the available conventional memory,
Microsoft decided to implement a newer generation of FAT, known as FAT32, with cluster counts
held in a 32-bit field, of which 28 bits are currently used.

In theory, this should support a total of approximately 268,435,438 (< 228) clusters, allowing
for drive sizes in the range of 2 terabytes. However, due to limitations in Microsoft's scandisk
utility, the FAT is not allowed to grow beyond 4,177,920 (< 222) clusters, placing the volume limit
at 124.55 gigabytes, unless "scandisk" is not needed.

FAT32 was introduced with Windows 95 OSR2, although reformatting was needed to use it,
and DriveSpace 3 (the version that came with Windows 95 OSR2 and Windows 98) never
supported it. Windows 98 introduced a utility to convert existing hard disks from FAT16 to FAT32
without loss of data. In the NT line, support for FAT32 arrived in Windows 2000.

Windows 2000 and Windows XP can read and write to FAT32 filesystems of any size, but
the format program on these platforms can only create FAT32 filesystems up to 32 GB. Thompson
and Thompson (2003) write[4] that "Bizarrely, Microsoft states that this behavior is by design."
Microsoft's knowledge base article 184006[3] indeed confirms the limitation and the by design
statement, but gives no rationale or explanation. Peter Norton's opinion[5] is that "Microsoft has
intentionally crippled the FAT32 file system."

The maximum possible size for a file on a FAT32 volume is 4 GiB minus 1 B (232-1 bytes).
For most users, this has become the most nagging limit of FAT32 as of 2005, since video capture
and editing applications can easily exceed this limit, as can the system swap file.

Third party support

The alternative IBM PC operating systems — such as Linux, FreeBSD, and BeOS — have
all supported FAT, and most added support for VFAT and FAT32 shortly after the corresponding
Windows versions were released. Early Linux distributions also supported a format known as
UMSDOS, which was FAT with Unix file attributes (such as long file name and access
permissions) stored in a separate file called --linux-.---. UMSDOS fell into disuse after VFAT was
released and is not enabled by default in Linux kernels from version 2.5.7 onwards [5]. The Mac OS
X operating system also supports the FAT filesystems on volumes other than the boot disk.

FAT and Alternate Data Streams

The FAT filesystem itself is not designed for supporting ADS, but some operating systems
that heavily depend on them have devised various methods for handling them in FAT drives. Such
methods either store the additional information in extra files and directories (Mac OS), or give new
semantics to previously unused fields of the FAT on-disk data structures (OS/2 and Windows NT).
The second design, while presumably more efficient, prevents any copying or backing-up of those
volumes using non-aware tools; manipulating such volumes using non-aware disk utilities (e.g.
defragmenters or CHKDSK) will probably lose the information.

Mac OS using PC Exchange stores its various dates, file attributes and long filenames in a
hidden file called FINDER.DAT, and Resource Forks (a common Mac OS ADS) in a subdirectory
called RESOURCE.FRK, in every directory where they are used. From PC Exchange 2.1 onwards,
they store the Mac OS long filenames as standard FAT long filenames and convert FAT filenames
longer than 31 characters to unique 31-character filenames, which can then be made visible to
Macintosh applications.

Mac OS X stores metadata (Resource Forks, file attributes, other ADS) in a hidden file with
a name constructed from the owner filename prefixed with "._", and Finder stores some folder and
file metadata in a hidden file called ".DS_Store".

OS/2 heavily depends on extended attributes (EAs) and stores them in a hidden file called
"EA DATA. SF" in the root directory of the FAT12 or FAT16 volume. This file is indexed by 2
previously reserved bytes in the file's (or directory's) directory entry. In the FAT32 format, these
bytes hold the upper 16 bits of the starting cluster number of the file or directory, hence making it
difficult to store EAs on FAT32. Extended attributes are accessible via the Workplace Shell
desktop, through REXX scripts, and many system GUI and command-line utilities (such as 4OS2).
Windows NT supports the handling of extended attributes in HPFS, NTFS, and FAT. It stores EAs
on FAT using exactly the same scheme as OS/2, but does not support any other kind of ADS as
held on NTFS volumes. Trying to copy a file with any ADS other than EAs from an NTFS volume
to a FAT volume gives a warning message with the names of the ADSs that will be lost.

Windows 2000 onward acts exactly as Windows NT, except that it ignores EAs when
copying to FAT32 without any warning (but shows the warning for other ADSs, like "Macintosh
Finder Info" and "Macintosh Resource Fork").

Future

Microsoft has recently secured patents for VFAT and FAT32 (but not the original FAT),
which is causing concern that the company might later seek royalties from Linux distros and from
media vendors that pre-format their products (see FAT Licensing below). Despite two earlier
rulings against them, Microsoft prevailed and was awarded the patents.

Since Microsoft has announced the discontinuation of its MS-DOS-based consumer
operating systems with Windows Me, it remains unlikely that any new versions of FAT will appear.
For most purposes, the NTFS file system that was developed for the Windows NT line is superior to
FAT from the points of view of efficiency, performance and reliability; its main drawbacks are the
size overhead for small volumes and the very limited support by anything other than the NT-based
versions of Windows, since the exact specification is a trade secret of Microsoft, which in turn
makes it difficult to use a DOS floppy for recovery purposes. Microsoft provided a recovery
console to work around this issue, but for security reasons it severely limited what could be done
through the Recovery Console by default.

FAT is still the normal filesystem for removable media (with the exception of CDs and
DVDs), with FAT12 used on floppies, and FAT16 on most other removable media (such as flash
memory cards for digital cameras and USB flash drives). Most removable media is not yet large
enough to benefit from FAT32, although some larger flash drives do make use of it. FAT is used on
these drives for reasons of compatibility and size overhead, as well as the fact that file permissions
on removable media are likely to be more trouble than they are worth.

The FAT32 formatting support in Windows 2000 and XP is limited to drives of 32
gigabytes, which effectively forces users of modern hard drives either to use NTFS or to format the
drive using third party tools such as a port of mkdosfs or fat32format.

Main disk structures

Master
Boot
Record
File
Allocation
Table #1
File
Allocation
Table #2
Root
Directory
All Other Data ... The Rest of the Disk

A FAT file system is composed of four different sections.

1. The Reserved sectors, located at the very beginning. The first reserved sector is the Boot
Sector (aka Partition Boot Record). It includes an area called the BIOS Parameter Block (with some
basic file system information, in particular its type, and pointers to the location of the other
sections) and usually contains the operating system's boot loader code. The total count of reserved
sectors is indicated by a field inside the Boot Sector. Important information from the Boot Sector is
accessible through an operating system structure called the Drive Parameter Block in DOS and
OS/2.

2. The FAT Region. This contains two copies of the File Allocation Table for the sake of
redundancy, although the extra copy is rarely used, even by disk repair utilities. These are maps of
the partition, indicating how the clusters are allocated.

3. The Root Directory Region. This is a Directory Table that stores information about the
files and directories in the root directory. With FAT32 it can be stored anywhere in the partition,
however with earlier versions it is always located immediately after the FAT Region.

4. The Data Region. This is where the actual file and directory data is stored and takes up
most of the partition. The size of files and subdirectories can be increased arbitrarily (as long as
there are free clusters) by simply adding more links to the file's chain in the FAT. Note however,
that each cluster can be taken only by one file, and so if a 1 KB file resides in a 32 KB cluster, 31
KB are wasted.

Boot Sector
The Boot Sector is of the following format:
Byte
Offset
Length
(bytes)
Description
0x00 3 Jump instruction (to skip over header on boot)
0x03 8
OEM Name (padded with spaces). MS-DOS checks this field to determine
which other parts of the boot record can be relied on [6] [7]. Common values
are IBM 3.3 (with two spaces between the "IBM" and the "3.3") and MSDOS5.0.
0x0b 2 Bytes per sector. The BIOS Parameter Block starts here.
0x0d 1 Sectors per cluster
0x0e 2 Reserved sector count (including boot sector)
0x10 1 Number of file allocation tables
0x11 2 Maximum number of root directory entries
0x13 2 Total sectors (if zero, use 4 byte value at offset 0x20)
0x15 1
Media descriptor
0xF8 Single sided, 80 tracks per side, 9 sectors per track
0xF9 Double sided, 80 tracks per side, 9 sectors per track
0xFA Single sided, 80 tracks per side, 8 sectors per track
0xFB Double sided, 80 tracks per side, 8 sectors per track
0xFC Single sided, 40 tracks per side, 9 sectors per track
0xFD Double sided, 40 tracks per side, 9 sectors per track
0xFE Single sided, 40 tracks per side, 8 sectors per track
0xFF Double sided, 40 tracks per side, 8 sectors per track
Same value of media descriptor should be repeated as first byte of each copy of
FAT. Certain operating systems (MSX-DOS version 1.0) ignore boot sector
parameters altogether and use media descriptor value from the first byte of FAT
to determine filesystem parameters.
0x16 2 Sectors per file allocation table (FAT16)
0x18 2 Sectors per track
0x1a 2 Number of heads
0x1c 4 Hidden sectors
0x20 4 Total sectors (if greater than 65535; see offset 0x13)
0x24 4
Sectors per file allocation table (FAT32). The Extended BIOS Parameter Block
starts here.
0x24 1 Physical drive number (FAT16)
0x25 1 Current head (FAT16)
0x26 1 Signature (FAT16)
0x27 4 ID (FAT16)
0x2b 11 Volume Label
0x36 8 FAT file system type (e.g. FAT, FAT12, FAT16, FAT32)
0x3e 448 Operating system boot code
0x1FE 2 End of sector marker (0x55 0xAA)

The boot sector is portrayed here as found on e.g. an OS/2 1.3 boot diskette. Earlier versions used a
shorter BIOS Parameter Block and their boot code would start earlier (for example at offset 0x2b in
OS/2 1.1).

Exceptions

The implementation of FAT used in MS-DOS for the Apricot PC had a different boot sector
layout, to accommodate that computer's non-IBM compatible BIOS. The jump instruction and
OEM name were omitted, and the MS-DOS filesystem parameters (offsets 0x0B - 0x17 in the
standard sector) were located at offset 0x50. Later versions of Apricot MS-DOS gained the ability
to read and write disks with the standard boot sector in addition to those with the Apricot one.

DOS Plus on the BBC Master 512 did not use conventional boot sectors at all. Data disks
omitted the boot sector and began with a single copy of the FAT (the first byte of the FAT was used
to determine disk capacity) while boot disks began with a miniature ADFS filesystem containing
the boot loader, followed by a single FAT. It could also access standard PC disks formatted to 180
KB or 360 KB, again using the first byte of the FAT to determine capacity.

FAT12

This initial version of FAT is now referred to as FAT12. As a filesystem for floppy disks, it
had a number of limitations: no support for hierarchical directories, cluster addresses were "only"
12-bits long (which made the code manipulating the FAT a bit tricky) and the disk size was stored
as a 16-bit count of sectors, which limited the size to 32MB.

An entry-level diskette at the time would be 5.25", single-sided, 40 tracks, with 8 sectors per
track, resulting in a capacity of slightly less than 160KB. The above limits exceeded this capacity
by one or more orders of magnitude and at the same time allowed all the control structures to fit
inside the first track, thus avoiding head movement during read and write operations. The limits
were successively lifted in the following years.

Since the sole root directory had to fit inside the first track as well, the maximum possible
number of files was limited to a few dozens.

Directories

In order to properly support the newer IBM PC XT computer, which featured a 10 MB hard
disk, MS-DOS 2.0 was released around the same time, at the beginning of 1983, and introduced
hierarchical directories. Apart from allowing for better organisation of files, directories allowed it to
store many more files on the hard disk, as the maximum number of files was no longer constrained
by the (still fixed) root directory size. This number could now be equal to the number of clusters (or
even greater, given that zero-sized files do not use any clusters on FAT).

The format of the FAT itself did not change. The 10 MB hard disk on the PC XT had 4 KB
clusters. If a 20 MB hard disk was later installed, and formatted with MS-DOS 2.0, the resultant
cluster size would be 8 KB, the boundary at 15.9 MB.

Popular Posts