Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

DOS API

From Wikipedia, the free encyclopedia
API of the MS-DOS operating system
This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(May 2015) (Learn how and when to remove this message)

TheDOS API is anAPI which originated with86-DOS and is used inMS-DOS/PC DOS and otherDOS-compatible operating systems. Most calls to the DOS API are invoked usingsoftware interrupt 21h (INT 21h). By calling INT 21h with a subfunction number in the AHprocessor 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 theDOS 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

[edit]

The original DOS API in 86-DOS and MS-DOS 1.0 was designed to be functionally compatible withCP/M. Files were accessed usingfile control blocks (FCBs). The DOS API was greatly extended in MS-DOS 2.0 with severalUnix concepts, including file access usingfile 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 usingupper memory blocks (UMBs). After MS-DOS 5, the DOS API was unchanged for the successive standalone releases of DOS.

The DOS API and Windows

[edit]

InWindows 9x, DOS loaded the protected-mode system and graphical shell. DOS was usually accessed from avirtual DOS machine (VDM) but it was also possible to boot directly to real modeMS-DOS 7.0 without loading Windows. The DOS API was extended with enhanced internationalization support andlong filename support, though the long filename support was only available in a VDM. WithWindows 95 OSR2, DOS was updated to 7.1, which addedFAT32 support, and functions were added to the DOS API to support this.Windows 98 andWindows 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 andWindows Vista) are not based on MS-DOS, but use avirtual machine,NTVDM, to handle the DOS API. NTVDM works by running a DOS program invirtual 8086 mode (an emulation ofreal mode withinprotected mode available on80386 and higher processors). NTVDM supports the DOS 5.0 API.DOSEMU forLinux uses a similar approach.

Interrupt vectors used by DOS

[edit]

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

Interrupt vectorDescriptionVersionNotes
20hTerminate program1.0+Implemented in DOS kernel
21hMain DOS API1.0+Implemented in DOS kernel
22hProgram terminate address1.0+Return address in calling program
23hControl-C handler address1.0+Default handler is in the command shell (usually COMMAND.COM)
24hCritical error handler address1.0+Default handler is in the command shell (usually COMMAND.COM)
25hAbsolute disk read1.0+Implemented in DOS kernel, enhanced in DOS 3.31 to support up to 2 GB partitions
26hAbsolute disk write1.0+Implemented in DOS kernel, enhanced in DOS 3.31 to support up to 2 GB partitions
27hTerminate and stay resident1.0+Implemented in COMMAND.COM in DOS 1.0, DOS kernel in DOS 2.0+
28hIdle callout2.0+Called by DOS kernel when waiting for input
29hFast console output2.0+Implemented by the built-in console device driver or a replacement driver like ANSI.SYS
2AhNetworking and critical section3.0+Called by DOS kernel to interface with networking software
2BhUnused
2ChUnused
2DhUnused
2EhReload transient2.0+Implemented in COMMAND.COM
2FhMultiplex3.0+Implemented in DOS kernel and various programs (PRINT, MSCDEX, DOSKEY, APPEND, etc.) depending on subfunction number

DOS INT 21h services

[edit]

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

AHDescriptionVersion
00hProgram terminate1.0+
01hCharacter input1.0+
02hCharacter output1.0+
03hAuxiliary input1.0+
04hAuxiliary output1.0+
05hPrinter output1.0+
06hDirect console I/O1.0+
07hDirect console input without echo1.0+
08hConsole input without echo1.0+
09hDisplay string1.0+
0AhBuffered keyboard input1.0+
0BhGet input status1.0+
0ChFlush input buffer and input1.0+
0DhDisk reset1.0+
0EhSet default drive1.0+
0FhOpen file1.0+
10hClose file1.0+
11hFind first file1.0+
12hFind next file1.0+
13hDelete file1.0+
14hSequential read1.0+
15hSequential write1.0+
16hCreate or truncate file1.0+
17hRename file1.0+
18hReserved1.0+
19hGet default drive1.0+
1AhSet disk transfer address1.0+
1BhGet allocation info for default drive1.0+
1ChGet allocation info for specified drive1.0+
1DhReserved1.0+
1EhReserved1.0+
1FhGet disk parameter block for default drive1.0+
20hReserved1.0+
21hRandom read1.0+
22hRandom write1.0+
23hGet file size in records1.0+
24hSet random record number1.0+
25hSet interrupt vector1.0+
26hCreate PSP1.0+
27hRandom block read1.0+
28hRandom block write1.0+
29hParse filename1.0+
2AhGet date1.0+
2BhSet date1.0+
2ChGet time1.0+
2DhSet time1.0+
2EhSet verify flag1.0+
2FhGet disk transfer address2.0+
30hGet DOS version2.0+
31hTerminate and stay resident2.0+
32hGet disk parameter block for specified drive2.0+
33hGet or set Ctrl-Break2.0+
34hGet InDOS flag pointer2.0+
35hGet interrupt vector2.0+
36hGet free disk space2.0+
37hGet or set switch character2.0+
38hGet or set country info2.0+
39hCreate subdirectory2.0+
3AhRemove subdirectory2.0+
3BhChange current directory2.0+
3ChCreate or truncate file2.0+
3DhOpen file2.0+
3EhClose file2.0+
3FhRead file or device2.0+
40hWrite file or device2.0+
41hDelete file2.0+
42hMove file pointer2.0+
43hGet or set file attributes2.0+
44hI/O control for devices2.0+
45hDuplicate handle2.0+
46hRedirect handle2.0+
47hGet current directory2.0+
48hAllocate memory2.0+
49hRelease memory2.0+
4AhReallocate memory2.0+
4BhExecute program2.0+
4ChTerminate with return code2.0+
4DhGet program return code2.0+
4EhFind first file2.0+
4FhFind next file2.0+
50hSet current PSP2.0+
51hGet current PSP2.0+
52hGet DOS internal pointers (SYSVARS)2.0+
53hCreate disk parameter block2.0+
54hGet verify flag2.0+
55hCreate program PSP2.0+
56hRename file2.0+
57hGet or set file date and time2.0+
58hGet or set allocation strategy2.11+
59hGet extended error info3.0+
5AhCreate unique file3.0+
5BhCreate new file3.0+
5ChLock or unlock file3.0+
5DhFile sharing functions3.0+
5EhNetwork functions3.0+
5FhNetwork redirection functions3.0+
60hQualify filename3.0+
61hReserved3.0+
62hGet current PSP3.0+
63hGet DBCS lead byte table pointer3.0+
64hSet wait for external event flag3.2+
65hGet extended country info3.3+
66hGet or set code page3.3+
67hSet handle count3.3+
68hCommit file3.3+
69hGet or set media id4.0+
6AhCommit file4.0+
6BhReserved4.0+
6ChExtended open/create file4.0+

Operating systems with native support

[edit]

Operating systems with DOS emulation layer

[edit]

Other emulators

[edit]

See also

[edit]

References

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

Further reading

[edit]

External links

[edit]
MS-DOS, IBM PC DOS,
compatible systems
Otherx86
Other platforms
Retrieved from "https://en.wikipedia.org/w/index.php?title=DOS_API&oldid=1320546092"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp