DOS API: Difference between revisions

Content deleted Content added
mention FreeDOS as an implementer
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (Whoop whoop pull up - 21816
 
(41 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|API of the MS-DOS operating system}}
{{more footnotes|date=May 2015}}
{{Use dmy dates|date=May 2019|cs1-dates=y}}
The '''MS-DOS API''' is an [[Application programming interface|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 (x86 instruction)|INT]] 21h). By calling INT 21h with a subfunction number in the AH [[processor register]] and other parameters in other registers, one invokes various DOS services. DOScan servicesbe invoked. These include handling keyboard input, video output, disk file access, executingprogram programsexecution, memory allocation, and various other thingsactivities. In the late 1980s, [[DOS extender]]s 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 block]]s (FCBs). The DOS API was greatly extended in MS-DOS 2.0 with several [[Unix]] concepts, including file access using [[file handles]], [[directory (file systems)|hierarchical directories]] and device I/O control.<ref>{{cite book |title=Advanced MS-DOS Programming: The Microsoft Guide for Assembly Language and C Programmers |author=Ray Duncan |publisher=Microsoft Press |year=1988 |isbn=0914845772 |url-access=registration |url=https://archive.org/details/advancedmsdosmic00dunc }}</ref> 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 was generally used as a bootloader which loaded the protected-mode operating 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 [[Intel 80386|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.
 
{| class="wikitable" border="1"
|-
Line 66 ⟶ 70:
|Fast console output
|2.0+
|Implemented by the builtinbuilt-in console device driver or a replacement driver like ANSI.SYS
|-
|{{Code|2Ah}}
Line 100 ⟶ 104:
 
==DOS INT 21h services==
The following is the list of functions provided via the DOS API primary software interrupt vector.
 
{| class="wikitable" border="1"
|-
Line 543 ⟶ 549:
|}
 
==Operating systems with native support for the MS-DOS API==
* [[MS-DOS]] - most widespread incarnationimplementation
* [[IBM PC DOS|PC&nbsp;DOS]] - IBM OEM version of MS-DOS
* [[OS/2]] 1.x – Microsoft/IBM successor to MS-DOS and PC&nbsp;DOS
* [[DR-DOS]] - Digital Research DOS family, including [[Novell DOS]], [[PalmDOS]], [[OpenDOS]], etc.
* [[SISNE plus]] – [[Clone (computing)|Clone]] created by [[Itautec]] and [[Scopus Tecnologia]] in [[Brazil]]
* [[PTS-DOS]] - PhysTechSoft & Paragon DOS clone, including [[S/DOS]]
* [[DR-DOS]] - Digital Research DOS family, including [[Novell DOS]], [[PalmDOS]], [[OpenDOS]], etc.
* [[ROM-DOS]] - Datalight ROM DOS version
* [[FreeDOSPTS-DOS]] - Free,PhysTechSoft open& sourceParagon DOS clone, including [[S/DOS]]
* [[ROM-DOS]] - Datalight ROM DOS version
* [[Embedded DOS]] – [[General Software]] version
* [[FreeDOS]] – Free, open source DOS clone
* [[ReactOS]] ([[IA-32]] and [[x86-64]] versions)
* [[Windows 95]] - contains MS-DOS 7.0
* [[Windows 98]] - contains MS-DOS 7.1
* [[Windows 98 SE]] - contains MS-DOS 7.1
* [[Windows ME]] - contains MS-DOS 8.0
* [[Windows NT]] (all versions except 64-bit editions)
 
==ProgramsOperating systems with supportDOS for the MS-DOSemulation APIlayer==
* [[Concurrent CP/M-86]] (3.1 only) with [[PCMODE]] – Digital Research CP/M-86-based OS with optional PC&nbsp;DOS emulator
* [[Concurrent DOS]] – Digital Research CDOS family with built-in PC&nbsp;DOS emulator
* [[DOS Plus]] – a stripped-down single-user variant of Concurrent PC&nbsp;DOS 4.1–5.0
* [[Multiuser DOS]] – Digital Research/Novell MDOS family including [[Datapac System Manager]], [[IMS REAL/32]], etc.
* [[OS/2]] (2.x and later) – IBM operating system using a fully-licensed MS-DOS 5.0 in a [[virtual machine]]
* [[NTVDM|NTVDM.EXE]] for [[Windows NT]]
* [[Windows NT]] (all versions except 64-bit editions and 32-bit ARM editions)
* [[FreeDOS]]
 
==Other emulators==
* [[NTVDM|NTVDM.EXE]] for [[Windows NT]]
* [[DOSEMU]] for [[Linux]]
* [[DOSBox]]
* [[FreeDOSReactOS]]
 
==See also==
* [[BIOS interrupt call]]
* [[Ralf Brown's Interrupt List]] (RBIL)
* [[Comparison of DOS operating systems]]
* [[DOS Protected Mode Interface]] (DPMI)
Line 577 ⟶ 590:
==References==
{{Reflist}}
 
{{refbegin}}
==Further reading==
* [http://www.cs.cmu.edu/~ralf/files.html The x86 Interrupt List] (a.k.a. RBIL, Ralf Brown's Interrupt List)
* {{Cite book |editor-first1=Jim |editor-last1=Beley |editor-first2=Barry |editor-last2=Preppernau |editor-first3=Pam |editor-last3=Beason |editor-first4=Andrea |editor-last4=Lewis |editor-first5=David |editor-last5=Rygmyr |author-first1=Howard |author-last1=Bornstein |author-first2=Lawrence |author-last2=Bredehoeft |author-first3=Ray |author-last3=Duncan |author-first4=Carol |author-last4=Morris |author-first5=David |author-last5=Rose <!-- |author-link5=David Rose --> |author-first6=John |author-last6=Socha |author-link6=John Socha |author-first7=Jim |author-last7=Tomlin |author-first8=Kathleen |author-last8=Vian |author-first9=Van |author-last9=Wolverton |title=MS-DOS (Versions 1.0-3.2) Technical Reference Encyclopedia |contribution=Technical advisors |contributor-first1=Paul |contributor-last1=Allen |contributor-link1=Paul Allen |contributor-first2=Bill |contributor-last2=Gates |contributor-link2=Bill Gates |contributor-first3=Adrian |contributor-last3=King |contributor-first4=Chris |contributor-last4=Larson |contributor-first5=Gordon |contributor-last5=Letwin |contributor-link5=Gordon Letwin |contributor-first6=Bob |contributor-last6=O'Rear |contributor-link6=Bob O'Rear |contributor-first7=Tim |contributor-last7=Paterson |contributor-link7=Tim Paterson |contributor-first8=Chris |contributor-last8=Peters |contributor-first9=Bruce |contributor-last9=Phillips |contributor-first10=Aaron |contributor-last10=Reynolds |contributor-link10=Aaron R. Reynolds |contributor-first11=Betty |contributor-last11=Stillmaker |contributor-first12=Mark |contributor-last12=Zbikowski |contributor-link12=Mark Zbikowski |date=1986 |edition=Original withdrawn |publisher=[[Microsoft Press]] |series=Microsoft Reference Library |volume=1 |___location=Redmond, Washington, USA |isbn=0-914845-69-1 |lccn=86-8640 |oclc=635600205}} (xvii+1053 pages; 29&nbsp;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. [https://web.archive.org/web/20190715050434/https://blogs.msdn.microsoft.com/larryosterman/2004/06/14/does-anyone-remember-the-original-ms-dos-encyclopedia/])
* [http://www.ctyme.com/intr/cat-010.htm ctyme.com - INT Calls by function]
* {{Cite book |title=The MS-DOS Encyclopedia: versions 1.0 through 3.2 |author-first1=Ray |author-last1=Duncan |author-first2=Steve |author-last2=Bostwick |author-first3=Keith |author-last3=Burgoyne |author-first4=Robert A. |author-last4=Byers |author-first5=Thom |author-last5=Hogan |author-first6=Jim |author-last6=Kyle |author-first7=Gordon |author-last7=Letwin |author-link7=Gordon Letwin |author-first8=Charles |author-last8=Petzold |author-link8=Charles Petzold |author-first9=Chip |author-last9=Rabinowitz |author-first10=Jim |author-last10=Tomlin |author-first11=Richard |author-last11=Wilton |author-first12=Van |author-last12=Wolverton |author-first13=William |author-last13=Wong |author-first14=JoAnne |author-last14=Woodcock |contribution=Technical advisors |contributor-first1=Mark |contributor-last1=Zbikowski |contributor-link1=Mark Zbikowski |contributor-first2=Paul |contributor-last2=Allen |contributor-link2=Paul Allen |contributor-first3=Steve |contributor-last3=Ballmer |contributor-link3=Steve Ballmer |contributor-first4=Reuben |contributor-last4=Borman |contributor-first5=Rob |contributor-last5=Borman |contributor-first6=John |contributor-last6=Butler |contributor-first7=Chuck |contributor-last7=Carroll |contributor-first8=Mark |contributor-last8=Chamberlain |contributor-first9=David |contributor-last9=Chell |contributor-first10=Mike |contributor-last10=Colee |contributor-first11=Mike |contributor-last11=Courtney |contributor-first12=Mike |contributor-last12=Dryfoos |contributor-first13=Rachel |contributor-last13=Duncan |contributor-first14=Kurt |contributor-last14=Eckhardt |contributor-first15=Eric |contributor-last15=Evans |contributor-first16=Rick |contributor-last16=Farmer |contributor-first17=Bill |contributor-last17=Gates |contributor-link17=Bill Gates |contributor-first18=Michael |contributor-last18=Geary |contributor-first19=Bob |contributor-last19=Griffin |contributor-first20=Doug |contributor-last20=Hogarth |contributor-first21=James W. |contributor-last21=Johnson |contributor-first22=Kaamel |contributor-last22=Kermaani |contributor-first23=Adrian |contributor-last23=King |contributor-first24=Reed |contributor-last24=Koch |contributor-first25=James |contributor-last25=Landowski |contributor-first26=Chris |contributor-last26=Larson |contributor-first27=Thomas |contributor-last27=Lennon |contributor-first28=Dan |contributor-last28=Lipkie |contributor-first29=Marc |contributor-last29=McDonald |contributor-link29=Marc McDonald |contributor-first30=Bruce |contributor-last30=McKinney |contributor-first31=Pascal |contributor-last31=Martin |contributor-first32=Estelle |contributor-last32=Mathers |contributor-first33=Bob |contributor-last33=Matthews <!-- |contributor-link33=Robert Matthews (scientist)??? --> |contributor-first34=David |contributor-last34=Melin |contributor-first35=Charles |contributor-last35=Mergentime |contributor-first36=Randy |contributor-last36=Nevin |contributor-first37=Dan |contributor-last37=Newell |contributor-first38=Tani |contributor-last38=Newell |contributor-first39=David |contributor-last39=Norris |contributor-first40=Mike |contributor-last40=O'Leary |contributor-first41=Bob |contributor-last41=O'Rear |contributor-link41=Bob O'Rear |contributor-first42=Mike |contributor-last42=Olsson |contributor-first43=Larry |contributor-last43=Osterman |contributor-first44=Ridge |contributor-last44=Ostling |contributor-first45=Sunil |contributor-last45=Pai |contributor-first46=Tim |contributor-last46=Paterson |contributor-link46=Tim Paterson |contributor-first47=Gary |contributor-last47=Perez |contributor-first48=Chris |contributor-last48=Peters |contributor-first49=Charles |contributor-last49=Petzold |contributor-link49=Charles Petzold |contributor-first50=John |contributor-last50=Pollock |contributor-first51=Aaron |contributor-last51=Reynolds |contributor-link51=Aaron R. Reynolds |contributor-first52=Darryl |contributor-last52=Rubin |contributor-first53=Ralph |contributor-last53=Ryan |contributor-first54=Karl |contributor-last54=Schulmeisters |contributor-first55=Rajen |contributor-last55=Shah |contributor-first56=Barry |contributor-last56=Shaw |contributor-first57=Anthony |contributor-last57=Short |contributor-first58=Ben |contributor-last58=Slivka |contributor-first59=Jon |contributor-last59=Smirl |contributor-first60=Betty |contributor-last60=Stillmaker |contributor-first61=John |contributor-last61=Stoddard |contributor-first62=Dennis |contributor-last62=Tillman |contributor-first63=Greg |contributor-last63=Whitten |contributor-first64=Natalie |contributor-last64=Yount |contributor-first65=Steve |contributor-last65=Zeck |date=1988 |edition=Completely reworked |publisher=[[Microsoft Press]] |___location=Redmond, Washington, USA |isbn=1-55615-049-0 |lccn=87-21452 |oclc=16581341}} (xix+1570 pages; 26&nbsp;cm) (NB. This edition was published in 1988 after extensive rework of the withdrawn 1986 first edition by a different team of authors. [https://www.pcjs.org/pubs/pc/reference/microsoft/mspl13/msdos/encyclopedia/])
* [https://web.archive.org/web/20020622163518/http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html wustl.edu - Description of MS-DOS services]
* ''{{Cite book |title=The New Peter Norton Programmer's Guide to the IBM PC & PS/2'' by |first1=Peter |last1=Norton and|authorlink1=Peter Norton|first2=Richard |last2=Wilton, |publisher=Microsoft Press, |year=1987 {{|ISBN|=1-55615-131-4}}.
* ''Microsoft MS-DOS Programmer's Reference - The Official Technical Reference to MS-DOS'', Microsoft Press, 1993 {{ISBN|1556155468}}
* {{cite book |title=Advanced MS-DOS Programming: The Microsoft Guide for Assembly Language and C Programmers |author=Ray Duncan |publisher=Microsoft Press |year=1988 |isbn=0914845772 |url-access=registration |url=https://archive.org/details/advancedmsdosmic00dunc }}
* ''The MS-DOS Encyclopedia'', Microsoft Press, 1988, {{ISBN|1556151748}}
* {{citeCite book |title=Advanced MS-DOS Programming: The MicrosoftProgrammer's GuidePC forSourcebook Assembly Language and C Programmers|first=Thom |authorlast=Ray DuncanHogan |publisher=Microsoft Press |year=19881991 |isbnISBN=0914845772 155615321X}}
* ''The{{Cite book |title=MS-DOS Programmer's PCReference Sourcebook''- byThe ThomOfficial Hogan,Technical Reference to MS-DOS |publisher=Microsoft Press, 1991|year=1993 {{|ISBN|155615321X=1556155468}}
* ''The New Peter Norton Programmer's Guide to the IBM PC & PS/2'' by Peter Norton and Richard Wilton, Microsoft Press, 1987 {{ISBN|1-55615-131-4}}.
* [https://web.archive.org/web/20060721115437/http://www.redbooks.ibm.com/redbooks/pdfs/gg244459.pdf IBM PC DOS 7 Technical Update]
* {{cite book |publisher=[[Caldera, Inc.]] |date=August (1997). ''|title=OpenDOS Developer's Reference Series &mdash; OpenDOS Programmer's Guide &mdash; System and Programmer's Guide''. Printed in the UK, August 1997. |id=Caldera Part No. 200-DOPG-003 ([|url=http://www.drdos.net/documentation/sysprog/httoc.htm]) |url-status=dead |archive-url=https://web.archive.org/web/20171007025631/http://www.drdos.net/documentation/sysprog/httoc.htm |archive-date=2017-10-07 |access-date=2012-06-28 }} (Printed in the UK.)
 
{{refend}}
==External links==
* [httphttps://www.cs.cmu.edu/~ralf/files.html The x86 Interrupt List] (a.k.a. RBIL, [[Ralf Brown's Interrupt List]])
* [https://web.archive.org/web/20171103080100/http://www.ctyme.com/intr/cat-010.htm ctyme.com - INT Calls by function]<!-- http://www.delorie.com/djgpp/doc/rbinter/ -->
* [https://web.archive.org/web/20020622163518/http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html wustl.edu - Description of MS-DOS services]
* [http://spike.scu.edu.au/~barry/interrupts.html MS-DOS Interrupts] {{Webarchive|url=https://web.archive.org/web/20111013235614/http://spike.scu.edu.au/~barry/interrupts.html |date=2011-10-13 }}
{{Disk operating systems}}
 
[[Category:DOS technology]]