2.3 MS-DOS Features

Programs use MS-DOS system functions to allocate memory, load programs, read from and write to files and devices, connect to a network, and so on.

Programs that use MS-DOS system functions have access to the following features of MS-DOS:

File system: The MS-DOS file system consists of the files, directories, and supporting data structures on the disks of the computer. Although MS-DOS controls the file system, programs can create, read from, write to, and delete files and directories. The primary supporting data structure for the file system is the file allocation table (FAT). Programs do not access the FAT directly. Instead, MS-DOS manages all the details of the operations on files, including updating the FAT as files are created and modified.

Character devices: Character devices process data one byte (one character) at a time. Examples of character devices are the computer's keyboard, screen, and serial and parallel ports. Programs can open, read from, and write to character devices by using the same functions as they use for accessing files. Devices have logical names, such as CON and PRN, that programs use to open them. Programs can set operating modes for character devices by using input-and-output-control (IOCTL) functions.

Program execution: Although MS-DOS is a single-tasking operating system—that is, it runs only one program at a time—programs can load and run other programs. While one program runs, the program that started it is temporarily suspended. MS-DOS ensures that adequate memory and other resources are available to each program.

Memory management: When it starts a program, MS-DOS allocates memory for program code and data and copies the program file from the storage medium into memory. Programs can free unneeded memory or allocate additional memory while they run. MS-DOS organizes memory in blocks of one or more paragraphs (a paragraph is 16 bytes).

Networks: A network enables programs running on one computer to use the drives and devices of other computers. Programs can make connections to network drives and devices and then access files and character devices to open, read from, and write to the network drives and devices.

National language support: National language support permits programs to adapt themselves for operation in a variety of national markets. Programs use country information to prepare the characters and formats for date, time, currency, and other information they display; they use code pages to display and print characters that are language-specific or country-specific.

Interrupt handling: Programs can install custom interrupt handlers to carry out special processing while they run. For example, a program can install a CTRL+C handler that replaces the default action when the user presses the CTRL+C key combination.

Task-switcher notifications: Programs can add themselves to the notification chain of the MS-DOS task switcher. Programs that are sensitive to task switches, such as communication programs that must respond immediately to asynchronous input, add themselves to the chain to control when and under what conditions task switching occurs.