Subversion Repositories Kolibri OS

Rev

Rev 4700 | Rev 4839 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4700 Rev 4720
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2013. 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: 4700 $
8
$Revision: 4720 $
9
 
9
 
10
 
10
 
Line 112... Line 112...
112
.sectors_loop:
112
.sectors_loop:
113
; DMA read is permitted if [allow_dma_access]=1 or 2
113
; DMA read is permitted if [allow_dma_access]=1 or 2
114
        cmp     [allow_dma_access], 2
114
        cmp     [allow_dma_access], 2
115
        ja      .nodma
115
        ja      .nodma
Line -... Line 116...
-
 
116
 
-
 
117
        push    eax ecx
-
 
118
        mov     ecx, [hdpos]
-
 
119
        dec     ecx
-
 
120
        shr     ecx, 2
-
 
121
        imul    ecx, sizeof.IDE_DATA
-
 
122
        add     ecx, IDE_controller_1
-
 
123
        mov     [IDE_controller_pointer], ecx
-
 
124
 
-
 
125
        mov     eax, [hdpos]
-
 
126
        dec     eax
-
 
127
        and     eax, 11b
-
 
128
        shr     eax, 1
116
 
129
        add     eax, ecx
-
 
130
        cmp     [eax+IDE_DATA.dma_hdd_channel_1], 1
117
        cmp     [ecx+IDE_DATA.dma_hdd], 1
131
        pop     ecx eax
Line 118... Line 132...
118
        jnz     .nodma
132
        jnz     .nodma
119
 
133
 
120
        call    hd_read_dma
134
        call    hd_read_dma
Line 217... Line 231...
217
        mov     [cache_chain_size], cl
231
        mov     [cache_chain_size], cl
218
; DMA write is permitted only if [allow_dma_access]=1
232
; DMA write is permitted only if [allow_dma_access]=1
219
        cmp     [allow_dma_access], 2
233
        cmp     [allow_dma_access], 2
220
        jae     .nodma
234
        jae     .nodma
Line -... Line 235...
-
 
235
 
-
 
236
        push    eax ecx
-
 
237
        mov     ecx, [hdpos]
-
 
238
        dec     ecx
-
 
239
        shr     ecx, 2
-
 
240
        imul    ecx, sizeof.IDE_DATA
-
 
241
        add     ecx, IDE_controller_1
-
 
242
        mov     [IDE_controller_pointer], ecx
-
 
243
 
-
 
244
        mov     eax, [hdpos]
-
 
245
        dec     eax
-
 
246
        and     eax, 11b
-
 
247
        shr     eax, 1
221
 
248
        add     eax, ecx
-
 
249
        cmp     [eax+IDE_DATA.dma_hdd_channel_1], 1
222
        cmp     [ecx+IDE_DATA.dma_hdd], 1
250
        pop     ecx eax
Line 223... Line 251...
223
        jnz     .nodma
251
        jnz     .nodma
224
 
252
 
225
        call    cache_write_dma
253
        call    cache_write_dma
Line 844... Line 872...
844
        mov     eax, IDE_descriptor_table
872
        mov     eax, IDE_descriptor_table
845
        mov     dword [eax], IDE_DMA
873
        mov     dword [eax], IDE_DMA
846
        mov     word [eax+4], 0x2000
874
        mov     word [eax+4], 0x2000
847
        sub     eax, OS_BASE
875
        sub     eax, OS_BASE
848
; select controller Primary or Secondary
876
; select controller Primary or Secondary
849
;       mov     ecx,[IDE_controller_pointer]
877
        mov     ecx, [IDE_controller_pointer]
850
        mov     ecx, [hdpos]
-
 
851
        dec     ecx
-
 
852
        shr     ecx, 2
-
 
853
        imul    ecx, sizeof.IDE_DATA
-
 
854
        add     ecx, IDE_controller_1
-
 
855
        mov     [IDE_controller_pointer], ecx
-
 
856
        mov     dx, [ecx+IDE_DATA.RegsBaseAddres]
878
        mov     dx, [ecx+IDE_DATA.RegsBaseAddres]
Line 857... Line 879...
857
 
879
 
858
        push    eax
880
        push    eax
859
        mov     eax, [hdpos]
881
        mov     eax, [hdpos]
Line 1037... Line 1059...
1037
        rep movsd
1059
        rep movsd
1038
        popa
1060
        popa
Line 1039... Line 1061...
1039
 
1061
 
1040
        sub     eax, OS_BASE
1062
        sub     eax, OS_BASE
1041
; select controller Primary or Secondary
1063
; select controller Primary or Secondary
1042
;       mov     ecx,[IDE_controller_pointer]
-
 
1043
        mov     ecx, [hdpos]
-
 
1044
        dec     ecx
-
 
1045
        shr     ecx, 2
-
 
1046
        imul    ecx, sizeof.IDE_DATA
-
 
1047
        add     ecx, IDE_controller_1
-
 
1048
        mov     [IDE_controller_pointer], ecx
1064
        mov     ecx, [IDE_controller_pointer]
Line 1049... Line 1065...
1049
        mov     dx, [ecx+IDE_DATA.RegsBaseAddres]
1065
        mov     dx, [ecx+IDE_DATA.RegsBaseAddres]
1050
 
1066
 
1051
        push    eax
1067
        push    eax
Line 1217... Line 1233...
1217
.loop:
1233
.loop:
1218
        mov     esi, [esi+PCIDEV.fd]
1234
        mov     esi, [esi+PCIDEV.fd]
1219
        cmp     esi, pcidev_list
1235
        cmp     esi, pcidev_list
1220
        jz      .done
1236
        jz      .done
Line 1221... Line 1237...
1221
 
1237
 
-
 
1238
;        cmp     [esi+PCIDEV.class], 0x01018F
-
 
1239
        mov     eax, [esi+PCIDEV.class]
-
 
1240
        shr     eax, 4
1222
        cmp     [esi+PCIDEV.class], 0x01018F
1241
        cmp     eax, 0x01018
Line 1223... Line 1242...
1223
        jnz     .loop
1242
        jnz     .loop
1224
 
1243
 
1225
        mov     ah, [esi+PCIDEV.bus]
1244
        mov     ah, [esi+PCIDEV.bus]