Rev 6014 | Rev 6843 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6014 | Rev 6016 | ||
---|---|---|---|
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: 6014 $ |
8 | $Revision: 6016 $ |
9 | 9 | ||
10 | ; Disk access through BIOS |
10 | ; Disk access through BIOS |
11 | iglobal |
11 | iglobal |
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 212... | Line 212... | ||
212 | mov [hd_error], 1 |
212 | mov [hd_error], 1 |
213 | jmp hd_read_error |
213 | jmp hd_read_error |
214 | ;----------------------------------------------------------------- |
214 | ;----------------------------------------------------------------- |
215 | bd_write_cache_chain: |
215 | bd_write_cache_chain: |
216 | pusha |
216 | pusha |
217 | mov edi, OS_BASE + 0x9A000 |
217 | mov edi, OS_BASE + 0x99000 |
218 | movzx ecx, [cache_chain_size] |
218 | movzx ecx, [cache_chain_size] |
219 | push ecx |
219 | push ecx |
220 | shl ecx, 9-2 |
220 | shl ecx, 9-2 |
221 | rep movsd |
221 | rep movsd |
222 | pop ecx |
222 | pop ecx |
Line 240... | Line 240... | ||
240 | ; Because this code uses fixed addresses, |
240 | ; Because this code uses fixed addresses, |
241 | ; it can not be run simultaniously by many threads. |
241 | ; it can not be run simultaniously by many threads. |
242 | ; In current implementation it is protected by common mutex 'ide_status' |
242 | ; In current implementation it is protected by common mutex 'ide_status' |
243 | mov word [OS_BASE + 510h], 10h ; packet length |
243 | mov word [OS_BASE + 510h], 10h ; packet length |
244 | mov word [OS_BASE + 512h], cx ; number of sectors |
244 | mov word [OS_BASE + 512h], cx ; number of sectors |
245 | mov dword [OS_BASE + 514h], 9A000000h ; buffer 9A00:0000 |
245 | mov dword [OS_BASE + 514h], 99000000h ; buffer 9900:0000 |
246 | mov dword [OS_BASE + 518h], eax |
246 | mov dword [OS_BASE + 518h], eax |
247 | and dword [OS_BASE + 51Ch], 0 |
247 | and dword [OS_BASE + 51Ch], 0 |
248 | push ebx ecx esi edi |
248 | push ebx ecx esi edi |
249 | mov ebx, int13_regs_in |
249 | mov ebx, int13_regs_in |
250 | mov edi, ebx |
250 | mov edi, ebx |
Line 267... | Line 267... | ||
267 | stdcall enable_irq, edx |
267 | stdcall enable_irq, edx |
268 | popad |
268 | popad |
269 | @@: |
269 | @@: |
270 | mov word [ebx+v86_regs.esi], 510h |
270 | mov word [ebx+v86_regs.esi], 510h |
271 | mov word [ebx+v86_regs.ss], 9000h |
271 | mov word [ebx+v86_regs.ss], 9000h |
272 | mov word [ebx+v86_regs.esp], 0A000h |
272 | mov word [ebx+v86_regs.esp], 09000h |
273 | mov word [ebx+v86_regs.eip], 500h |
273 | mov word [ebx+v86_regs.eip], 500h |
274 | mov [ebx+v86_regs.eflags], 20200h |
274 | mov [ebx+v86_regs.eflags], 20200h |
275 | mov esi, [sys_v86_machine] |
275 | mov esi, [sys_v86_machine] |
276 | mov ecx, 0x502 |
276 | mov ecx, 0x502 |
277 | push fs |
277 | push fs |