source: xtideuniversalbios/trunk/Assembly_Library/Inc/DosFunctions.inc @ 592

Last change on this file since 592 was 592, checked in by krille_n_, 6 years ago

Changes:

  • The problem with NASM in the previous revision (r591) has been fixed.
  • The colors used by the boot menu and hotkey bar can now be customized by selecting one of a number of pre-defined color themes. Suggestions for additional themes are more than welcome!
  • Large builds are now 10 KB. Small builds are still 8 KB with the exception of the Tiny build which is now 4 KB. In other words, builds are now as small as possible to make it easier to combine them with other BIOSes.
  • Added code to the library to improve drive error handling. XTIDECFG can now handle "Drive Not Ready" errors.
  • Fixed a couple of potential bugs in AtaID.asm (AtaID_GetMaxPioModeToAXandMinCycleTimeToCX); 1) ATA1.bPioMode was treated as a WORD variable. 2) ATA2.bPIOSupp was assumed to be non-zero which would result in PIO mode 3 being returned if the assumption was wrong.
  • Made the same changes in the equivalent function used by BIOSDRVS (DisplayPioModeInformationUsingAtaInfoFromDSBX in AtaInfo.asm).
  • Fixed a bug from r587 in PDC20x30.asm in PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX.
  • Fixed a bug from r523 in XTIDECFG where Auto Configure would only set the IRQ on one IDE interface on AT-builds.
  • XTIDECFG will now restore the default settings for the "Serial port virtual device" when reselecting it in the list of device types. This makes it behave consistently for all device types.
  • The eAAM macro is now used regardless if USE_UNDOC_INTEL is defined or not because it is apparently supported on all processors including the NEC V20/V30 CPUs.
  • Renamed the EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS define to EXCLUDE_FROM_XUB.
  • Added a define to exclude unused library code from BIOSDRVS (EXCLUDE_FROM_BIOSDRVS). This makes it a lot smaller than in previous revisions.
  • All unnecessary CLD-instructions are now under a new define 'CLD_NEEDED' which is only enabled for the BIOS. It is disabled for XTIDECFG and BIOSDRVS but can be enabled if needed by adding this define to the respective makefile. This change was made because these unnecessary instructions are wasteful and should never be needed. In fact, they only serve to hide bugs (in other peoples code) which I strongly believe should be avoided. I recommend people making their own BIOSes from source to not use this define as it's extremely unlikely to be needed.
  • Updated the copyright info in SerDrive and changed an URL to point to the new site.
  • Updated the copyright info and version number in BIOSDRVS.
  • Updated the copyright info in XTIDECFG.
  • Optimizations in general.
File size: 2.6 KB
Line 
1; Project name  :   AssemblyLibrary
2; Description   :   Defines for MS-DOS functions.
3%ifndef DOS_FUNCTIONS_INC
4%define DOS_FUNCTIONS_INC
5
6; DOS interrupts
7DOS_INTERRUPT_21h                                   EQU     21h
8DOS_CTRL_C_CTRL_BREAK_HANDLER_23h                   EQU     23h
9DOS_CRITICAL_ERROR_HANDLER_24h                      EQU     24h
10DOS_TSR_MULTIPLEX_INTERRUPT_2Fh                     EQU     2Fh
11
12; DOS functions
13WRITE_CHARACTER_TO_STANDARD_OUTPUT                  EQU     02h     ; DOS 1+
14WRITE_STRING_TO_STANDARD_OUTPUT                     EQU     09h     ; DOS 1+
15SELECT_DEFAULT_DRIVE                                EQU     0Eh     ; DOS 1+
16GET_CURRENT_DEFAULT_DRIVE                           EQU     19h     ; DOS 1+
17SET_INTERRUPT_VECTOR                                EQU     25h     ; DOS 1+
18GET_DISK_TRANSFER_AREA_ADDRESS                      EQU     2Fh     ; DOS 2+
19GET_DOS_VERSION                                     EQU     30h     ; DOS 2+
20GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE    EQU     32h     ; DOS 2+
21GET_INTERRUPT_VECTOR                                EQU     35h     ; DOS 2+
22SET_CURRENT_DIRECTORY                               EQU     3Bh     ; DOS 2+
23CREATE_OR_TRUNCATE_FILE                             EQU     3Ch     ; DOS 2+
24OPEN_EXISTING_FILE                                  EQU     3Dh     ; DOS 2+
25CLOSE_FILE                                          EQU     3Eh     ; DOS 2+
26READ_FROM_FILE_OR_DEVICE                            EQU     3Fh     ; DOS 2+
27WRITE_TO_FILE_OR_DEVICE                             EQU     40h     ; DOS 2+
28SET_CURRENT_FILE_POSITION                           EQU     42h     ; DOS 2+
29CHECK_IF_BLOCK_DEVICE_REMOTE                        EQU     4409h   ; DOS 3.1+
30GET_CURRENT_DIRECTORY                               EQU     47h     ; DOS 2+
31TERMINATE_WITH_RETURN_CODE                          EQU     4Ch     ; DOS 2+
32FIND_FIRST_MATCHING_FILE                            EQU     4Eh     ; DOS 2+
33FIND_NEXT_MATCHING_FILE                             EQU     4Fh     ; DOS 2+
34GET_EXTENDED_ERROR_INFORMATION                      EQU     59h     ; DOS 3.0+
35
36; DOS errors
37ERR_DOS_FUNCTION_NUMBER_INVALID                     EQU     01h
38ERR_DOS_INVALID_DRIVE                               EQU     0Fh
39ERR_DOS_DRIVE_NOT_READY                             EQU     15h
40
41
42; DOS Program Segment Prefix (PSP, first 256 (100h) bytes on top of program)
43struc PSP
44    .int20hInstruction              resb    2
45    .wSizeOfMemoryInParagraphs      resb    2
46    .reservedAt4h                   resb    1
47    .callToDosFunctionDispatcher    resb    5
48    .fpInt22hTerminate              resb    4
49    .fpInt23hCtrlC                  resb    4
50    .fpInt24hCriticalError          resb    4
51    .reservedAt16h                  resb    22
52    .wEnvironmentSegment            resb    2
53    .reservedAt2Eh                  resb    34
54    .int21hAndRetfInstructions      resb    3
55    .reservedAt53h                  resb    9
56    .FCB1                           resb    16
57    .FCB2                           resb    20
58    .DiskTransferArea:
59    .bCommandLineLength             resb    1
60    .szCommandLine                  resb    127
61endstruc
62
63
64; DOS DTA (Disk Transfer Area)
65struc DTA
66    ; Undocumented fields
67    .reservedAt0h       resb    21
68    ; Documented fields
69    .bFileAttributes    resb    1   ; 15h, Attribute of matching file
70    .wFileTime          resb    2   ; 16h, File time
71    .wFileDate          resb    2   ; 18h, File date
72    .dwFileSize         resb    4   ; 1Ah, File size in bytes
73    .szFile             resb    13  ; 1Eh, ASCIZ filename + extension
74endstruc
75
76
77%endif ; DOS_FUNCTIONS_INC
Note: See TracBrowser for help on using the repository browser.