MS-DOS was developed to run on single-user desktop computers and exemplified early operating systems with sequential job management from a single user. It had advantages of simple operation and commands but lacked flexibility and was limited to the Intel processor family. The document outlines MS-DOS's history, design goals, and how it managed memory, processes, devices, files, and the user interface.
2. MS-DOS
o History
o Design Goals
o Memory Management
o Processor Management
o Device Management
o File Management
o User Interface
o Additional Commands
3. MS-DOS, PC-DOS or DOS:
Microsoft Disk Operating System
o Developed to run single-user, stand-alone desktop
computers.
Exemplifies early Operating Systems because it manages jobs
sequentially from single user.
o Advantages: Simple operation & straight-forward user
commands.
o Disadvantages:
1. Lack of flexibility & limited ability to meet needs of programmers
& experienced users.
2. Written for a single family of microprocessors (Intel family of
chips: 8086, 8088, 80186, and 80286).
6. Design Goals
o Accommodate single novice user in single-
process environment.
o Standard I/O support includes keyboard,
monitor, printer, & secondary storage unit.
o User commands are based on English
words/phrases indicative of action to be
performed.
o Commands are interpreted by command
processor.
o Layering approach “protects” user from
hardware.
8. First 2 DOS Layers : BIOS &
Kernel
• BIOS (Basic Input/Output System) -- interfaces directly with various I/
O devices.
Device drivers (control flow of data to/from each device).
Receives status info about success/failure of each I/O operation & passes
it on to the processor.
• DOS kernel -- routines needed to interface with the disk drives.
Read into memory at initialization time from MSDOS.SYS file on boot
disk.
Accessed by application programs.
Provides a collection of hardware-independent services, such as memory
management, & file & record management (system functions).
9. Third DOS Layer : Command
Processor
3. Command processor (shell) -- sends prompts to user,
accepts commands, executes commands, & issues
appropriate responses.
Resides in a file called COMMAND.COM, which consists of 2 parts stored
in 2 different sections of main memory.
Not interpretive.
MS-DOS Version 4.0 -- menu-driven DOS shell.
OS/2 -- designed to replace MS-DOS.
o MS-DOS ran enormous collection of software packages
making it difficult to discontinue.
10. DOS Memory Management
o Memory Manager
– Relatively simple job because it’s managing single
job for single user.
– Uses a first-fit memory allocation scheme since it
is most efficient strategy in a single-user
environment.
12. DOS Main Memory
Allocation
o First versions had simple contiguous memory allocation scheme that
gave all of the available memory to resident application program.
Applications couldn’t dynamically allocate memory blocks.
MS-DOS Version 2.0 supported dynamic allocation, modification, & release of main
memory blocks by applications.
o Amount of memory each application owns depends on type of file from
which program is loaded & size of TPA.
Programs.COM -- given all of TPA, whether or not they need it.
Programs.EXE -- given amount of memory they need.
13. Memory Block Allocation
o Allocates memory by using first-fit algorithm & linked list of
memory blocks.
o With Version 3.3, MS-DOS started using best-fit or last-fit
strategy.
o Size of a block can vary from 16 bytes (paragraph) to maximum
available memory.
14. Free/Busy Block List
o Whenever request for memory comes in, DOS looks through free/busy
block list to find free block that fits.
If list becomes disconnected, system stops & must be rebooted.
o Well-designed application program releases memory block it no longer
needed.
15. Process Management
o MS-DOS doesn’t support multitasking.
Programs can’t break out of middle of DOS internal
routine & restart routine from somewhere else.
There's no interleaving & no need for sophisticated
algorithms or policies to determine which job will run next
or for how long.
16. Interrupt Handlers
o Interrupt Handlers - are Responsible for Synchronizing Processes
o PC has 256 interrupts & interrupt handlers, & they are accessed via
interrupt vector table.
o Three types of interrupts:
• Internal hardware interrupts -- generated by certain events occurring
during program’s execution (e.g., division by zero).
• External hardware interrupts -- caused by peripheral device controllers
or by coprocessors & assigned by manufacturers.
• Software interrupts -- generated by system & application programs to
access DOS & BIOS functions, which, in turn, access system resources.
17. Interrupt Handlers (cont)
• Software interrupts (continued)
– Some activate specialized application programs
• Take control of computer
• Example: Borland’s SideKick (type of TSR)
– Terminate and Stay Resident (TSR) interrupt handler
• Terminates process without releasing memory
• Used by subroutine libraries
• Sets up memory tables
• Execution preparation via DOS interrupt connection
• Determines memory required
• Sends return code back to parent
18. Interrupt Handlers (cont)
• Interrupt synchronization
– CPU senses interrupt
• Puts on stack: contents of PSW (program status word),
code segment register, and instruction pointer register
• Disables interrupt system
• Uses eight-bit number to obtain interrupt handler
address
• Interrupt handler reenables interrupt system: allows
higher-priority interrupts to occur
• Saves registers and processes interrupt
19. Device Management
o 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.
o 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.
20. Managing Files
o Earliest versions of MS-DOS kept every file in a single directory.
o Version 2.0 implemented hierarchical directory structure.
o When disk is formatted, its tracks are divided into sectors of 512 bytes.
o 2-8 sectors are grouped into clusters & that's how File Manager allocates
space to files.
21. FORMAT Creates Three
Special Areas on Disk
• Boot record -- first sector of every logical disk & contains disk boot
program & table of disk's characteristics.
• Root directory -- Lists system’s primary subdirectories & files (name,
extension, size, date & time of modification, starting cluster #, file
attribute codes).
• FAT (File Allocation Table) -- contains status info about disk’s sectors:
which are allocated, which are free, and which can’t be allocated
because of errors.
22. Managing Files in DOS
o Supports noncontiguous file storage & dynamically allocates
disk space to a file, provided there’s enough disk room.
o Compaction (MS-DOS Version 6.0) available via utility used to
defragment disk (DEFRAG.EXE).
o CHKDSK command used to determine need for compaction.
o Restricting user access to computer system & resources isn’t
built into MS-DOS.
23. User Interface
o Command-driven operating system.
o When user presses Enter key, shell (COMMAND.COM)
interprets command & calls on next lower level routine to
satisfy request.
o User commands include some or all of these elements in this
order:
command source-file destination-file switches
25. Batch Files & Redirection
o By creating customized batch files, users can quickly execute
combinations of DOS commands to configure their system,
perform routine tasks, or make it easier for non-technical
users to run software.
o MS-DOS can redirect output from one standard input or
output device to another.
command > destination
E.g., dir > PRN
26. Filter Commands
(SORT, MORE)
o Filter commands accept input from default device, manipulate data in
some fashion, & send results to default output device.
o SORT accepts input from keyboard, sorts that data, & displays it on
screen.
Sort the file by column.
o MORE causes output to be displayed on screen in groups of 24 lines,
one screen at a time, & waits until user presses Enter key before
displaying next 24 lines.
27. Pipe
• Cause standard output from one command to be used as standard
input to another command.
– Symbol is a vertical bar, |.
– Alphabetically sort directory & display sorted list on screen:
DIR | SORT
• Combine pipes and other filters.
TYPE INVENTRY.DAT | MORE
MORE < INVENTRY.DAT
DIR | SORT | MORE
DIR | SORT > SORTFILE
MORE < SORTFILE
28. Summary
• MS-DOS
– Written to serve 1980s personal computer users
• Limitation
– Limited flexibility
– Operating system unusable as hardware evolved
• First standard operating system
– Adopted by personal computing machine
manufacturers
– Supported by legions of software design groups
29. Summary (continued)
• Advantages
– Fundamental operation
– Straightforward user commands
• Weakness
– Design
• Single-user/single-task systems
– No multitasking, networking, sophisticated
applications support