source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm @ 617

Last change on this file since 617 was 617, checked in by aitotat, 3 years ago
  • Verify functions did not return correctly the number of succesfully verified sectors. That should be now fixed except for serial device. Serial device do not have error handling implemented yet.
File size: 2.5 KB
Line 
1; Project name  :   XTIDE Universal BIOS
2; Description   :   Int 13h function AH=44h, Extended Verify Sectors.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20; Section containing code
21SECTION .text
22
23;--------------------------------------------------------------------
24; Int 13h function AH=44h, Extended Verify Sectors.
25;
26; AH44h_HandlerForExtendedVerifySectors
27;   Parameters:
28;       SI:     Same as in INTPACK
29;       DL:     Translated Drive number
30;       DS:DI:  Ptr to DPT (in RAMVARS segment)
31;       SS:BP:  Ptr to IDEPACK
32;   Parameters on INTPACK:
33;       DS:SI:  Ptr to Disk Address Packet
34;   Returns with INTPACK:
35;       AH:     Int 13h return status
36;       CF:     0 if successful, 1 if error
37;   Return with Disk Address Packet in INTPACK:
38;       .wSectorCount   Number of sectors verified successfully
39;--------------------------------------------------------------------
40ALIGN JUMP_ALIGN
41AH44h_HandlerForExtendedVerifySectors:
42    call    Prepare_ByLoadingDapToESSIandVerifyingForTransfer
43    push    WORD [es:si+DAP.wSectorCount]               ; Store for successfull number of sectors transferred
44    mov     ah, [cs:bx+g_rgbVerifyCommandLookup]
45    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
46    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
47
48    ; Now we need number of succesfully verifed sectors to CX. Since we did not transfer anything,
49    ; we did not have any sector counter like in read and write functions.
50    ; In case of error, drive LBA registers are set to address where the error occurred. We must
51    ; calculate number of succesfully transferred sectors from it.
52    pop     cx
53    jnc     SHORT .AllSectorsVerifiedSuccessfully
54
55; TODO: For now we assume serial device do not produce verify errors
56    call    AH4h_CalculateNumberOfSuccessfullyVerifiedSectors
57
58ALIGN JUMP_ALIGN
59.AllSectorsVerifiedSuccessfully:
60    jmp     SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
Note: See TracBrowser for help on using the repository browser.