Disk Operating System
The first widely-installed operating system for personal computers
Introduction [1]
MS-DOS (short for Microsoft Disk Operating System) is a command line user interface operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the dominant operating system for the PC compatible platform during the 1980s. It has gradually been replaced on consumer desktop computers by various generations of the Windows operating system.
MS-DOS was originally released in 1981 for IBM computers and had eight major versions released before Microsoft stopped development in 2000. It was the key product in Microsoft's growth from a programming languages company to a diverse software development firm, providing the company with essential revenue and marketing resources. It was last updated in 1994 when MS-DOS 6.22 was released
MS-DOS Versions
The first version of MS-DOS was very primitive, but after a few changes, it provided all the necessary functions an operating system needed. DOS has undergone several changes over the years to provide better functionality. After MS-DOS 5, no major commands were added to the operating system; only compression was enhanced. Table below shows the different versions of MS-DOS and the main improvements.
|
MS-DOS Versions |
|
|
MS-DOS Version |
Comment |
|
MS-DOS 1.0 |
First version, very primitive |
|
MS-DOS 1.1 |
320K floppy drive support |
|
MS-DOS 2.0 |
Hard drive and subdirectory support |
|
MS-DOS 2.11 |
International code support |
|
MS-DOS 3.0 |
1.2 MB floppy support |
|
MS-DOS 3.3 |
3.5-inch floppies, multiple partitions |
|
MS-DOS 4.0 |
504 MB partitions, very buggy |
|
MS-DOS 4.01 |
Patch to 4.0 |
|
MS-DOS 5.0 |
Memory management, improved utilities (Edit, Mem, Dosshell) |
|
MS-DOS 6.0 |
Memmaker added |
|
MS-DOS 6.2 |
Doublespace disk compression, safer utilities |
|
MS-DOS 6.21 |
Disk compression removed |
|
MS-DOS 6.22 |
Drivespace disk compression |
MS-DOS is a single-tasking operating system, which means that it can run only one program at a time. The MS-DOS user interface is a command-line interface, which means that users must type text-based commands and responses when interacting with the operating system.
DOS was a 16-bit command line (non-GUI) operating system, designed to run on 16-bit chips. It is still used from several years on 32-bit chips and 64-bit chips.
Programs in MS-DOS
MS-DOS treats each separate program and piece of data as an individual file. Each file has a name, which is broken down into two parts: a file name and an extension. The file name can be up to eight characters long and the extension can be up to three characters long. The file name and extensions can contain any character except / \ [ ] | < > + = ; , * ? because these characters have a special meaning for the operating system. Also, neither the file name nor the extension can contain spaces. The file name and extension are separated by a period. This naming scheme is referred to as the eight-dot-three (8.3) file name limit. Some acceptable MS-DOS file names are
·Autoexec.bat
· Config.sys
·My.doc
·Word.exe
·Test.txt
·Command.com
The file name is a simple way of identifying programs and data for users,
Originally CPU conducted binary format for communication and computations at the hardware level
MS-DOS Structure
|
File |
Function |
|
lo.sys |
A hidden file located in the root of the active primary partition. Handles talking to the BIOS and the hardware. Controls the basic input/output services MS-DOS provides. |
|
Msdos.sys |
A hidden file located in the root of the active primary partition. Contains the primary MS-DOS code referred to as the Kernel. Looks for the Config.Sys file and, if it is available, loads it into memory. |
|
Command.com |
A visible file located in the root of the active primary partition. Interprets commands typed into the computer and passes the information to Msdos.sys. |
|
Config.sys |
Configures the hardware environment Mouse ,Printer ,Keyboard ,Country codes (time, date, currency),Other devices and system commands |
|
Autoexec.bat |
Programs/commands to be run at system start Batch file (automatically executing set of programs/commands) |
Drives and Directories
Each drive in MS-DOS has a drive letter
o Floppies — A and B
o Hard drives — begin with C
o CD-ROM drive — typically drive letter following last hard drive defined
Directory tree organizes the drives’ file structure
o Directory
o Root directory
o Subdirectory
o Parent directory
o Child directory
MS-DOS uses a hierarchical directory tree to organize floppies and hard drives. These groups are called directories.
MS-DOS boot process [2]
1. The BIOS, having completed its test and setup functions, loads the boot code found in the master boot record and then transfers control of the system to it. At that point, the master boot record code is executed. If the boot device is a floppy disk, the process skips to step 7 below.
2. The next step in the process is the master boot code examining the master partition table. It first must determine if there is an extended DOS partition, then it must determine if there is a bootable partition specified in the partition table.
3. If the master boot code locates an extended partition on the disk, it loads the extended partition table that describes the first logical volume in the extended partition. This extended partition table is examined to see if it points to another extended partition table. If it does, this second table is examined for information about the second logical volume in the extended partition. Logical volumes in the extended partition have their extended partition table chained together one to the next. This process continues until all of the extended partitions have been loaded and recognized by the system.
4. Once the extended partition information (if any) has been loaded, the boot code attempts to start the primary partition that is marked active, referred to as the boot partition. If no boot partitions are marked active, then the boot process will terminate with an error. The error message is often the same as that which occurs if the BIOS could not locate a boot device, generally shown on screen as "No boot device", but also can show up as "NO ROM BASIC - SYSTEM HALTED". If there is a primary partition marked active and there is an installed operating system, the boot code will boot it. The rest of the steps presume this example is of an MS- DOS primary partition.
5. At this stage, the master or volume boot sector is loaded into memory and tested, and the boot code that it contains is given control of the remainder of the boot process.
6. The boot code examines the disk structures to ensure that everything is correct. If not, the boot process will end in an error here.
7. During the next step, the boot code searches the root directory of the device being booted for the operating system files that contain the operating system. For MS-DOS, these are the files "IO.SYS", "MSDOS.SYS" and "COMMAND.COM".
8. If no operating system files are found, the boot program will display an error message similar to "Non-system disk or disk error - Replace and press any key when ready". Keep in mind that this message does not means that the system was never booted. It means that the BIOS examined the floppy disk for example and just rejected it because it couldn't boot an operating system. The volume boot code was indeed loaded and executed, as that is what posts the message when it can't find the operating system files.
9. In the final stages of the boot process, presuming that the operating system files are found, the boot program will load those operating system files into memory and transfer control to them. In MS-DOS, the first is IO.SYS and its code is executed. IO.SYS will then execute MSDOS.SYS. Then the more complete operating system code loads and initializes the rest of the operating system structures beginning with the command interpreter COMMAND.COM and then the execution of the CONFIG.SYS and AUTOEXEC.BAT files. At this point the operating system code itself has control of the computer.
Parts of DOS[3]
DOS consists of an input/output system, a command processor and several utilities. The utilities are individual program files found on your DOS disk. While part of DOS, these files are not needed often enough to make it necessary or practical to keep them in the computer's RAM all the time. FORMAT.COM, the program that formats blank disks, is an example of a DOS utility. Sometimes these utilities are called external commands (as opposed to internal commands which are included as part of the file COMMAND.COM and remain resident in memory at all times; e.g., DIR and COPY).
The command processor is also a file you see on the disk, but once read into the computer's memory, it usually resides there. Some programs provide their own command processor, and there are times when the command processor will be overwritten in memory by a program and have to be reloaded when the program stops executing.
The input/output system consists of two files and a ROM (Read Only Memory) chip. While the two files are on your disks and are loaded into memory when the computer starts, they are normally hidden from your view and not available to you for changing.
This most primitive of the DOS systems has two parts:
BIOS (Basic Input/Output System). These are the fundamental routines that control the keyboard, video display and other peripherals. The BIOS is comprised of a ROM on the computer's main circuit board and the file IBMBIO.COM (or IO.SYS), one of the two hidden files on your disk.
Operating System. This is the main file-handling system for the computer. Actually, two systems exist: one for disk-based files and one for non-disk peripheral devices. They are in hidden file IBMDOS.COM (or MSDOS.SYS). (IBMBIO and IBMDOS are IBM names; MS-DOS uses IO.SYS and MSDOS.SYS.)
The two systems are necessary because non-disk peripherals demand their data as strings of characters, while disks move information in large groups, known as blocks.
MS-DOS Memory Management [4]
This is the module of the Operating System that manages memory in a system by deciding when to allocate and de-allocate memory to a process, how much to allocate and the scheduling of these processes. The following section lists the major concepts that are related to DOS Memory Management.

MS-DOS provides three memory management functions- allocate, deallocate, and resize (modify). For most programs, these three memory allocation calls are not used. When DOS executes a program, it gives all of the available memory, from the start of that program to the end of RAM, to the executing process. Any attempt to allocate memory without first giving unused memory back to the system will produce an "insufficient memory" error.
Sophisticated programs which terminate and remain resident, run other programs, or perform complex memory management tasks, may require the use of these memory management functions.
Allocate Memory
This call is used to allocate a block of memory. On entry into DOS, bx contains the size of the requested block in paragraphs (groups of 16 bytes). On exit, assuming no error, the ax register contains the segment address of the start of the allocated block. If an error occurs, the block is not allocated and the ax register is returned containing the error code. If the allocation request failed due to insufficient memory, the bx register is returned containing the maximum number of paragraphs actually available.
Deallocate Memory
This call is used to deallocate memory allocated via function 48h above. The es register cannot contain an arbitrary memory address. It must contain a value returned by the allocate memory function. You cannot use this call to deallocate a portion of an allocated block. The modify allocation function is used for that operation.
Modify Memory Allocation
This call is used to change the size of an allocated block. On entry,
es
must contain the segment address of the allocated block
returned by the memory allocation function.
Bx
must contain the new size of this block in paragraphs. While
you can almost always reduce the size of a block, you cannot normally
increase the size of a block if other blocks have been allocated after the
block being modified. Keep this in mind when using this function.
MS-DOS Memory map
| High memory | |||
| segment | offset | size | contents |
| 0000h | 0000h | 1024 | interrupt vector table |
| 0400h | 172 | BIOS communication area | |
| 04ACh | 68 | reserved by IBM | |
| 04F0h | 16 | user communication area | |
| 0500h | 256 | DOS communication area | |
| 0600h | varies |
operating system: IBMBIO.COM (DOS interface to the BIOS) IBMDOS.COM (DOS interrupt handlers and interrupt 21h service routines DOS buffers, control areas, and device drivers COMMAND.COM (resident portion), interrupt 22h, 23h, and 24h handlers, routine to reload transient portion of COMMAND.COM memory-resident utilities transient applications transient portion of COMMAND.COM |
|
| 9000h | FFFFh | highest address of user memory | |
| A000h | 0000h | 128K | reserved area of ROM |
| A000h | 0000h | beginning of area used by EGA and PS/2 video systems | |
| B000h | 0000h | 4000 | monochrome video memory |
| 0800h | 16K | color graphics adaptor (CGA) video memory | |
| C000h | 0000h | 192K | ROM expansion and control area |
| 8000h | ROM for hard disk | ||
| D000h | ROM expansion and control area | ||
| E000h | ROM expansion and control area | ||
| F000h | 0000h | 16K | reserved ROM |
| 4000h | 40K | base system ROM, ROM BASIC | |
| E000h | 8K | ROM BIOS | |
| Low memory | |||
MS-DOS Process Management [5]
This relates to the Operating System’s activity of managing the processor in the system, i.e. allocating and de-allocating of the processor to the process. The Operating System decides the same based on the priority of the process depending if there exists any and certain pre-defined algorithms.
Although MS-DOS is a single tasking operating system, this does not mean there can only be one program at a time in memory. However we can still load several programs into memory at one time under DOS. The only catch is, DOS only provides the ability for them to run one at a time in a very specific fashion. Unless the processes are cooperating, their execution profile follows a very strict pattern. That’s why Dos exhibit Serial Multi tasking.
Users often wish to perform more than one activity at a time (load a remote file while editing a program) and uni programming does not allow this. So DOS put in things like memory-resident programs that invoked asynchronously, but still have separation problems. One key problem with DOS is that there is no memory protection - one program may write the memory of another program, causing weird bugs.
Child Processes in DOS
In Dos we have one process and one thread.
When a DOS application is running, it can load and executing some other programs using the DOS EXEC function. Under normal circumstances, when an application (the parent) runs a second program (the child), the child process executes to completion and then returns to the parent. This is very much like a procedure call, except it is a little more difficult to pass parameters between the two.
MS-DOS File Management
This is the module of the Disk Operating System that is responsible for creating and/or deleting files in the file system and managing the input and output of data in the file system.
A File System refers to the arrangement in a secondary storage that is done by the DOS for the purpose of data storage and retrieval. DOS works on FAT File System.
MS-DOS Partitioning
Microsoft MS-DOS assigns drive letters to the first
two physical floppy disk drives and hard disk drives it finds at boot time
in a fixed sequence, including multiple partitions and logical drives on the
hard disks. You cannot change this sequence.
The drive letters assigned to additional drives installed using DRIVER.SYS
and other installable device drivers is dependent upon the order in which
the drivers are loaded in the CONFIG.SYS file. These drive letter
assignments can be influenced by changing the order of the CONFIG.SYS
statements or loading "dummy" drives to "use up" drive letters.
Drive letter assignments can change when you upgrade from one Microsoft
MS-DOS version to another or from an original equipment manufacturer (OEM)
version of MS-DOS to another version that assigns drive letters differently.
(The order in which drive letters are assigned was modified by OEMs in
earlier versions of MS-DOS.) This article describes how MS-DOS assigns drive
letters; it does not explain how particular OEM MS-DOS versions assign drive
letters.
The following occurs at startup:
|
1. |
MS-DOS checks all installed disk devices, assigning the drive letter A to the first physical floppy disk drive that is found. |
|
2. |
If a second physical floppy disk drive is present, it is assigned drive letter B. If it is not present, a logical drive B is created that uses the first physical floppy disk drive. |
|
3. |
Regardless of whether a second floppy disk drive is present, MS-DOS then assigns the drive letter C to the primary MS-DOS partition on the first physical hard disk, and then goes on to check for a second hard disk. |
|
4. |
If a second physical hard disk is found, and a primary partition exists on the second physical drive, the primary MS-DOS partition on the second physical hard drive is assigned the letter D. MS-DOS version 5.0, which supports up to eight physical drives, will continue to search for more physical hard disk drives at this point. For example, if a third physical hard disk is found, and a primary partition exists on the third physical drive, the primary MS-DOS partition on the third physical hard drive is assigned the letter E. |
|
5. |
MS-DOS returns to the first physical hard disk drive and assigns drive letters to any additional logical drives (in extended MS-DOS partitions) on that drive in sequence. |
|
6. |
MS-DOS repeats this process for the second physical hard disk drive, if present. MS-DOS 5.0 will repeat this process for up to eight physical hard drives, if present. After all logical drives (in extended MS-DOS partitions) have been assigned drive letters, MS-DOS 5.0 returns to the first physical drive and assigns drive letters to any other primary MS-DOS partitions that exist, then searches other physical drives for additional primary MS-DOS partitions. This support for multiple primary MS-DOS partitions was added to version 5.0 for backward compatibility with the previous OEM MS-DOS versions that support multiple primary partitions. |
|
7. |
After all logical drives on the hard disk(s) have been assigned drive letters, drive letters are assigned to drives installed using DRIVER.SYS or created using RAMDRIVE.SYS in the order in which the drivers are loaded in the CONFIG.SYS file. Which drive letters are assigned to which devices can be influenced by changing the order of the device drivers or, if necessary, by creating "dummy" drive letters with DRIVER.SYS. |
The MS-DOS utility SUBST, networks and programs such as the CD-ROM Extensions which use the MS-DOS network interface can request a specific drive letter be assigned to a block device.
Example
Consider as an example a system with one floppy disk drive and one hard disk drive, with two MS-DOS partitions (a primary partition and an extended partition containing a single logical drive) on the hard disk. In this configuration, MS-DOS will assign the floppy disk drive as drives A and B, the primary partition on the hard disk drive as drive C, and the logical drive in the extended partition as drive D.
Partitioning Schemes
Listed below are some sample partitioning schemes for two 40-megabyte (MB) hard disk drives and their resulting drive letter assignments:
|
• |
Drive 1: |
|
• |
Drive 1: |
|
• |
Drive 1: |
References
- Operating System Basics/Architecture
Author: Kurt Hudson, Andy Ruth ; Published: July 1999 ;
Copyright: 1999 ; Publisher: 29th Street Press
http://www.windowsitlibrary.com/Content/175/09/2.html - The MS-DOS Boot Process
Copyright ©1995-2001 DEW Associates Corporation. All rights reserved.
http://www.dewassoc.com/support/msdos/dos_boot_process.htm - MS-DOS
http://www.wikipedia.com - MS-DOS partitioning summary
http://support.microsoft.com/kb/51978/EN-US/ - DOS processes and child processes
http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_19/