Unit 2 Introduction To DOS
Unit 2 Introduction To DOS
DOS (Disk Operating System) is an operating system that allows users to interact
with their computer and manage files, hardware, and applications through text-based
commands. It was widely used in the 1980s and early 1990s before graphical user
interfaces (GUIs) like Windows became more common.
Advantages of DOS:
1. Efficiency: DOS uses minimal system resources, making it ideal for older or
less powerful computers.
2. Direct Control: It gives users more control over system functions and
hardware compared to modern OSes.
3. Simple Structure: The command-line interface is simple and effective for
experienced users who are familiar with the commands.
Disadvantages of DOS:
Although DOS is no longer used as a primary operating system for most users, it still
plays a role in system maintenance and troubleshooting. Many modern operating
systems (including Windows) include a Command Prompt, which is similar to DOS
and allows users to interact with the system using text-based commands.
Summary
DOS is an early operating system that provides a command-line interface for file
management and system control. While it is largely obsolete today, its simple design
and efficiency were crucial in the development of personal computing and the
evolution of modern operating systems.
1. Origins of DOS:
6. Legacy of DOS:
Command Prompt:
o Even after MS-DOS was replaced by Windows, the Command Prompt
remained in Windows operating systems as a way to run command-line
tools and scripts.
Emulators:
o MS-DOS emulators (like DOSBox) were developed for running older
DOS games and applications on modern hardware, helping preserve its
legacy.
Influence on Modern Operating Systems:
o DOS had a significant impact on the development of modern operating
systems, especially in how computers handle file systems, disk
management, and basic command-line operations.
1. Early Development: DOS traces its origins back to the need for an operating
system to run on microcomputers in the late 1970s.
2. Microsoft's MS-DOS: MS-DOS was born in 1981 when IBM needed an
operating system for its PC. Microsoft adapted QDOS to create MS-DOS,
which became the standard OS for IBM-compatible PCs.
3. Growth and Features: Over time, MS-DOS evolved, adding more functionality
like support for hard drives, subdirectories, and networking.
4. Transition to Windows: As Windows became more advanced, it incorporated
MS-DOS into its system but eventually phased it out with the release of
Windows 95.
5. Legacy: MS-DOS’s influence is still seen in modern Windows systems with the
Command Prompt and in software like DOS emulators.
DOS played a crucial role in the early years of personal computing and laid the
groundwork for modern operating systems.
The booting process of DOS refers to the sequence of steps that the computer
follows to start up and load the operating system into memory from a storage device
(like a hard drive or floppy disk). Here’s a detailed overview of the DOS booting
process:
When the computer is powered on, the first thing that happens is the POST. This is a
diagnostic test conducted by the BIOS (Basic Input/Output System) to check the
hardware components such as the CPU, RAM, storage devices, and peripheral
devices to ensure they are functioning correctly.
Once the POST is complete, the BIOS searches for the operating system (OS) stored
on a bootable device, such as a floppy disk, hard drive, or CD-ROM (depending on the
system configuration). The BIOS looks for the Master Boot Record (MBR), which
contains the bootloader—the program that will load the operating system into
memory.
The BIOS typically searches the boot devices in a predefined order (floppy,
hard drive, CD-ROM, etc.), which is configurable in the BIOS settings.
The MBR is located in the first sector of the bootable storage device (usually the first
512 bytes). It contains a small program that is responsible for loading the operating
system into memory.
The MBR contains information about the disk's partition table, helping the
system know where the operating system is located.
The MBR also contains a bootloader which is executed when the system
starts.
Once the BIOS finds the bootable device and reads the MBR, it passes control over to
the bootloader. In the case of MS-DOS, the IO.SYS file is typically the first file loaded.
This file contains the necessary system files for initializing the operating system.
IO.SYS: The IO.SYS file contains the core input/output system of DOS,
handling interactions with the hardware.
Once IO.SYS and MSDOS.SYS are loaded into memory, the next step is to load the
COMMAND.COM file, which is the DOS command interpreter. COMMAND.COM is
the program that allows users to interact with the system using commands.
COMMAND.COM: This file acts as the shell that enables the user to input
commands and interact with the system. It reads and executes commands
typed by the user, such as DIR (list files), COPY (copy files), etc.
Finally, the system is ready for user interaction. The DOS prompt appears on the
screen, indicating that the operating system has fully loaded and is ready to accept
user commands. The prompt typically looks like this:
makefile
Copy code
C:\>
This is the command-line interface where users can type DOS commands to interact
with the system.
This entire booting process makes the DOS operating system functional, allowing
the user to start interacting with the computer through the command-line interface.
The file and directory structure in DOS is hierarchical, meaning that files are
organized into a tree-like structure, with directories (folders) acting as containers for
files and other directories. The DOS file system is designed to allow users to
organize and manage files efficiently. Here’s an overview of how files and directories
are structured in DOS, along with the naming rules:
Root Directory:
o The root directory is the topmost directory in the file system. It is represented
by a backslash (\), and it contains all other directories and files.
o Example: C:\ represents the root directory of the C: drive.
Subdirectories:
o Directories can contain files and other directories (subdirectories). These are
organized in a tree-like structure, where the root is the starting point, and
directories branch out from there.
o Example: C:\Program Files\Microsoft is a directory called Microsoft located
inside another directory called Program Files, which is inside the root
directory C:\.
File Paths:
o A file path is a string that describes the location of a file or directory in the
system.
o Example: C:\Documents\Reports\report.txt is the path to the report.txt file,
located inside the Reports directory, which is inside the Documents directory,
located in the C: drive.
When naming files and directories in DOS, certain rules and limitations apply. These
rules are designed to ensure that the file system can correctly store, retrieve, and
manage files.
1. Maximum Length:
o File names in DOS can have a maximum of 8 characters for the filename,
followed by a 3-character file extension (8.3 naming convention).
o Example: file.txt is a valid file name, with file as the name and txt as the
extension.
2. No Spaces:
o File names cannot contain spaces. Spaces are not allowed in filenames,
though they can be used in directory names (in some later versions of DOS
and Windows).
o Example: myfile.txt is valid, but my file.txt is not.
3. Valid Characters:
o File and directory names can include letters (A-Z, a-z), digits (0-9), and the
following special characters: period (.), hyphen (-), and underscore (_).
o Invalid characters include: <, >, :, ", /, \, |, ?, *.
4. Extension:
o The file extension (after the period) indicates the type of file and its
associated program. For example, .txt indicates a text file, .exe indicates an
executable file, and .jpg indicates a JPEG image file.
o While the extension can be up to 3 characters long, DOS typically uses 3-
character extensions, though later systems like Windows allow longer
extensions.
5. Case Insensitivity:
o DOS file and directory names are not case-sensitive. For example, FILE.TXT is
the same as file.txt in DOS.
1. Length:
o Directory names in DOS can be up to 8 characters long, following the same
8.3 naming convention as files.
o Example: MyDocs is a valid directory name, but My Documents is not (because
of the space).
2. Special Characters:
o Like file names, directory names can only contain letters (A-Z, a-z), digits (0-
9), hyphen (-), underscore (_), and periods (.).
o Spaces are generally not allowed in directory names in DOS, although later
versions of Windows allow spaces.
3. Root and Subdirectories:
o The root directory is represented by a single backslash (\), while
subdirectories are separated by additional backslashes.
o Example: C:\Programs\Games refers to the Games directory, located inside the
Programs directory on the C: drive.
In this example, the game.exe file is stored in the Games subdirectory, which is
inside the Programs directory, which is located in the root directory C:\.
4. Common DOS Commands for File and Directory Management
Understanding the file and directory structure of DOS is crucial for navigating,
managing, and organizing files effectively in a DOS-based system.
DOS (Disk Operating System) relies on several key system files to function properly.
These system files are essential for the operating system to load, configure
hardware, and manage system resources. Below is a list of the key DOS system files,
their functions, and their roles in the operating system.
1. IO.SYS
Purpose: IO.SYS is a crucial system file in DOS that handles input and output
operations, such as disk access and peripheral device control.
Function: This file contains the basic input/output system (BIOS) for
interacting with the hardware. It is loaded first during the booting process.
Role: It initializes hardware components like the keyboard, screen, and disk
drives. It also sets up memory management.
Location: Found in the root directory of the bootable disk (usually C:\).
2. MSDOS.SYS
3. COMMAND.COM
4. CONFIG.SYS
5. AUTOEXEC.BAT
7. HIMEM.SYS
8. EMM386.EXE
9. SMARTDRV.SYS
Purpose: SHARE.EXE is used to provide file and record locking and sharing
capabilities for DOS.
Function: It ensures that files opened by multiple users or processes are
locked properly to prevent data corruption.
Role: This file is important when running networked applications or multi-user
systems.
Location: It is generally loaded from the AUTOEXEC.BAT file.
These system files are essential for the operation of DOS and control how the
system interacts with hardware, loads the OS, manages memory, and processes
commands. They ensure that DOS can function efficiently, allowing users to perform
tasks like file management, running programs, and configuring system settings.
Internal Commands
Internal commands are built into the command interpreter (COMMAND.COM) and are
immediately available to the user.
1. DIR:
2. CLS:
o Syntax: CLS
3. VER:
4. VOL:
5. DATE:
o Syntax: DATE (to set, you will input the new date)
6. TIME:
o Syntax: TIME (to set, you will input the new time)
7. COPY:
8. TYPE:
9. REN:
10. DEL:
o Syntax: CD [directory]
o Syntax: MD [directory_name]
o Syntax: RD [directory_name]
14. PATH:
External Commands
External commands are stored on disk and are loaded into memory when required.
1. CHKDSK:
2. XCOPY:
3. PRINT:
4. DISKCOPY:
5. DISKCOMP:
6. DOSKEY:
7. TREE:
8. MOVE:
9. LABEL:
10. APPEND:
11. FORMAT:
o Prepares a disk for use by erasing all data and creating a new file system.
12. SORT:
13. FDISK:
o Syntax: FDISK
14. BACKUP:
15. EDIT:
16. MODE:
17. ATTRIB:
18. HELP:
19. SYS:
These commands are widely used in DOS and command-line environments, and knowing
how to use them can be quite beneficial for file management and system administration
tasks.