Subversion Repositories Kolibri OS

Rev

Rev 6016 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6016 Rev 6843
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 6016 $
8
$Revision: 6843 $
9
 
9
 
10
; Disk access through BIOS
10
; Disk access through BIOS
11
iglobal
11
iglobal
Line 29... Line 29...
29
cache_chain_ptr     dd ?
29
cache_chain_ptr     dd ?
30
int13_regs_in       rb sizeof.v86_regs
30
int13_regs_in       rb sizeof.v86_regs
31
int13_regs_out      rb sizeof.v86_regs
31
int13_regs_out      rb sizeof.v86_regs
32
cache_chain_size    db ?
32
cache_chain_size    db ?
33
endg
33
endg
-
 
34
 
-
 
35
struct BiosDiskData
-
 
36
        DriveNumber     db ?
-
 
37
        IRQ             db ?
-
 
38
        ATADEVbit       dw ?
-
 
39
        SectorSize      dd ?
-
 
40
        Capacity        dq ?
-
 
41
ends
34
;-----------------------------------------------------------------
42
;-----------------------------------------------------------------
35
proc bd_read_interface stdcall uses edi, \
43
proc bd_read_interface stdcall uses edi, \
36
        userdata, buffer, startsector:qword, numsectors
44
        userdata, buffer, startsector:qword, numsectors
37
        ; userdata = old [hdpos] = 80h + index in NumBiosDisks
45
        ; userdata = old [hdpos] = 80h + index in NumBiosDisks
38
        ; buffer = pointer to buffer for data
46
        ; buffer = pointer to buffer for data
Line 150... Line 158...
150
        call    mutex_unlock
158
        call    mutex_unlock
151
        xor     eax, eax
159
        xor     eax, eax
152
        ret
160
        ret
153
endp
161
endp
154
;-----------------------------------------------------------------
162
;-----------------------------------------------------------------
155
; This is a stub.
-
 
156
proc bd_querymedia stdcall, hd_data, mediainfo
163
proc bd_querymedia stdcall, hd_data, mediainfo
157
        mov     eax, [mediainfo]
164
        mov     edx, [mediainfo]
-
 
165
        mov     eax, [hd_data]
-
 
166
        lea     eax, [(eax-80h)*4]
-
 
167
        lea     eax, [BiosDisksData+eax*4]
158
        mov     [eax+DISKMEDIAINFO.Flags], 0
168
        mov     [edx+DISKMEDIAINFO.Flags], 0
-
 
169
        mov     ecx, [eax+BiosDiskData.SectorSize]
159
        mov     [eax+DISKMEDIAINFO.SectorSize], 512
170
        mov     [edx+DISKMEDIAINFO.SectorSize], ecx
-
 
171
        mov     ecx, dword [eax+BiosDiskData.Capacity+0]
-
 
172
        mov     eax, dword [eax+BiosDiskData.Capacity+4]
160
        or      dword [eax+DISKMEDIAINFO.Capacity], 0xFFFFFFFF
173
        mov     dword [edx+DISKMEDIAINFO.Capacity+0], ecx
161
        or      dword [eax+DISKMEDIAINFO.Capacity+4], 0xFFFFFFFF
174
        mov     dword [edx+DISKMEDIAINFO.Capacity+4], eax
162
        xor     eax, eax
175
        xor     eax, eax
163
        ret
176
        ret
164
endp
177
endp
165
;-----------------------------------------------------------------
178
;-----------------------------------------------------------------
166
bd_read:
179
bd_read:
Line 251... Line 264...
251
        mov     ecx, sizeof.v86_regs/4
264
        mov     ecx, sizeof.v86_regs/4
252
        xor     eax, eax
265
        xor     eax, eax
253
        rep stosd
266
        rep stosd
254
        mov     byte [ebx+v86_regs.eax+1], dl
267
        mov     byte [ebx+v86_regs.eax+1], dl
255
        mov     eax, [hdpos]
268
        mov     eax, [hdpos]
-
 
269
        lea     eax, [(eax-80h)*4]
256
        lea     eax, [BiosDisksData+(eax-80h)*4]
270
        lea     eax, [BiosDisksData+eax*4]
257
        mov     dl, [eax]
271
        mov     dl, [eax]
258
        mov     byte [ebx+v86_regs.edx], dl
272
        mov     byte [ebx+v86_regs.edx], dl
259
        movzx   edx, byte [eax+1]
273
        movzx   edx, byte [eax+1]
260
;        mov     dl, 5
274
;        mov     dl, 5
261
        test    edx, edx
275
        test    edx, edx