Changeset 593 in xtideuniversalbios for trunk/Assembly_Library/Src/File
- Timestamp:
- Jun 30, 2018, 8:27:04 AM (6 years ago)
- Location:
- trunk/Assembly_Library/Src/File
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/File/DosCritical.asm
r592 r593 45 45 push ds 46 46 47 push cs 48 pop ds 49 mov ax, (SET_INTERRUPT_VECTOR<<8) | DOS_CRITICAL_ERROR_HANDLER_24h 50 int DOS_INTERRUPT_21h 47 mov al, DOS_CRITICAL_ERROR_HANDLER_24h 48 call HookInterruptVectorInALwithHandlerInCSDX 51 49 52 50 pop ds -
trunk/Assembly_Library/Src/File/Drive.asm
r592 r593 131 131 .IsValidDriveNumberInDL: 132 132 push ds 133 push ax 134 cmp dl, 1 135 jbe SHORT .FloppyDrive 136 137 .MessageSuppressedByInt2FhHandler: 138 .MoreThanOneFloppyDrive: 139 .NoFloppyDrive: 133 140 push bx 134 push ax135 141 136 142 inc dx ; Default drive is 00h and first drive is 01h … … 152 158 test al, al 153 159 160 pop bx 161 .ReturnFromFloppyDriveFiltering: 154 162 pop ax 155 pop bx156 163 pop ds 157 164 ret 165 166 .FloppyDrive: 167 ; On single-floppy-drive systems, both A: and B: will point to the same physical drive. The problem is that DOS will print a message telling the user 168 ; to "insert a disk and press any key to continue" when swapping from one logical drive to the other. To avoid this mess we hook interrupt 2Fh/AX=4A00h 169 ; to signal to DOS that we will handle this ourselves. However, this only works on DOS 5+ so on older DOS versions we instead try to filter out 170 ; the "other" logical drive (the one that isn't the current drive) during drive enumeration so the user can't select the "phantom" drive to begin with. 171 ; This will have the somewhat strange effect of having a drive B: but no drive A: if B: happens to be the current logical floppy drive. 172 173 cmp BYTE [bDosVersionMajor], 5 ; bDosVersionMajor must be provided by the application as it's not part of the library 174 jae SHORT .MessageSuppressedByInt2FhHandler 175 LOAD_BDA_SEGMENT_TO ds, ax 176 mov al, [BDA.wEquipment] 177 test al, 0C0h 178 jnz SHORT .MoreThanOneFloppyDrive ; No phantom drive so no need for any filtering 179 test al, 1 ; Any floppy drive at all? 180 jz SHORT .NoFloppyDrive ; A pre-DOS 5 machine with no FDD is indeed a strange beast. However, don't trust the BIOS - let DOS decide 181 cmp dl, [504h] ; MS-DOS - LOGICAL DRIVE FOR SINGLE-FLOPPY SYSTEM (A: / B:) 182 jmp SHORT .ReturnFromFloppyDriveFiltering 158 183 159 184 ;--------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.