1 / 44

DOS- Disk Operating System

DOS- Disk Operating System. Contents. Internals of DOS, DOS loading, DOS memory map, Concepts of TSR,. ROM-BIOS. POST System configuration analysis Time of the day Print Screen Bootstrap loader I/O support programs. DOS. Interface between user and computer

corrinej
Download Presentation

DOS- Disk Operating System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DOS- Disk Operating System

  2. Contents • Internals of DOS, • DOS loading, • DOS memory map, • Concepts of TSR,

  3. ROM-BIOS • POST • System configuration analysis • Time of the day • Print Screen • Bootstrap loader • I/O support programs

  4. DOS • Interface between user and computer • Convert command into Computer actions • DOS manager, BIOS caretaker

  5. The structure of DOS • Three layers are: • The BIOS (Basic Input/Output System) • The DOS kernel • The command processor (shell)

  6. The BIOS Module • Specific to the individual computer system and is provided by the manufacturer of the system. • It contains the default resident hardware-dependent drivers for the following devices: • Console display and keyboard (CON) • Line printer (PRN) • Auxiliary device (AUX) • Date and time (CLOCK$) • Boot disk device (block device) • MS-DOS kernel sends I/O request packets to these device drivers; the drivers translate these requests into the proper commands for the various hardware controllers.

  7. The BIOS Module continued… • In many MS-DOS systems, the most primitive parts of the hardware drivers are located in read-only memory (ROM) so that they can be used by stand-alone applications, diagnostics, and the system startup program. • The terms resident and installable are used to distinguish between the drivers built into the BIOS and the drivers installed during system initialisation by DEVICE commands in the CONFIG.SYS file. • The BIOS is read into random-access memory (RAM) during system initialisation as part of a file named IO.SYS.

  8. MS-DOS Kernel • The kernel provides a collection of hardware-independent services called system functions. • - File Management • - Memory Management • - Device Input and Output • - Process control

  9. The DOS Kernel • The kernel is a proprietary program and provides a collection of hardware-independent services called system functions. • These functions include the following: • File and record management • Memory management • Character-device input/output • Spawning of other programs • Access to the real-time clock

  10. The DOS Kernel continued… • Programs can access system functions by loading registers with function-specific parameters and then transferring to the operating system by means of a software interrupt. • The DOS kernel is read into memory during system initialization from the MSDOS.SYS file on the boot disk. (The file is called IBMDOS.COM in PC-DOS.) This file is marked with the attributes hidden and system.

  11. The Command Processor • The command processor, or shell, is the user's interface to the operating system. It is responsible for parsing (describing) and carrying out user commands, including the loading and execution of other programs from a disk or other mass-storage device. • The default shell that is provided with MS-DOS is found in a file called COMMAND.COM. It is a special class of program running under the control of MS-DOS.

  12. More about COMMAND.COM • Default MS-DOS shell, COMMAND.COM, is divided into three parts: • A resident portion • An initialization section • A transient module • The resident portion is loaded in lower memory, above the DOS kernel and its buffers and tables. It contains the routines to process Ctrl-C and Ctrl-Break, critical errors, and the termination (final exit) of other transient programs. This part of COMMAND.COM issues error messages and is responsible for the familiar prompt Abort, Retry, Ignore? • The resident portion also contains the code required to reload the transient portion of COMMAND.COM when necessary.

  13. More about COMMAND.COM continued… • The initialization section of COMMAND.COM is loaded above the resident portion when the system is started. • It processes the AUTOEXEC.BAT batch file (the user's list of commands to execute at system startup), if one is present, and is then discarded.

  14. More about COMMAND.COM continued… • The transient portion of COMMAND.COM is loaded at the high end of memory, and its memory can also be used for other purposes by application programs. • The transient module issues the user prompt, reads the commands from the keyboard or batch file, and causes them to be executed. • When an application program terminates, the resident portion of COMMAND.COM does a checksum of the transient module to determine whether it has been destroyed and fetches a fresh copy from the disk if necessary.

  15. User Commands • The user commands that are accepted by COMMAND.COM fall into three categories: • Internal commands (carried out by code embedded in COMMAND.COM) • External commands (names of programs stored on disk file) • Batch files (batch or group of DOS commands)

  16. DOS Loading When system starts/reset program execution begins at an address FFFF0H, which lies within ROM area, containing a jump instruction to system test code and the ROM bootstrap routine, ROM bootstrap routine reads the disk bootstrap routine from the boot sector of the system startup disk into memory at some arbitrary address, And then transfers control to it.

  17. DOS Loading Continued…. The disk bootstrap routine checks for MS-DOS, by checking first two files from first sector of root directory. If not found user is prompted to change disk, and strike any key to try again. If found, both files will be read into memory by disk bootstrap routine and transfers controls to the initial entry point of IO.SYS.

  18. DOS Loading Continued…. • IO.SYS consists of two separate modules • BIOS: containing the linked set of resident device drivers, • SYSINIT: Supplied by Microsoft and linked into the IO.SYS file, along with the BIOS by the computer manufacturer. • SYSINIT is called by BIOS initialisation code, • Determines the contiguous memory present in the system and then relocates itself to high memory, • Then it moves the DOS kernel, MS-DOS.SYS, from its original load location to its final location, overlaying the original SYSINIT code and any other expendable initialisation code of IO.SYS

  19. DOS Loading Continued…. SYSINIT, next calls the initialisation code in MSDOS.SYS, DOS kernel initailises its internal tables and work areas, sets up the interrupt vectors 20H through 2FH, and traces through the linked list of resident device drivers, calling the initialisation function for each. These driver functions determine the equipment status, preform any necessary hardware initialisation, and set up the vectors for any external hardware interrupts the driver will service.

  20. Boot Process • Step 0: CPU Reset • Blank memory, except ROM • Start running from address FFFF0 (only 16 bytes left!) • Step 1: Power-on self test (POST) • Step 2: ROM BIOS startup program searches for and loads an OS • Step 3: OS configures the system and completes its own loading • Step 4: User executes applications software

  21. Step 1: POST & BIOS Boot • A built-in diagnostic program that checks the hardware to ensure that everything is present and functioning properly, before the BIOS begins the actual boot. • It then continues with additional tests, e.g., memory test, as boot process is proceeding. • The ROM BIOS startup program surveys hardware resources and needs, and assigns system resources to meet those needs

  22. POST

  23. Step 2: BIOS Finds & Loads OS • Most often the OS is loaded from logical drive C on the hard drive • Configuration information on CMOS chip tells startup BIOS where to look for the OS • BIOS turns to that device, reads the beginning files of the OS, copies them into memory, then turns control over to the OS • Master Boot Record (MBR) loaded.

  24. BIOS Finds & Loads OS

  25. Step 3: OS Completes Boot • The OS checks some of the same things that startup BIOS checked (e.g., available memory and whether memory is reliable) • The OS loads software to control the mouse, a CD-ROM, a scanner, and other peripheral devices (generally have device drivers)

  26. Boot Process

  27. Step 4: User Executes Applications Software • The OS finds the applications software (on a secondary storage device), copies software into memory, and turns control over to it • User commands the applications software, which makes requests to the OS, which uses the system resources, system BIOS, and device drivers to interface with and control the hardware

  28. 8086 MEMORY MAP 8086 MEMORY MAP

  29. Comparison between DOS and BIOS

  30. File Management • Block Devices are accessed on a sector basis. The MS- DOS kernel through the device driver sees a block as a logical fixed size array of sectors. the device driver in turn translates the logical sector requests from the MS – DOS into physical locations on the block device. • MS – DOS file system is divided into four parts - Boot Sector - Always at the beginning of a partition. - Contains OEM identification, a loader routine , and a BIOS parameter block. - File Allocation Tables (FAT) - Provides a map to the storage locations of files on the disk by indicating which clusters are allocated to each file. - Second copy of FAT as back up. - Free cluster is found by scanning the FAT for a zero value. - Root directory - Root directory entries are 32 bytes long. - Each entry includes a filename and extension, size, starting FAT entry, the time and date the file was created and the files attributes. - Files Area - Contains subdirectories, file data and unallocated clusters. - The area is divided into fixed size clusters and the use for a particular cluster is specified by the corresponding FAT entry

  31. Memory Management • Based on a pool of variable sized memory blocks. • Two basic functions are to allocate a block from the pool and to return the allocated block to the pool. • MS-DOS compatible personal computers can be fitted with three kinds of RAMs • Conventional Memory • Expanded Memory • Extended Memory • Conventional Memory - Up to 1MB of Memory is directly addressable. - Physical addresses for references are generated by a 16-bit segment register combined with 16-bit offset. - Out of 1MB MS-DOS occupies 640KB of the conventional memory. - This 640KB is divided into three zones - The interrupt vector table - Occupies lowest 1024 bytes of memory. - Its address and length are hardwired into the processor and cannot be changed. - The operating system area - Begins immediately above the interrupt vector table. - Holds the operating system, its tables and buffers, and device drivers. - Amount of memory occupied varies from version to version of MS-DOS. - The transient program area - Remainder of the 640KB area. - Organized into a structure called Memory Arena, which is divided into arena entries (memory blocks). - Each arena entry has a arena entry header.

  32. How MS-DOS supports Conventional Memory Management • The MS-DOS kernel supports three memory management functions, invoked with interrupt 21H, which operate on the TPA: - Function 48H (Allocate Memory block) - Function 49H (Free Memory block) - Function 4AH (Resize Memory block) • The memory manager can use any of three allocation strategies: - First fit – the arena entry at the lowest address that is large enough to satisfy the request. - Best fit – the smallest available arena entry that satisfies the request, regardless of its position. - Last fit – the arena entry at the highest address that is large enough to satisfy the request Default approach used by MS-DOS is First-fit approach. Expanded Memory - To circumvent the 1MB limit of conventional memory, expanded memory was designed. - As much as 8MB of expanded memory can be installed in a single machine. - Made available to the application software in 16KB pages. Expanded Memory Manager - Provides an interface between application programs and expanded memory. - Divided into Driver and Manager. - Manager controls the status, allocation, mapping and deallocation of expanded memory. Extended Memory - Storage at addresses above 1MB that can be accessed in Protected mode. - Extended memory is linearly addressable, so no manager required.

  33. Device Input and Output • MS-DOS recognizes two types of devices: block devices e.g. floppy disk or fixed disk drives; and character devices, e.g keyboard, display, printer, and communication ports. • MS-DOS identifies each block device by a drive letter assigned when the devices controlling software, the device driver, is loaded. A character device on the other hand, is identified by a logical name built into the device driver. • Distinction between character and block devices is that the MS-DOS always adds new block – device drivers to the tail of the driver chain but adds new character – device drivers to the head of the chain. • Techniques to access character devices: - Handle type function calls A handle is a 16 bit number returned by the operating system whenever a device is opened or created. - Character input and output functions: Interrupt 21H functions 01H to 0CH. These functions are designed to communicate directly with the keyboard, display, printer and serial port. Process Control • Process, or task, control includes program loading, task execution, task termination, task scheduling and intertask communication. • MS-DOS is not a multitasking operating system ,it is a single tasking operating system.

  34. Computer Memory and Memory Mapping Use of Hardware mapping registers in protected address space Programs are at same address space and executed simultaneously It maps pages of two sizes(4 KB and 2 MB) Processes of 1 user are protected from other users process Users are not able to use other users data

  35. Hardware Memory Mapping Register CR3 is the hardware mapping register It points to table available in computer memory CR3 contains the address of top level table(Page map level4) Page Map Level: It has 512 entries which points different pages in memory first level of memory translation hierarchy logical to virtual address 0-11 bit page offset 12-20 page table index 21-29 page directory index 30-38 page directory pointer 39-47 PML index

  36. Hardware Memory Mapping Register Page Directory Pointer Table second level of memory translation 512 entries, points to Page Directory Table Page Directory Table third level of memory translation 512 entries, points to Page Table Page Table fourth level of memory translation 512 entries, points to Pages in memory physical address of destination TLB available in cache Recently used pages

  37. BIOS and DOS Interrupts BIOS Calls: INT 10H

  38. BIOS and DOS Interrupts BIOS Calls: INT 10H

  39. BIOS and DOS Interrupts DOS Calls: INT 21H

  40. BIOS and DOS Interrupts DOS Calls: INT 21H File Operations

More Related