home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / docum / advdos.doc / s1c01 < prev    next >
Encoding:
Text File  |  1992-04-21  |  12.8 KB  |  255 lines

  1. ────────────────────────────────────────────────────────────────────────────
  2. SECTION 1  PROGRAMMING FOR MS-DOS
  3. ────────────────────────────────────────────────────────────────────────────
  4.  
  5.  
  6.  
  7. ────────────────────────────────────────────────────────────────────────────
  8. Chapter 1  Genealogy of MS-DOS
  9.  
  10.   In only seven years, MS-DOS has evolved from a simple program loader into
  11.   a sophisticated, stable operating system for personal computers that are
  12.   based on the Intel 8086 family of microprocessors (Figure 1-1). MS-DOS
  13.   supports networking, graphical user interfaces, and storage devices of
  14.   every description; it serves as the platform for thousands of application
  15.   programs; and it has over 10 million licensed users──dwarfing the combined
  16.   user bases of all of its competitors.
  17.  
  18.   The progenitor of MS-DOS was an operating system called 86-DOS, which was
  19.   written by Tim Paterson for Seattle Computer Products in mid-1980. At that
  20.   time, Digital Research's CP/M-80 was the operating system most commonly
  21.   used on microcomputers based on the Intel 8080 and Zilog Z-80
  22.   microprocessors, and a wide range of application software (word
  23.   processors, database managers, and so forth) was available for use with
  24.   CP/M-80.
  25.  
  26.   To ease the process of porting 8-bit CP/M-80 applications into the new
  27.   16-bit environment, 86-DOS was originally designed to mimic CP/M-80 in
  28.   both available functions and style of operation. Consequently, the
  29.   structures of 86-DOS's file control blocks, program segment prefixes, and
  30.   executable files were nearly identical to those of CP/M-80. Existing
  31.   CP/M-80 programs could be converted mechanically (by processing their
  32.   source-code files through a special translator program) and, after
  33.   conversion, would run under 86-DOS either immediately or with very little
  34.   hand editing.
  35.  
  36.   Because 86-DOS was marketed as a proprietary operating system for Seattle
  37.   Computer Products' line of S-100 bus, 8086-based microcomputers, it made
  38.   very little impact on the microcomputer world in general. Other vendors of
  39.   8086-based microcomputers were understandably reluctant to adopt a
  40.   competitor's operating system and continued to wait impatiently for the
  41.   release of Digital Research's CP/M-86.
  42.  
  43.   In October 1980, IBM approached the major microcomputer-software houses in
  44.   search of an operating system for the new line of personal computers it
  45.   was designing. Microsoft had no operating system of its own to offer
  46.   (other than a stand-alone version of Microsoft BASIC) but paid a fee to
  47.   Seattle Computer Products for the right to sell Paterson's 86-DOS. (At
  48.   that time, Seattle Computer Products received a license to use and sell
  49.   Microsoft's languages and all 8086 versions of Microsoft's operating
  50.   system.) In July 1981, Microsoft purchased all rights to 86-DOS, made
  51.   substantial alterations to it, and renamed it MS-DOS. When the first IBM
  52.   PC was released in the fall of 1981, IBM offered MS-DOS (referred to as
  53.   PC-DOS 1.0) as its primary operating system.
  54.  
  55.   IBM also selected Digital Research's CP/M-86 and Softech's P-system as
  56.   alternative operating systems for the PC. However, they were both very
  57.   slow to appear at IBM PC dealers and suffered the additional disadvantages
  58.   of higher prices and lack of available programming languages. IBM threw
  59.   its considerable weight behind PC-DOS by releasing all the IBM-logo PC
  60.   application software and development tools to run under it. Consequently,
  61.   most third-party software developers targeted their products for PC-DOS
  62.   from the start, and CP/M-86 and P-system never became significant factors
  63.   in the IBM PC─compatible market.
  64.  
  65.   In spite of some superficial similarities to its ancestor CP/M-80, MS-DOS
  66.   version 1.0 contained a number of improvements over CP/M-80, including the
  67.   following:
  68.  
  69.   ■  An improved disk-directory structure that included information about a
  70.      file's attributes (such as whether it was a system or a hidden file),
  71.      its exact size in bytes, and the date that the file was created or last
  72.      modified
  73.  
  74.   ■  A superior disk-space allocation and management method, allowing
  75.      extremely fast sequential or random record access and program loading
  76.  
  77.   ■  An expanded set of operating-system services, including
  78.      hardware-independent function calls to set or read the date and time, a
  79.      filename parser, multiple-block record I/O, and variable record sizes
  80.  
  81.   ■  An AUTOEXEC.BAT batch file to perform a user-defined series of commands
  82.      when the system was started or reset
  83.  
  84.   IBM was the only major computer manufacturer (sometimes referred to as
  85.   OEM, for original equipment manufacturer) to ship MS-DOS version 1.0 (as
  86.   PC-DOS 1.0) with its products. MS-DOS version 1.25 (equivalent to IBM
  87.   PC-DOS 1.1) was released in June 1982 to fix a number of bugs and also to
  88.   support double-sided disks and improved hardware independence in the DOS
  89.   kernel. This version was shipped by several vendors besides IBM, including
  90.   Texas Instruments, COMPAQ, and Columbia, who all entered the personal
  91.   computer market early. Due to rapid decreases in the prices of RAM and
  92.   fixed disks, MS-DOS version 1 is no longer in common use.
  93.  
  94.   MS-DOS version 2.0 (equivalent to PC-DOS 2.0) was first released in March
  95.   1983. It was, in retrospect, a new operating system (though great care was
  96.   taken to maintain compatibility with MS-DOS version 1). It contained many
  97.   significant innovations and enhanced features, including those listed on
  98.   the following page.
  99.  
  100.   ■  Support for both larger-capacity floppy disks and hard disks
  101.  
  102.   ■  Many UNIX/XENIX-like features, including a hierarchical file structure,
  103.      file handles, I/O redirection, pipes, and filters
  104.  
  105.   ■  Background printing (print spooling)
  106.  
  107.   ■  Volume labels, plus additional file attributes
  108.  
  109.   ■  Installable device drivers
  110.  
  111.   ■  A user-customizable system-configuration file that controlled the
  112.      loading of additional device drivers, the number of system disk
  113.      buffers, and so forth
  114.  
  115.   ■  Maintenance of environment blocks that could be used to pass
  116.      information between programs
  117.  
  118.   ■  An optional ANSI display driver that allowed programs to position the
  119.      cursor and control display characteristics in a hardware-independent
  120.      manner
  121.  
  122.   ■  Support for the dynamic allocation, modification, and release of memory
  123.      by application programs
  124.  
  125.   ■  Support for customized user command interpreters (shells)
  126.  
  127.   ■  System tables to assist application software in modifying its currency,
  128.      time, and date formats (known as international support)
  129.  
  130.   MS-DOS version 2.11 was subsequently released to improve international
  131.   support (table-driven currency symbols, date formats, decimal-point
  132.   symbols, currency separators, and so forth), to add support for 16-bit
  133.   Kanji characters throughout, and to fix a few minor bugs. Version 2.11
  134.   rapidly became the base version shipped for 8086/8088-based personal
  135.   computers by every major OEM, including Hewlett-Packard, Wang, Digital
  136.   Equipment Corporation, Texas Instruments, COMPAQ, and Tandy.
  137.  
  138.   MS-DOS version 2.25, released in October 1985, was distributed in the Far
  139.   East but was never shipped by OEMs in the United States and Europe. In
  140.   this version, the international support for Japanese and Korean character
  141.   sets was extended even further, additional bugs were repaired, and many of
  142.   the system utilities were made compatible with MS-DOS version 3.0.
  143.  
  144.   MS-DOS version 3.0 was introduced by IBM in August 1984 with the release
  145.   of the 80286-based PC/AT machines. It represented another major rewrite of
  146.   the entire operating system and included the important new features listed
  147.   on the following page.
  148.  
  149.   ■  Direct control of the print spooler by application software
  150.  
  151.   ■  Further expansion of international support for currency formats
  152.  
  153.   ■  Extended error reporting, including a code that suggests a recovery
  154.      strategy to the application program
  155.  
  156.   ■  Support for file and record locking and sharing
  157.  
  158.   ■  Support for larger fixed disks
  159.  
  160.   MS-DOS version 3.1, which was released in November 1984, added support for
  161.   the sharing of files and printers across a network. Beginning with version
  162.   3.1, a new operating-system module called the redirector intercepts an
  163.   application program's requests for I/O and filters out the requests that
  164.   are directed to network devices, passing these requests to another machine
  165.   for processing.
  166.  
  167.   Since version 3.1, the changes to MS-DOS have been evolutionary rather
  168.   than revolutionary. Version 3.2, which appeared in 1986, generalized the
  169.   definition of device drivers so that new media types (such as 3.5-inch
  170.   floppy disks) could be supported more easily. Version 3.3 was released in
  171.   1987, concurrently with the new IBM line of PS/2 personal computers, and
  172.   drastically expanded MS-DOS's multilanguage support for keyboard mappings,
  173.   printer character sets, and display fonts. Version 4.0, delivered in 1988,
  174.   was enhanced with a visual shell as well as support for very large file
  175.   systems.
  176.  
  177.   While MS-DOS has been evolving, Microsoft has also put intense efforts
  178.   into the areas of user interfaces and multitasking operating systems.
  179.   Microsoft Windows, first shipped in 1985, provides a multitasking,
  180.   graphical user "desktop" for MS-DOS systems. Windows has won widespread
  181.   support among developers of complex graphics applications such as desktop
  182.   publishing and computer-aided design because it allows their programs to
  183.   take full advantage of whatever output devices are available without
  184.   introducing any hardware dependence.
  185.  
  186.   Microsoft Operating System/2 (MS OS/2), released in 1987, represents a new
  187.   standard for application developers: a protected-mode, multitasking,
  188.   virtual-memory system specifically designed for applications requiring
  189.   high-performance graphics, networking, and interprocess communications.
  190.   Although MS OS/2 is a new product and is not a derivative of MS-DOS, its
  191.   user interface and file system are compatible with MS-DOS and Microsoft
  192.   Windows, and it offers the ability to run one real-mode (MS-DOS)
  193.   application alongside MS OS/2 protected-mode applications. This
  194.   compatibility allows users to move between the MS-DOS and OS/2
  195.   environments with a minimum of difficulty.
  196.  
  197.   ┌─────────────┐
  198.   │ MS-DOS 1.0  │ 1981: First operating system on IBM PC
  199.   │ PC-DOS 1.0  │
  200.   └──────┬──────┘
  201.          │
  202.   ┌────────────┐
  203.   │ MS-DOS 1.25 │ Double-sided disk support and bug fixes added:
  204.   │ PC-DOS 1.1  │ widely distributed by OEMs other than IBM
  205.   └──────┬──────┘
  206.          │
  207.   ┌────────────┐ 1983: Introduced with IBM PC/XT;
  208.   │ MS-DOS 2.0  │ support for UNIX/XENIX-like hierarchical
  209.   │ PC-DOS 2.0  │ file structure and hard disks added
  210.   └──────┬──────┘
  211.          ├──────────────────────────────────────┐
  212.   ┌────────────┐                        ┌────────────┐
  213.   │ MS-DOS 2.01 │ 2.0 with international │ PC-DOS 2.1  │ Introduced with PCjr;
  214.   └──────┬──────┘ support                └─────────────┘ 2.0 with bug fixes
  215.          │
  216.   ┌────────────┐
  217.   │ MS-DOS 2.11 │ 2.01 with bug fixes
  218.   └──────┬──────┘
  219.          ├──────────────────────────────────────┐
  220.   ┌────────────┐ 1984: Introduced with  ┌────────────┐ 1985: Far East OEMs;
  221.   │ MS-DOS 3.0  │ PC/AT; support for     │ MS-DOS 2.25 │ support for extended
  222.   │ PC-DOS 3.0  │ 1.2 MB floppy disk,    └─────────────┘ character sets
  223.   └──────┬──────┘ larger hard disk added
  224.          │
  225.   ┌────────────┐
  226.   │ MS-DOS 3.1  │ Support for Microsoft  ┌─────────────┐ 1985: Graphical
  227.   │ PC-DOS 3.1  │ Networks added         │   Windows   │ user interface
  228.   └──────┬──────┘                        │     1.0     │ for MS-DOS
  229.          │                               └──────┬──────┘
  230.   ┌────────────┐                               │
  231.   │ MS-DOS 3.2  │ 1986: Support for 3.5-        │
  232.   │ PC-DOS 3.2  │ inch disks added              │
  233.   └──────┬──────┘                               │
  234.          │                               ┌────────────┐ 1987: Compatibility
  235.   ┌────────────┐ 1987: Introduced with  │   Windows   │ with OS/2
  236.   │ MS-DOS 3.3  │ IBM PS/2; generalized  │     2.0     │ Presentation Manager
  237.   │ PC-DOS 3.3  │ code-page (font)       └─────────────┘
  238.   └──────┬──────┘ support
  239.          │
  240.   ┌────────────┐ 1988: Support for
  241.   │ MS-DOS 4.0  │ logical volumes larger
  242.   │ PC-DOS 4.0  │ than 32 MB; visual shell
  243.   └─────────────┘
  244.  
  245.   Figure 1-1.  The evolution of MS-DOS.
  246.  
  247.   What does the future hold for MS-DOS? Only the long-range planning teams
  248.   at Microsoft and IBM know for sure. But it seems safe to assume that
  249.   MS-DOS, with its relatively small memory requirements, adaptability to
  250.   diverse hardware configurations, and enormous base of users, will remain
  251.   important to programmers and software publishers for years to come.
  252.  
  253.  
  254.  
  255.