Rev 5984 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5984 | Rev 6078 | ||
---|---|---|---|
Line 176... | Line 176... | ||
176 | dec edx |
176 | dec edx |
177 | cmp eax, edx |
177 | cmp eax, edx |
178 | ja .notread |
178 | ja .notread |
179 | sub eax, [bios_cur_sector] |
179 | sub eax, [bios_cur_sector] |
180 | shl eax, 9 |
180 | shl eax, 9 |
181 | add eax, (OS_BASE+0x9A000) |
181 | add eax, (OS_BASE+0x99000) |
182 | push ecx esi |
182 | push ecx esi |
183 | mov esi, eax |
183 | mov esi, eax |
184 | mov ecx, 512/4 |
184 | mov ecx, 512/4 |
185 | cld |
185 | cld |
186 | rep movsd |
186 | rep movsd |
Line 205... | Line 205... | ||
205 | pop eax |
205 | pop eax |
206 | mov [bios_cur_sector], eax |
206 | mov [bios_cur_sector], eax |
207 | jmp bd_read |
207 | jmp bd_read |
208 | .readerr: |
208 | .readerr: |
209 | .v86err: |
209 | .v86err: |
- | 210 | pop edx |
|
- | 211 | pop eax |
|
210 | mov [hd_error], 1 |
212 | mov [hd_error], 1 |
211 | jmp hd_read_error |
213 | jmp hd_read_error |
212 | ;----------------------------------------------------------------- |
214 | ;----------------------------------------------------------------- |
213 | bd_write_cache_chain: |
215 | bd_write_cache_chain: |
214 | pusha |
216 | pusha |
215 | mov edi, OS_BASE + 0x9A000 |
217 | mov edi, OS_BASE + 0x99000 |
216 | movzx ecx, [cache_chain_size] |
218 | movzx ecx, [cache_chain_size] |
217 | push ecx |
219 | push ecx |
218 | shl ecx, 9-2 |
220 | shl ecx, 9-2 |
219 | rep movsd |
221 | rep movsd |
220 | pop ecx |
222 | pop ecx |
Line 238... | Line 240... | ||
238 | ; Because this code uses fixed addresses, |
240 | ; Because this code uses fixed addresses, |
239 | ; it can not be run simultaniously by many threads. |
241 | ; it can not be run simultaniously by many threads. |
240 | ; In current implementation it is protected by common mutex 'ide_status' |
242 | ; In current implementation it is protected by common mutex 'ide_status' |
241 | mov word [OS_BASE + 510h], 10h ; packet length |
243 | mov word [OS_BASE + 510h], 10h ; packet length |
242 | mov word [OS_BASE + 512h], cx ; number of sectors |
244 | mov word [OS_BASE + 512h], cx ; number of sectors |
243 | mov dword [OS_BASE + 514h], 9A000000h ; buffer 9A00:0000 |
245 | mov dword [OS_BASE + 514h], 99000000h ; buffer 9900:0000 |
244 | mov dword [OS_BASE + 518h], eax |
246 | mov dword [OS_BASE + 518h], eax |
245 | and dword [OS_BASE + 51Ch], 0 |
247 | and dword [OS_BASE + 51Ch], 0 |
246 | push ebx ecx esi edi |
248 | push ebx ecx esi edi |
247 | mov ebx, int13_regs_in |
249 | mov ebx, int13_regs_in |
248 | mov edi, ebx |
250 | mov edi, ebx |
Line 265... | Line 267... | ||
265 | stdcall enable_irq, edx |
267 | stdcall enable_irq, edx |
266 | popad |
268 | popad |
267 | @@: |
269 | @@: |
268 | mov word [ebx+v86_regs.esi], 510h |
270 | mov word [ebx+v86_regs.esi], 510h |
269 | mov word [ebx+v86_regs.ss], 9000h |
271 | mov word [ebx+v86_regs.ss], 9000h |
270 | mov word [ebx+v86_regs.esp], 0A000h |
272 | mov word [ebx+v86_regs.esp], 09000h |
271 | mov word [ebx+v86_regs.eip], 500h |
273 | mov word [ebx+v86_regs.eip], 500h |
272 | mov [ebx+v86_regs.eflags], 20200h |
274 | mov [ebx+v86_regs.eflags], 20200h |
273 | mov esi, [sys_v86_machine] |
275 | mov esi, [sys_v86_machine] |
274 | mov ecx, 0x502 |
276 | mov ecx, 0x502 |
275 | push fs |
277 | push fs |