1 | ; File name : AH4h_HVerify.asm |
---|
2 | ; Project name : IDE BIOS |
---|
3 | ; Created date : 13.10.2007 |
---|
4 | ; Last update : 13.4.2010 |
---|
5 | ; Author : Tomi Tilli |
---|
6 | ; Description : Int 13h function AH=4h, Verify Disk Sectors. |
---|
7 | |
---|
8 | ; Section containing code |
---|
9 | SECTION .text |
---|
10 | |
---|
11 | ;-------------------------------------------------------------------- |
---|
12 | ; Int 13h function AH=4h, Verify Disk Sectors. |
---|
13 | ; |
---|
14 | ; AH4h_HandlerForVerifyDiskSectors |
---|
15 | ; Parameters: |
---|
16 | ; AH: Bios function 4h |
---|
17 | ; AL: Number of sectors to verify |
---|
18 | ; CH: Cylinder number, bits 7...0 |
---|
19 | ; CL: Bits 7...6: Cylinder number bits 9 and 8 |
---|
20 | ; Bits 5...0: Starting sector number (1...63) |
---|
21 | ; DH: Starting head number (0...255) |
---|
22 | ; DL: Drive number |
---|
23 | ; ES:BX: Pointer to source data (not used) |
---|
24 | ; Parameters loaded by Int13h_Jump: |
---|
25 | ; DS: RAMVARS segment |
---|
26 | ; Returns: |
---|
27 | ; AH: Int 13h/40h floppy return status |
---|
28 | ; CF: 0 if successfull, 1 if error |
---|
29 | ; IF: 1 |
---|
30 | ; Corrupts registers: |
---|
31 | ; Flags |
---|
32 | ;-------------------------------------------------------------------- |
---|
33 | ALIGN JUMP_ALIGN |
---|
34 | AH4h_HandlerForVerifyDiskSectors: |
---|
35 | test al, al ; Invalid sector count? |
---|
36 | jz SHORT AH2h_ZeroCntErr ; If so, return with error |
---|
37 | push dx |
---|
38 | push cx |
---|
39 | push bx |
---|
40 | push ax |
---|
41 | call AH4h_VerifySectors |
---|
42 | jmp Int13h_PopXRegsAndReturn |
---|
43 | |
---|
44 | |
---|
45 | ;-------------------------------------------------------------------- |
---|
46 | ; Verifies hard disk sectors. |
---|
47 | ; |
---|
48 | ; AH4h_VerifySectors |
---|
49 | ; Parameters: |
---|
50 | ; AL: Number of sectors to verify |
---|
51 | ; CH: Cylinder number, bits 7...0 |
---|
52 | ; CL: Bits 7...6: Cylinder number bits 9 and 8 |
---|
53 | ; Bits 5...0: Starting sector number (1...63) |
---|
54 | ; DH: Starting head number (0...255) |
---|
55 | ; DL: Drive number |
---|
56 | ; DS: RAMVARS segment |
---|
57 | ; Returns: |
---|
58 | ; DS:DI: Ptr to DPT |
---|
59 | ; AH: Int 13h/40h floppy return status |
---|
60 | ; CF: 0 if successfull, 1 if error |
---|
61 | ; Corrupts registers: |
---|
62 | ; AL, BX, CX, DX |
---|
63 | ;-------------------------------------------------------------------- |
---|
64 | ALIGN JUMP_ALIGN |
---|
65 | AH4h_VerifySectors: |
---|
66 | call FindDPT_ForDriveNumber ; DS:DI now points to DPT |
---|
67 | mov ah, HCMD_VERIFY_SECT ; Load command to AH |
---|
68 | call HCommand_OutputCountAndLCHSandCommand |
---|
69 | jc SHORT .Return ; Return if error |
---|
70 | mov bx, di ; DS:BX now points to DPT |
---|
71 | jmp HStatus_WaitIrqOrRdy ; Wait for IRQ or RDY |
---|
72 | .Return: |
---|
73 | ret |
---|