Changeset 630 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
- Timestamp:
- Dec 31, 2024, 3:38:24 PM (8 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r597 r630 4 4 ; 5 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-20 13by XTIDE Universal BIOS Team.6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team. 7 7 ; 8 8 ; This program is free software; you can redistribute it and/or modify … … 28 28 ; Returns: 29 29 ; ES:BX: Ptr to boot sector (if successful) 30 ; CF: Set if boot sector loaded successfully 31 ; Cleared if failed to load boot sector 30 ; CF: Cleared if boot sector loaded successfully 31 ; (only matters when jumping to 32 ; Int19h_JumpToBootSectorInESBXOrRomBoot) 32 33 ; Corrupts registers: 33 ; AX, CX, DH, SI, DI , (DL if failed to read boot sector)34 ; AX, CX, DH, SI, DI 34 35 ;-------------------------------------------------------------------- 35 36 BootSector_TryToLoadFromDriveDL_AndBoot: 36 37 call DetectPrint_TryToBootFromDL 37 38 call BootSector_LoadFirstSectorFromDriveDL 39 inc dx ; Determine if hard drive or floppy drive without changing the CF 40 dec dl 38 41 jnc SHORT .FirstSectorLoadedToESBX 39 42 … … 42 45 ; display error code every time user intends to boot from hard disk 43 46 ; when A then C boot order is used. 44 test dl, dl 45 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 47 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 46 48 cmp ah, RET_HD_TIMEOUT 47 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector49 je SHORT BootSector_LoadFirstSectorFromDriveDL.Return 48 50 cmp ah, RET_HD_NOMEDIA 49 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector51 je SHORT BootSector_LoadFirstSectorFromDriveDL.Return 50 52 .PrintFailedToLoadErrorCode: 51 call DetectPrint_FailedToLoadFirstSector 52 jmp SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 53 53 jmp DetectPrint_FailedToLoadFirstSector 54 54 55 55 .FirstSectorLoadedToESBX: 56 test dl, dl 57 jns SHORT .AlwaysBootFromFloppyDriveForBooterGames 58 cmp WORD [es:bx+510], 0AA55h ; Valid boot sector? 59 jne SHORT .FirstHardDiskSectorNotBootable 60 .AlwaysBootFromFloppyDriveForBooterGames: 61 clc ; Boot Sector loaded successfully 62 jmp SHORT Int19h_JumpToBootSectorInESBXOrRomBoot 63 64 .FirstHardDiskSectorNotBootable: 56 jns SHORT Int19h_JumpToBootSectorInESBXOrRomBoot ; Don't check for boot sector signature for floppy booter games 57 cmp WORD [es:bx+510], 0AA55h ; Valid boot sector? 58 je SHORT Int19h_JumpToBootSectorInESBXOrRomBoot ; With CF cleared 65 59 mov si, g_szBootSectorNotFound 66 call DetectPrint_NullTerminatedStringFromCSSI 67 .ReturnWithCFclearSinceFailedToLoadBootSector: 68 clc 69 ret 60 jmp DetectPrint_NullTerminatedStringFromCSSI 70 61 71 62
Note:
See TracChangeset
for help on using the changeset viewer.