Professional Documents
Culture Documents
MS-DOS
• History
• Design Goals
• Memory Management
• Processor Management
• Device Management
• File Management
• User Interface
• Additional Commands
Chapter 12 - MS DOS 2
MS-DOS, PC-DOS or DOS
Chapter 12 - MS DOS 3
History of DOS
Hardware
Chapter 12 - MS DOS 5
First 2 DOS Layers : BIOS &
Kernel
Chapter 12 - MS DOS 6
Third DOS Layer : Command
Processor
Chapter 12 - MS DOS 7
DOS Memory Management
Chapter 12 - MS DOS 8
Reserved for BIOS 1M
RAM Layout for
Unused 640K 1MB of Memory
Transient part of
Command.COM
Transient program
Area (user memory)
TSR programs
Resident part of
Command.COM
Installable Drivers
Buffer Cache
MS-DOS Kernel
BIOS Interface
Chapter 12 - MS DOS 9
DOS Main Memory Allocation
Chapter 12 - MS DOS 10
Memory Block Allocation
Chapter 12 - MS DOS 11
First 5 Bytes of Memory Block Define
Block’s Structural Characteristics
Byte Contents
byte 0 ASCII 90h if it’s the last block, or ASCII 77h if it’s not.
bytes 1–2 Includes the number zero to indicate a busy block and the
pointer to the Program Segment Prefix (PSP) that is created by
the EXEC function when the program is loaded.
bytes 3–4 Gives the number of paragraphs contained in the block.
Chapter 12 - MS DOS 12
Free/Busy Block List
Chapter 12 - MS DOS 13
Process Management
Chapter 12 - MS DOS 14
Interrupt Handlers Are Responsible
for Synchronizing Processes
• PC has 256 interrupts & interrupt handlers, & they are accessed via
interrupt vector table.
• Three types of interrupts:
1. Internal hardware interrupts -- generated by certain events occurring
during program’s execution (e.g., division by zero).
2. External hardware interrupts -- caused by peripheral device
controllers or by coprocessors & assigned by manufacturers.
3. Software interrupts -- generated by system & application programs to
access DOS & BIOS functions, which, in turn, access system
resources.
Chapter 12 - MS DOS 15
Device Management
• Ability to reorder requests to optimize seek & search time is not a feature of
DOS because it’s designed for a single-user environment.
– All requests are handled on a first-come first-served basis.
– Since version 3.0, BIOS can support spooling so users can schedule several files
to be printed one after the other.
• MS-DOS written for simple systems using keyboard, monitor, printer, mouse,
1-2 serial ports, & maybe second printer.
– Devices do not require special management from OS.
– Device drivers are the only items needed by Device Manager to make system
work.
– A device driver is a software module that controls an I/O device and handles its
interrupts.
Chapter 12 - MS DOS 16
Managing Files
Chapter 12 - MS DOS 17
FORMAT Creates Three
Special Areas on Disk
1. Boot record -- first sector of every logical disk & contains disk boot
program & table of disk's characteristics.
Chapter 12 - MS DOS 18
Managing Files in DOS
Chapter 12 - MS DOS 19
User Interface
Chapter 12 - MS DOS 20
Command Stands for Action to be performed
DIR Directory List what’s in this directory.
CD or CHDIR Change Directory Change working directory.
COPY Copy Copy a file. Append one to another.
DEL or ERASE Delete Delete the following file or files.
RENAME Rename Rename a file.
TYPE Type Display text file on screen.
PRINT Print Print one or more files on printer.
DATE Date Display and/or change system date.
TIME Time Display and/or change system time.
MD or MKDIR Make Directory Create a new directory or subdirectory.
FIND Find Find a string. Search files for a string.
FORMAT Format Disk Logically prepare disk for file storage.
CHKDSK Check Disk Check disk for disk/file/directory
status.
PROMPT System Prompt Change system prompt symbol.
DEFRAG Defragment Disk Compact fragmented files.
(filename) Run, execute, file.
Chapter 12 - MS DOS 21
Batch Files & Redirection
Chapter 12 - MS DOS 22
Filter Commands (SORT, MORE)
• SORT accepts input from keyboard, sorts that data, & displays it on
screen.
– Sort the file by column.
Chapter 12 - MS DOS 23
Pipe
Chapter 12 - MS DOS 24