Rev 3712 | Rev 4711 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3712 | Rev 3742 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2011. 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: 3712 $ |
8 | $Revision: 3742 $ |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | pusha |
10 | pusha |
Line 35... | Line 35... | ||
35 | mov [cache_ide3_size], eax |
35 | mov [cache_ide3_size], eax |
36 | xor eax, eax |
36 | xor eax, eax |
37 | mov [hdd_appl_data], 1;al |
37 | mov [hdd_appl_data], 1;al |
38 | mov [cd_appl_data], 1 |
38 | mov [cd_appl_data], 1 |
Line 39... | Line 39... | ||
39 | 39 | ||
40 | mov ch, [DRIVE_DATA+1] |
- | |
41 | mov cl, ch |
- | |
42 | and cl, 11b |
40 | test byte [DRIVE_DATA+1], 2 |
43 | je .ide2 |
41 | je .ide2 |
44 | mov esi, cache_ide3 |
42 | mov esi, cache_ide3 |
45 | call get_cache_ide |
43 | call get_cache_ide |
46 | .ide2: |
- | |
47 | mov cl, ch |
44 | .ide2: |
48 | shr cl, 2 |
- | |
49 | and cl, 11b |
45 | test byte [DRIVE_DATA+1], 8 |
50 | je .ide1 |
46 | je .ide1 |
51 | mov esi, cache_ide2 |
47 | mov esi, cache_ide2 |
52 | call get_cache_ide |
48 | call get_cache_ide |
53 | .ide1: |
- | |
54 | mov cl, ch |
- | |
55 | shr cl, 4 |
49 | .ide1: |
56 | and cl, 11b |
50 | test byte [DRIVE_DATA+1], 0x20 |
57 | je .ide0 |
51 | je .ide0 |
58 | mov esi, cache_ide1 |
52 | mov esi, cache_ide1 |
59 | call get_cache_ide |
53 | call get_cache_ide |
60 | .ide0: |
- | |
61 | mov cl, ch |
- | |
62 | shr cl, 6 |
54 | .ide0: |
63 | and cl, 11b |
55 | test byte [DRIVE_DATA+1], 0x80 |
64 | je @f |
56 | je @f |
65 | mov esi, cache_ide0 |
57 | mov esi, cache_ide0 |
66 | call get_cache_ide |
58 | call get_cache_ide |
67 | @@: |
- | |
68 | xor ecx, ecx |
- | |
69 | cmp [NumBiosDisks], ecx |
- | |
70 | jz .endbd |
- | |
71 | mov esi, BiosDiskCaches |
- | |
72 | .loopbd: |
- | |
73 | push ecx |
- | |
74 | movsx ecx, byte [BiosDisksData+ecx*4+2] |
- | |
75 | inc ecx |
- | |
76 | jz .getbd |
- | |
77 | add ecx, ecx |
- | |
78 | movzx eax, byte [DRIVE_DATA+1] |
- | |
79 | shl eax, cl |
- | |
80 | and ah, 3 |
- | |
81 | cmp ah, 1 |
- | |
82 | jz .contbd |
- | |
83 | pop ecx |
- | |
84 | mov byte [BiosDisksData+ecx*4+2], -1 |
- | |
85 | push ecx |
- | |
86 | .getbd: |
- | |
87 | mov eax, [cache_ide0_size] |
- | |
88 | mov [esi+cache_ide0_size-cache_ide0], eax |
- | |
89 | mov cl, 1 |
- | |
90 | call get_cache_ide |
- | |
91 | .contbd: |
- | |
92 | pop ecx |
- | |
93 | add esi, cache_ide1-cache_ide0 |
- | |
94 | inc ecx |
- | |
95 | cmp ecx, [NumBiosDisks] |
- | |
96 | jb .loopbd |
- | |
97 | .endbd: |
59 | @@: |
Line 98... | Line 60... | ||
98 | jmp end_get_cache |
60 | jmp end_get_cache |
99 | 61 | ||
100 | get_cache_ide: |
62 | get_cache_ide: |
Line 112... | Line 74... | ||
112 | imul eax, 7 |
74 | imul eax, 7 |
113 | mov [esi+cache_ide0_appl_data_size-cache_ide0], eax |
75 | mov [esi+cache_ide0_appl_data_size-cache_ide0], eax |
114 | add ebx, edx |
76 | add ebx, edx |
115 | mov [esi+cache_ide0_data_pointer-cache_ide0], ebx |
77 | mov [esi+cache_ide0_data_pointer-cache_ide0], ebx |
Line 116... | Line -... | ||
116 | - | ||
117 | cmp cl, 10b |
- | |
118 | je .cd |
- | |
119 | push ecx |
- | |
120 | mov eax, [esi+cache_ide0_system_data_size-cache_ide0] |
- | |
121 | call calculate_for_hd |
- | |
122 | add eax, [esi+cache_ide0_pointer-cache_ide0] |
- | |
123 | mov [esi+cache_ide0_system_data-cache_ide0], eax |
- | |
124 | mov [esi+cache_ide0_system_sad_size-cache_ide0], ecx |
- | |
125 | - | ||
126 | push edi |
- | |
127 | mov edi, [esi+cache_ide0_pointer-cache_ide0] |
- | |
128 | call clear_ide_cache |
- | |
129 | pop edi |
- | |
130 | - | ||
131 | mov eax, [esi+cache_ide0_appl_data_size-cache_ide0] |
- | |
132 | call calculate_for_hd |
- | |
133 | add eax, [esi+cache_ide0_data_pointer-cache_ide0] |
- | |
134 | mov [esi+cache_ide0_appl_data-cache_ide0], eax |
- | |
135 | mov [esi+cache_ide0_appl_sad_size-cache_ide0], ecx |
- | |
136 | - | ||
137 | push edi |
- | |
138 | mov edi, [esi+cache_ide0_data_pointer-cache_ide0] |
- | |
139 | call clear_ide_cache |
- | |
140 | pop edi |
- | |
141 | - | ||
142 | pop ecx |
- | |
143 | ret |
78 | |
144 | .cd: |
79 | .cd: |
145 | push ecx |
80 | push ecx |
146 | mov eax, [esi+cache_ide0_system_data_size-cache_ide0] |
81 | mov eax, [esi+cache_ide0_system_data_size-cache_ide0] |
147 | call calculate_for_cd |
82 | call calculate_for_cd |
Line 166... | Line 101... | ||
166 | pop edi |
101 | pop edi |
Line 167... | Line 102... | ||
167 | 102 | ||
168 | pop ecx |
103 | pop ecx |
Line 169... | Line -... | ||
169 | ret |
- | |
170 | - | ||
171 | calculate_for_hd: |
- | |
172 | push eax |
- | |
173 | mov ebx, eax |
- | |
174 | shr eax, 9 |
- | |
175 | shl eax, 3 |
- | |
176 | sub ebx, eax |
- | |
177 | shr ebx, 9 |
- | |
178 | mov ecx, ebx |
- | |
179 | shl ebx, 9 |
- | |
180 | pop eax |
- | |
181 | sub eax, ebx |
- | |
182 | dec ecx |
- | |
183 | ret |
104 | ret |
184 | 105 | ||
185 | calculate_for_cd: |
106 | calculate_for_cd: |
186 | push eax |
107 | push eax |
187 | mov ebx, eax |
108 | mov ebx, eax |