ppt_ch14

58
Chapter 14 MS-DOS Operating System

Upload: brad

Post on 11-Nov-2015

214 views

Category:

Documents


0 download

DESCRIPTION

powerpoint

TRANSCRIPT

  • Chapter 14 MS-DOS Operating System

    Understanding Operating Systems, Sixth Edition

  • After completing this chapter, you should be able to describe:How to access MS-DOS emulators from other operating systemsHow MS-DOS provided a foundation for early Microsoft Windows releasesThe basics of command-driven systems and how to construct simple batch filesHow one processor can be shared among multiple processesThe limitations of MS-DOSUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Development purposeSingle-user, stand-alone desktop computers Manages single user jobs sequentiallyAdvantagesFundamental operation Straightforward user commandsDisadvantagesLack of flexibility Lack of ability to meet programmer and experienced user needsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • CP/M operating system successorCP/M ran first eight-bit machinesMicrosoft Discovered 86-DOSDesigner: Tim Patterson (Seattle Computer Products)Microsoft bought and renamed 86-DOS to MS-DOSAvailable to IBMIBM renamed MS-DOS to PC-DOS (1981)Catalyst for MS-DOS growthStandard for IBM PCs throughout 1980s16-bit machinesUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Many standard versions over yearsLater versions compatible with earlier versionsCommandsManufacturer independentEarly Windows versions (1.0 - 3.1)GUIs on top of MS-DOS TodayMS-DOS no longer widely usedWindows offers DOS emulatorUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Accommodate single novice userIn single-process environmentStandard I/O support Keyboard, monitor, printer, secondary storage unitUser commandsBased on English words or phrasesIndicative of action to performInterpreted by command processorLayering approachFundamental to MS-DOS system designUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • BIOS (Basic Input/Output System) Direct interface with I/O devices Contains device drivers Controls data flow to and from each device (except disk drives)Receives I/O operation status informationPasses to processorHandles small differences among I/O unitsNo need to write device driver for manufacturer printer Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • DOS kernelContains routines to interface with disk drivesRead into memoryInitialization time from MSDOS.SYS fileResides in boot diskMicrosoft proprietary programAccessed by application programsProvides hardware-independent servicesSystem functions Memory management, file and record managementUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • DOS kernel (cont'd.)Provides transparencyCompensates for manufacturer variations Manages file storage and retrievalDynamically allocates and deallocates secondary storage as neededUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Command processor (shell)Sends prompts to userAccepts typed commandsExecutes commandsFrom system promptIssues appropriate responsesResides in COMMAND.COM fileStored in two different main memory sectionsAppears on public directoryWeakness: not interpretiveUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS Version 4Introduced menu-driven shellNot widely acceptedOS/2New operating systemDesigned with advantages to replace MS-DOSNot widely acceptedMS-DOS hey dayRan variety of software (Lotus 1-2-3, WordPerfect)Spurred growth of personal computer industryUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Memory Manager Manages single job for single userFor second job executionUser must close or pause first before opening secondFirst-fit memory allocation schemeEfficient in single-user environment

    Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Main memory structureROMVery small in sizeContains programContains section of BIOS with startup process (bootstrapping) Initializes computerRetrieves resident code and loads into RAMRAMPart of main memoryWhere programs are loaded and executedUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS Version 1.0 All available memory to resident application programMS-DOS Version 2.0Application programsDynamic allocation supportMain memory blocks modification and releaseApplication program memory ownership dependencies Type of file from which program loadedSize of Transient Program Area (TPA)Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • ProgramsCOM extensionGiven all TPA (needed or not)EXE extensionGiven memory needed (if available)TPA Any number of programs (except COM files)Two programs cannot run simultaneouslyMemory allocationShrinking and expanding during executionRequires C or assembly language Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Memory allocationFirst-fit algorithm and linked list of memory blocksBest-fit or last-fit strategyVersion 3.3 and beyondLast-fitAllocates highest addressable memory block satisfying programs requestBlock size variesSmall: 16 bytes ( paragraph)Large: maximum available memoryUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Memory request stepsDOS looks through free/busy block listUntil finding free block fitting requestUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Disconnected listError message issuedSystem stops Reboot necessaryWell-designed application program Releases memory block no longer neededTwo contiguous free memory blocksImmediately merged into one block and linked to listUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Simple taskJob read for execution Allocate processor to resident jobUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Reentrant code Basis for multitaskingNot supportedNo interleavingNo need for sophisticated algorithms or policiesJobsRun in complete segments Not interrupted midstreamIllusion of multitaskingUses synchronization and interrupt handlersUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • ResponsibilitySynchronizing (parent and child processes)Saves all parent program information Allows proper restart after child program finishedPersonal computer256 interrupts and interrupt handlersAccessed through interrupt vector table (RAM)Interrupts divided into three groupsInternal hardware interruptsExternal hardware interruptsSoftware interruptsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Internal hardware interruptsGenerated by events occurring during programs executionDivision by zeroEvent assignment to specific interrupt numbersElectronically wired into processorNot modifiable by software instructions

    Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • External hardware interruptsCausePeripheral device controllers or coprocessors External device assignment to specific interrupt levels Done by manufacturer Cannot be modified by software Physical electrical connection implementationSoftware interruptsGenerated by system and application programsAccess DOS and BIOS functionsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Software interrupts (cont'd.) Some activate specialized application programsTake control of computerExample: Borlands SideKick (type of TSR)Terminate and Stay Resident (TSR) interrupt handlerTerminates process without releasing memoryUsed by subroutine librariesSets up memory tablesExecution preparation via DOS interrupt connectionDetermines memory requiredSends return code back to parentUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Interrupt synchronizationCPU senses interruptPuts on stack: contents of PSW (program status word), code segment register, and instruction pointer registerDisables interrupt systemUses eight-bit number to obtain interrupt handler addressInterrupt handler reenables interrupt system: allows higher-priority interrupts to occurSaves registers and processes interruptUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Requests Reordering requests: not supported Handled: first-come, first-servedBIOS supports spooling (Version 3.0)MS-DOS Written for simple systemsKeyboard, monitor, printer, mouse, serial ports,Personal computer storageMagnetic tape, floppy disks, or hard disks No device channelsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS (cont'd.)Devices have dedicated control unitOnly requires device driverDevice driverSoftware module controlling I/O deviceBIOS Portion of Device ManagerHandles device driver softwareInstallable device driversSalient feature of MS-DOS designUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • File organizationSequential Variable or fixed-length recordsDirect Fixed-length recordsIndexed sequential Fixed-length recordsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • FilenameNo spacesDrive designation, directory, any subdirectory, a primary name, and optional extensionNot case sensitiveDrive name: followed by colon (:)Directories or subdirectoriesOne to eight charactersPreceded by a backslash (\)Primary filename: one to eight charactersUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • ExtensionOne to three charactersMay have special meaningFileAssumption: in current working directoryIf no directories or subdirectories included in nameOn current drive if no drive designatedRelative namePrimary name and extension Absolute nameDrive designation and directory locationUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Earliest versionsEvery file in single directorySlow and cumbersome file retrievalHierarchical directory structure (version 2.0)Inverted tree directory structure (root at top)FormattingDisk tracks divided into 512-byte sectorsCorresponds to 512-byte buffer sizeCylinder concept Applies to hard disksRead/write heads move in unisonUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • SectorsTwo to eightGrouped into clustersFile needs additional spaceDOS allocates more clusters FORMAT commandThree special areas on diskBoot recordRoot directoryFAT(file allocation table)Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Boot recordsFirst sector of every logical diskDisk boot program Table of disks characteristicsRoot directorySystem begins interaction with user List of systems primary subdirectories and filesAny system-generated configuration files Any user-generated booting instructionsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Root directory (cont'd.)AUTOEXEC.BAT fileBatch file containing user-defined command seriesCommands execute automatically (CPU power up)Root directory informationFilename, file extensionFile size in bytesDate and time of files last modificationStarting cluster number for fileFile attribute codesUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Root directory (cont'd.)LimitationNumber of root directory entries fixedVersion 2.0 and onward Limitation avoided with subdirectoriesSubdirectoryMay contain its own subdirectories and/or filesMS-DOS supports hidden filesExecutable files not displayed in DIR command listing COMMAND.COM (only system file not hidden)Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • File allocation table (FAT)Contains disk sectors status informationStatus includes:Allocated sectors, free sectors, unallocatable sectors (formatting errors)All sectors (except first) chain linkedEach FAT entry: sector/cluster number of next entryLast entry contains value set to FFFF indicates chain endUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS data views Disk file: continuous string of bytesI/O operation data requestBy relative byte (relative to file beginning)Not a relative sectorSupports noncontiguous file storage Dynamically allocates file disk space Compaction: DEFRAG.EXE inclusion (Version 6.0)CHKDSK: file storage noncontiguous block countSecurity features not includedUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS Command-driven interfaceSystem promptUser types commandsDefault prompt Drive indicator and > characterChanged using PROMPT commandUser command elementsCommand, source-file, destination-file, switchesUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Switches (optional)Provide details on how command carried outBegin with slash (/P, /V, /F)COMMAND.COM (carries out commands)Resident portion of codeStored in low memory sectionCommand interpreter, routines: support active programTransient codeStored in highest memory addresses Can be overwritten if memory space neededUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • CustomizedAllows quick DOS command executionConfigure systemPerform routine tasksEasier to run software (nontechnical users)Run manuallyUse START command at system promptRun automatically (at system start)Rename file to AUTOEXEC.BAT Load into system root directoryUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Redirect output From one standard input or output device to anotherSyntax: command > destinationExample: DIR > PRN Sends directory listing to printer (instead of monitor)Append symbol (>>)Redirect and append new output to existing fileExample: DIR >> B:DIRFILEWorks in opposite mannerSymbol (
  • CommandsAccept default device input, manipulate data, send results to default output device Example: SORTAccepts input and displays on screenAccepts file input and sorts into another file (redirect)Ascending order: SORT < STD.DAT > SORTSTD.DATReverse order file: SORT /RExample: MOREOutput displayed on screen in groups of 24 linesOne screen at time (press Enter key)Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Command outputInput to another commandSymbolVertical bar (|)Example: DIR | SORT Alphabetically sort directoryDisplay sorted list on screenCan combine pipes and other filtersCan sort directory and display one screen at a timeExample using pipe commandDIR | SORT | MOREUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • FINDSearches for specific string in given file(s)Displays all lines containing stringExample: FIND "AMNT-PAID" PAYROLL.COBDisplay PAYROLL.COB lines containing AMNT-PAIDPRINTSet up series of files for printingFrees up COMMAND.COMPRINT /B: allows changing of internal buffer sizePRINT /Q: specifies number of files allowed in print queueUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • TREEDisplays directories and subdirectoriesIn hierarchical order and indented listOptions allow file deletion while tree generatedTREE /F Displays filenames in each directoryUsed to delete duplicated file on different directoriesUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Understanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • MS-DOS Written to serve 1980s personal computer usersLimitationLimited flexibilityOperating system unusable as hardware evolvedFirst standard operating systemAdopted by personal computing machine manufacturersSupported by legions of software design groupsUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

  • Advantages Fundamental operationStraightforward user commandsWeakness DesignSingle-user/single-task systemsNo multitasking, networking, sophisticated applications supportUnderstanding Operating Systems, Sixth Edition*

    Understanding Operating Systems, Sixth Edition

    *