Changeset 505 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h
- Timestamp:
- Feb 25, 2013, 4:23:09 PM (12 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r492 r505 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 ; GNU General Public License for more details. 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 19 19 20 20 ; Section containing code … … 22 22 23 23 ;-------------------------------------------------------------------- 24 ; BootSector_TryToLoadFromDriveDL 24 ; BootSector_TryToLoadFromDriveDL_AndBoot 25 25 ; Parameters: 26 26 ; DL: Drive to boot from (translated, 00h or 80h) … … 36 36 call DetectPrint_TryToBootFromDL 37 37 call LoadFirstSectorFromDriveDL 38 %ifndef USE_386 38 39 jc SHORT .FailedToLoadFirstSector 40 %else 41 jc DetectPrint_FailedToLoadFirstSector 42 %endif 39 43 40 44 test dl, dl … … 44 48 .AlwaysBootFromFloppyDriveForBooterGames: 45 49 stc 46 jmp SHORT JumpToBootSector_or_RomBoot 50 jmp SHORT JumpToBootSector_or_RomBoot 51 52 %ifndef USE_386 47 53 .FailedToLoadFirstSector: 48 call DetectPrint_FailedToLoadFirstSector 49 ret 54 jmp DetectPrint_FailedToLoadFirstSector 55 %endif 56 50 57 .FirstHardDiskSectorNotBootable: 51 58 mov si, g_szBootSectorNotFound 52 call DetectPrint_NullTerminatedStringFromCSSIandSetCF 53 ret 59 jmp DetectPrint_NullTerminatedStringFromCSSIandSetCF 54 60 55 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 61 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 56 62 %ifdef MODULE_DRIVEXLATE 57 63 %if TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot … … 79 85 80 86 .ReadRetryLoop: 81 call .LoadFirstSectorFromDLtoESBX 82 jnc SHORT .Return 87 mov ax, 0201h ; Read 1 sector 88 mov cx, 1 ; Cylinder 0, Sector 1 89 xor dh, dh ; Head 0 90 int BIOS_DISK_INTERRUPT_13h 91 jc SHORT .FailedToLoadFirstSector 92 .Return: 93 ret 94 95 .FailedToLoadFirstSector: 83 96 dec di ; Decrement retry counter (preserve CF) 84 97 jz SHORT .Return ; Loop while retries left 85 98 86 99 ; Reset drive and retry 87 xor ax, ax ; AH=0 h, Disk Controller Reset100 xor ax, ax ; AH=00h, Disk Controller Reset 88 101 test dl, dl ; Floppy drive? 89 eCMOVS ah, RESET_HARD_DISK ; AH= Dh, Reset Hard Disk (Alternate reset)102 eCMOVS ah, RESET_HARD_DISK ; AH=0Dh, Reset Hard Disk (Alternate reset) 90 103 int BIOS_DISK_INTERRUPT_13h 91 104 jmp SHORT .ReadRetryLoop 92 105 93 94 ;--------------------------------------------------------------------95 ; .LoadFirstSectorFromDLtoESBX96 ; Parameters:97 ; DL: Drive to boot from (translated, 00h or 80h)98 ; ES:BX: Destination buffer for boot sector99 ; Returns:100 ; AH: INT 13h error code101 ; ES:BX: Ptr to boot sector102 ; CF: Cleared if read successful103 ; Set if any error104 ; Corrupts registers:105 ; AL, CX, DH106 ;--------------------------------------------------------------------107 .LoadFirstSectorFromDLtoESBX:108 mov ax, 0201h ; Read 1 sector109 mov cx, 1 ; Cylinder 0, Sector 1110 xor dh, dh ; Head 0111 int BIOS_DISK_INTERRUPT_13h112 .Return:113 ret
Note:
See TracChangeset
for help on using the changeset viewer.