ics-023 chapter 12
TRANSCRIPT
-
8/7/2019 ICS-023 Chapter 12
1/24
Chapter 12Chapter 12
MSMS--DOSDOS
ICSICS--023 PC Operating Systems023 PC Operating Systems
Ahmer ZakirAhmer Zakir
-
8/7/2019 ICS-023 Chapter 12
2/24
Chapter 12 - MS DOS 2
MSMS--DOS Operating SystemDOS Operating System
History
Design Goals
Memory Management
Processor Management
Device Management
File Management
User Interface Additional Commands
-
8/7/2019 ICS-023 Chapter 12
3/24
Chapter 12 - MS DOS 3
MSMS--DOS, PCDOS, PC--DOS or DOSDOS or DOS
Developed to run single-user, stand-alone desktopcomputers. Exemplifies early Operating Systems because it manages jobs
sequentially from single user.
Advantages: Simple operation & straight-forward usercommands.
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).
-
8/7/2019 ICS-023 Chapter 12
4/24
Chapter 12 - MS DOS 4
History of DOSHistory of DOS
Version Release
date
Features
1.0 1981 CP/M compatible; supported only 1 directory
1.1 1982 Allowed double-sided 5 inch disks
2.0 1983 Eliminated some defects in version 13.0 1984 Increased memory requirement to 36K,
supported PC/AT
3.1 1984 First release to support networking
3.2 1986 Supported token ring and 3 inch disks
3.3 1987 IBM PS/2 computer
4.0 1988 Supported hard disks larger than 32 megabytes5.0 1991 Better use of extended memory
6.0 1993 Better use of conventional memory
6.22 1994 Provided users with capabilities previouslyavailable only as third party applications
-
8/7/2019 ICS-023 Chapter 12
5/24
Chapter 12 - MS DOS 5
Design GoalsDesign Goals
User
Hardware
COMMAND.COM
DOS Kernel
BIOS
MS-DOS
Accommodate single novice userin single-process environment.
Standard I/O support includeskeyboard, monitor, printer, &secondary storage unit.
User commands are based onEnglish words/phrases indicative ofaction to be performed.
Commands are interpreted bycommand processor.
Layering approach protects userfrom hardware.
-
8/7/2019 ICS-023 Chapter 12
6/24
Chapter 12 - MS DOS6
First 2 DOS Layers : BIOS &First 2 DOS Layers : BIOS &
KernelKernel
1. 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.
2. 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).
-
8/7/2019 ICS-023 Chapter 12
7/24
Chapter 12 - MS DOS7
Third DOS Layer : CommandThird DOS Layer : Command
ProcessorProcessor
3. Command processor (shell) -- sends prompts to user,accepts commands, executes commands, & issuesappropriate 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.
MS-DOS ran enormous collection of software packagesmaking it difficult to discontinue.
-
8/7/2019 ICS-023 Chapter 12
8/24
Chapter 12 - MS DOS8
DOS Memory ManagementDOS Memory Management
Relatively simple job because its managing single jobfor single user. Uses a first-fit memory allocation scheme since it is most
efficient strategy in a single-user environment.
-
8/7/2019 ICS-023 Chapter 12
9/24
Chapter 12 - MS DOS9
Reserved for BIOS 1M
Unused 640K
Transient part ofCommand.COM
Transient program
Area (user memory)
TSR programs
Resident part ofCommand.COM
Installable Drivers
Buffer Cache
MS-DOS Kernel
BIOS Interface
Interrupt Vectors (256) 0
RAM Layout for
1MB of Memory
-
8/7/2019 ICS-023 Chapter 12
10/24
Chapter 12 - MS DOS10
DOS Main Memory AllocationDOS Main Memory Allocation
First versions had simple contiguous memory allocation schemethat gave all of the available memory to resident applicationprogram. Applications couldnt dynamically allocate memory blocks.
MS-DOS Version 2.0 supported dynamic allocation, modification, & release ofmain memory blocks by applications.
Amount of memory each application owns depends on type of filefrom 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.
-
8/7/2019 ICS-023 Chapter 12
11/24
Chapter 12 - MS DOS11
Memory Block AllocationMemory Block Allocation
Allocates memory by using first-fit algorithm & linked list of
memory blocks.
With Version 3.3, MS-DOS started using best-fit or last-fit
strategy. Size of a block can vary from 16 bytes (paragraph) to
maximum available memory.
-
8/7/2019 ICS-023 Chapter 12
12/24
-
8/7/2019 ICS-023 Chapter 12
13/24
Chapter 12 - MS DOS13
Free/Busy Block ListFree/Busy Block List
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.
Well-designed application program releases memory block it no
longer needed.
Busy Free Busy Free Busy
Block 1 Block 2 Block 3 Block 4 Block 5
-
8/7/2019 ICS-023 Chapter 12
14/24
Chapter 12 - MS DOS14
Process ManagementProcess Management
MS-DOS doesnt support multitasking.
Programs cant 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.
-
8/7/2019 ICS-023 Chapter 12
15/24
Chapter 12 - MS DOS15
Interrupt Handlers Are ResponsibleInterrupt Handlers Are Responsible
for Synchronizing Processesfor Synchronizing Processes
PC has 256 interrupts & interrupt handlers, & they are accessed viainterrupt vector table.
Three types of interrupts:
1. Internal hardware interrupts -- generated by certain events occurring
during programs 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 toaccess DOS & BIOS functions, which, in turn, access system
resources.
-
8/7/2019 ICS-023 Chapter 12
16/24
Chapter 12 - MS DOS16
Device ManagementDevice Management
Ability to reorder requests to optimize seek & search time is not a feature of
DOS because its 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 itsinterrupts.
-
8/7/2019 ICS-023 Chapter 12
17/24
Chapter 12 - MS DOS17
Managing FilesManaging Files
Earliest versions of MS-DOS kept every file in a single directory.
Version 2.0 implemented hierarchical directory structure.
When disk is formatted, its tracks are divided into sectors of 512
bytes.
2-8 sectors are grouped into clusters & that's how File Manager
allocates space to files.
-
8/7/2019 ICS-023 Chapter 12
18/24
Chapter 12 - MS DOS 18
FORMAT Creates ThreeFORMAT Creates Three
Special Areas on DiskSpecial Areas on Disk
1. Boot record-- first sector of every logical disk & contains disk bootprogram & table of disk's characteristics.
2. Root directory-- Lists systems primary subdirectories & files (name,
extension, size, date & time of modification, starting cluster #, fileattribute codes).
3. FAT (File Allocation Table) -- contains status info about diskssectors: which are allocated, which are free, and which cant be
allocated because of errors.
-
8/7/2019 ICS-023 Chapter 12
19/24
Chapter 12 - MS DOS 19
Managing Files in DOSManaging Files in DOS
Supports noncontiguous file storage & dynamically allocates disk
space to a file, provided theres enough disk room.
Compaction (MS-DOS Version 6.0) available via utility used to
defragment disk (DEFRAG.EXE).
CHKDSK command used to determine need for compaction.
Restricting user access to computer system & resources isnt built
into MS-DOS.
-
8/7/2019 ICS-023 Chapter 12
20/24
Chapter 12 - MS DOS 20
User InterfaceUser Interface
Command-driven operating system.
When user presses Enter key, shell (COMMAND.COM) interprets
command & calls on next lower level routine to satisfy request.
User commands include some or all of these elements in this order:
command source-file destination-file switches
-
8/7/2019 ICS-023 Chapter 12
21/24
Chapter 12 - MS DOS 21
Command Stands for ction to be performed
DIR Directory List whats 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 orfiles.
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 diskforfile storage.
CHKDSK Check Disk Check diskfor disk/file/directory
status.
PROMPT System Prompt Change system prompt symbol.DEFRAG Defragment Disk Compact fragmented files.
(filename) Run, execute, file.
-
8/7/2019 ICS-023 Chapter 12
22/24
Chapter 12 - MS DOS 22
Batch Files & RedirectionBatch Files & Redirection
By creating customized batch files, users can quicklyexecute combinations of DOS commands to configuretheir system, perform routine tasks, or make it easier fornon-technical users to run software.
MS-DOS can redirect output from one standard input oroutput device to another.
command > destination
E.g., dir > PRN
-
8/7/2019 ICS-023 Chapter 12
23/24
Chapter 12 - MS DOS 23
Filter Commands (SORT, MORE)Filter Commands (SORT, MORE)
Filter commands accept input from default device, manipulate data insome fashion, & send results to default output device.
SORT accepts input from keyboard, sorts that data, & displays it on
screen. Sort the file by column.
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.
-
8/7/2019 ICS-023 Chapter 12
24/24