MS-DOS_API

DOS API

The DOS API is an API which originated with 86-DOS and is used in MS-DOS/PC DOS and other DOS-compatible operating systems. Most calls to the DOS API are invoked using software interrupt 21h (INT 21h). By calling INT 21h with a subfunction number in the AH processor register and other parameters in other registers, various DOS services can be invoked. These include handling keyboard input, video output, disk file access, program execution, memory allocation, and various other activities. In the late 1980s, DOS extenders along with the DOS Protected Mode Interface (DPMI) allow the programs to run in either 16-bit or 32-bit protected mode and still have access to the DOS API.

History of the DOS API

The original DOS API in 86-DOS and MS-DOS 1.0 was designed to be functionally compatible with CP/M. Files were accessed using file control blocks (FCBs). The DOS API was greatly extended in MS-DOS 2.0 with several Unix concepts, including file access using file handles, hierarchical directories and device I/O control.[1] In DOS 3.1, network redirector support was added. In MS-DOS 3.31, the INT 25h/26h functions were enhanced to support hard disks greater than 32 MB. MS-DOS 5 added support for using upper memory blocks (UMBs). After MS-DOS 5, the DOS API was unchanged for the successive standalone releases of DOS.

The DOS API and Windows

In Windows 9x, DOS loaded the protected-mode system and graphical shell. DOS was usually accessed from a virtual DOS machine (VDM) but it was also possible to boot directly to real mode MS-DOS 7.0 without loading Windows. The DOS API was extended with enhanced internationalization support and long filename support, though the long filename support was only available in a VDM. With Windows 95 OSR2, DOS was updated to 7.1, which added FAT32 support, and functions were added to the DOS API to support this. Windows 98 and Windows ME also implement the MS-DOS 7.1 API, though Windows ME reports itself as MS-DOS 8.0.

Windows NT and the systems based on it (e.g. Windows XP and Windows Vista) are not based on MS-DOS, but use a virtual machine, NTVDM, to handle the DOS API. NTVDM works by running a DOS program in virtual 8086 mode (an emulation of real mode within protected mode available on 80386 and higher processors). NTVDM supports the DOS 5.0 API. DOSEMU for Linux uses a similar approach.

Interrupt vectors used by DOS

The following is the list of interrupt vectors used by programs to invoke the DOS API functions.

More information Interrupt vector, Description ...

DOS INT 21h services

The following is the list of functions provided via the DOS API primary software interrupt vector.

More information AH, Description ...

Operating systems with native support

Operating systems with DOS emulation layer

Other emulators

See also


References

  1. Ray Duncan (1988). Advanced MS-DOS Programming: The Microsoft Guide for Assembly Language and C Programmers. Microsoft Press. ISBN 0914845772.

Further reading

  • Allen, Paul; Gates, Bill; King, Adrian; Larson, Chris; Letwin, Gordon; O'Rear, Bob; Paterson, Tim; Peters, Chris; Phillips, Bruce; Reynolds, Aaron; Stillmaker, Betty; Zbikowski, Mark (1986). "Technical advisors". MS-DOS (Versions 1.0-3.2) Technical Reference Encyclopedia. By Bornstein, Howard; Bredehoeft, Lawrence; Duncan, Ray; Morris, Carol; Rose, David; Socha, John; Tomlin, Jim; Vian, Kathleen; Wolverton, Van. Beley, Jim; Preppernau, Barry; Beason, Pam; Lewis, Andrea; Rygmyr, David (eds.). Microsoft Reference Library. Vol. 1 (Original withdrawn ed.). Redmond, Washington, USA: Microsoft Press. ISBN 0-914845-69-1. LCCN 86-8640. OCLC 635600205. (xvii+1053 pages; 29 cm) (NB. This original edition contains flowcharts of the internal workings of the system. It was withdrawn by Microsoft before mass-distribution in 1986 because it contained many factual errors as well as some classified information which should not have been published. Few printed copies survived. It was replaced by a completely reworked edition in 1988. )
  • Zbikowski, Mark; Allen, Paul; Ballmer, Steve; Borman, Reuben; Borman, Rob; Butler, John; Carroll, Chuck; Chamberlain, Mark; Chell, David; Colee, Mike; Courtney, Mike; Dryfoos, Mike; Duncan, Rachel; Eckhardt, Kurt; Evans, Eric; Farmer, Rick; Gates, Bill; Geary, Michael; Griffin, Bob; Hogarth, Doug; Johnson, James W.; Kermaani, Kaamel; King, Adrian; Koch, Reed; Landowski, James; Larson, Chris; Lennon, Thomas; Lipkie, Dan; McDonald, Marc; McKinney, Bruce; Martin, Pascal; Mathers, Estelle; Matthews, Bob; Melin, David; Mergentime, Charles; Nevin, Randy; Newell, Dan; Newell, Tani; Norris, David; O'Leary, Mike; O'Rear, Bob; Olsson, Mike; Osterman, Larry; Ostling, Ridge; Pai, Sunil; Paterson, Tim; Perez, Gary; Peters, Chris; Petzold, Charles; Pollock, John; Reynolds, Aaron; Rubin, Darryl; Ryan, Ralph; Schulmeisters, Karl; Shah, Rajen; Shaw, Barry; Short, Anthony; Slivka, Ben; Smirl, Jon; Stillmaker, Betty; Stoddard, John; Tillman, Dennis; Whitten, Greg; Yount, Natalie; Zeck, Steve (1988). "Technical advisors". The MS-DOS Encyclopedia: versions 1.0 through 3.2. By Duncan, Ray; Bostwick, Steve; Burgoyne, Keith; Byers, Robert A.; Hogan, Thom; Kyle, Jim; Letwin, Gordon; Petzold, Charles; Rabinowitz, Chip; Tomlin, Jim; Wilton, Richard; Wolverton, Van; Wong, William; Woodcock, JoAnne (Completely reworked ed.). Redmond, Washington, USA: Microsoft Press. ISBN 1-55615-049-0. LCCN 87-21452. OCLC 16581341. (xix+1570 pages; 26 cm) (NB. This edition was published in 1988 after extensive rework of the withdrawn 1986 first edition by a different team of authors. )
  • Norton, Peter; Wilton, Richard (1987). The New Peter Norton Programmer's Guide to the IBM PC & PS/2. Microsoft Press. ISBN 1-55615-131-4.
  • Ray Duncan (1988). Advanced MS-DOS Programming: The Microsoft Guide for Assembly Language and C Programmers. Microsoft Press. ISBN 0914845772.
  • Hogan, Thom (1991). The Programmer's PC Sourcebook. Microsoft Press. ISBN 155615321X.
  • MS-DOS Programmer's Reference - The Official Technical Reference to MS-DOS. Microsoft Press. 1993. ISBN 1556155468.
  • IBM PC DOS 7 Technical Update
  • OpenDOS Developer's Reference Series OpenDOS Programmer's Guide System and Programmer's Guide. Caldera, Inc. August 1997. Caldera Part No. 200-DOPG-003. Archived from the original on 2017-10-07. Retrieved 2012-06-28. (Printed in the UK.)

Share this article:

This article uses material from the Wikipedia article MS-DOS_API, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.