A Technical and Historical look at MS-DOS

Download Report

Transcript A Technical and Historical look at MS-DOS

A Technical and Historical look
at MS-DOS
CS-460
Fall 2003
Authors: Jimmy Conaway, Matt Carey, Itri Idsalah
History
• Microsoft was originally called “Traf-o-Data” – they made car
counters for highway departments. They were known for MS-BASIC,
not operating systems.
• IBM originally intended Digital Research’s CP/M operating system to
be used for their PC, but the deal went sour with Digital Research.
• Microsoft was commissioned by IBM to make an operating system
for their PC.
• Microsoft licensed QDOS (Quick and Dirty Operating System) from
Seattle Computer Products.
• MS-DOS was the cheapest option available for the IBM PC, so
everyone bought it.
• Microsoft continues to dominate the O/S market to this day.
Memory Management
• MS-DOS was specifically designed for Intel 80xxx chip based
personal computers. Therefore MS-DOS’s memory management is
strictly related to the memory architecture of the 80xxx chipset
family. (Microsoft.com, 1995)
Memory Management
16M
Extended
Memory
1M+64K
1M
640K
HMA
Upper Memory
Area
Conventional
Memory
Buffer cache, RAM Disk,
Memory for protected mode OS
I/O boards, ROMs, MS-DOS and
Device drivers
MS-DOS, Device drivers, programs
0
Memory Layout for Intel 8088 Chip (web.njit.edu 1995)
Implementation of Memory Management
1M
ROM
Video RAM
640K
Program 1
Arena
• Memory blocks allocated to
processes are called arenas.
• An arena starts at a paragraph
and contains a number of
paragraphs. The first
paragraph is the arena header.
• MS-DOS memory is managed
by chaining Arenas. The data
structure permitting this
interconnectivity is the PSP.
TSR
MS-DOS
Arena header
0
Memory layout for Program1 (web.njit.edu 1995)
Implementation of Memory Management
•
•
A PSP (Program Segment Prefix) is assigned to each
process.
A PSP is a simpler process context block that contains:
1.
2.
3.
4.
Program size,
Pointer to the environment block,
Command string,
Pointer to the parent's PSP.
Implementation of Memory Management
• When memory is required, the arena chain is searched from the
beginning for an arena of required size. If the arena is too large, It is
divided into smaller memory blocks. When a program is no longer
resident, the memory is freed. But both parts of the arena chain
cannot be merged because the chain is not doubly linked (only one
pointer is used to point to the next arena). Merging occurs the next
time the chain is searched. (web.njit.edu 1995)
Implementation of I/O in MS-DOS
• In order to understand an I/O call process, we chose to describe a
base case scenario:
1. A user program issues a READ or WRITE system call.
2. A request message is constructed. The message contains:
•
•
•
Function code for the operation desired (read or write),
Memory address to read to or write from,
Device address.
Implementation of I/O in MS-DOS
4.
The I/O code is called to do the actual I/O. Code address is obtained
from the driver header.
5.
When the driver finishes its work, it sets a status word indicating
success or failure and returns control to the user program.
File Management
●
●
●
●
●
●
Naming scheme limited to an eight character filename with a 3 character
file extension.
File size limited to an 4 byte file descriptor (approximately 4 billion
characters).
First version was limited to reading and writing to floppy disc (160Kb for a
single sided diskette and 322 Kb for a double sided diskette).
Version 2 of DOS added the functionality to write to a hard disk an
increase disk storage to 9 bytes per single track (179Kb single sided
diskette and 362Kb for double sided diskette).
For each file 1 byte attribute to hold flag information (hidden, system file,
plain normal file, executable).
First Version of DOS was able to hold 64 files on a single sided diskette
and 112 files on a double sided diskette, file structure relatively simple
due to the fact only writing to a diskette.
File Management
●
●
●
●
●
A file and state was kept external to the file in a file control block
(FCB).
Access method for DOS version 1 was either sequential or random
having either 128 records or a maximum of 64K bytes of data.
Access method for DOS version 2 was a pointer that lead to the FAT
table itself.
DOS provides a common memory space to create new FCBs then
once created writes them out to disc.
To perform disk IO the process just has to set a few registers and
call the appropriate function which then pass the request to the
device controller which then handles the operation.
File Management
●
●
●
The structure of files were logical devices called blocks
Single block is equivalent to up to 128 continuous records and a single
record is a logical group of continuous bytes on a disc ranging from 1K to
64K of data.
The amount of records a block represents is adjustable to get a higher
performance out of the disk IO request.
●
FCBs under DOS are stored out on disc.
●
2 versions of FCBs an extended one and a standard one
●
The standard FCB is 37 bytes in length and the extended is 40 bytes in
length.
File Management
●
●
●
The extended FCB provides special attributes to the file that the
standard FCB does not.
DOS provides a common memory space to create new FCBs then
once created writes them out to disc
To perform disk IO the process just has to set a few registers and
call the appropriate function which then pass the request to the
device controller which then handles the operation.
Scheduling / Threading / Synchronization
Being DOS was developed so early in the computer history there was only 1
process that ran on the system at any given time.
The single process would be spawned in a single thread of execution thus
there was no need for both kernel level and user-level threading since all
process were of the same type of thread.
Mutual exclusion and needs for synchronization were not needed since only
one process had control of the entire system at any one given moment in
time.
Conclusion
●
●
●
●
●
●
Considered ancient to today's standards but back then it was the premier
operating system for the personal home computer.
Came in 2 major versions MS-DOS and IBM PC-DOS with several
alternatives like DR. DOS.
Earliest version released was IBM PC-DOS which came out in 1981.
Was a simple command line interface to it no windowing or multi tasking
capabilities.
Single tread of execution so it was not uncommon to use batch files to
perform multiple commands in sequence, most common AUTOEXEC.bat.
Although very primitive it was a functional and highly used operating system
during the 1980's.
Questions??