Rev 1635 | Rev 2434 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1635 | Rev 2010 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. 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: 1448 $ |
8 | $Revision: 2010 $ |
9 | 9 | ||
10 | 10 | ||
Line 47... | Line 47... | ||
47 | cmp [hd_error],0 |
47 | cmp [hd_error],0 |
48 | jne return_01 |
48 | jne return_01 |
49 | ; Read through BIOS? |
49 | ; Read through BIOS? |
50 | cmp [hdpos], 0x80 |
50 | cmp [hdpos], 0x80 |
51 | jae .bios |
51 | jae .bios |
- | 52 | ; hd_read_{dma,pio} use old ATA with 28 bit for sector number |
|
- | 53 | cmp eax, 0x10000000 |
|
- | 54 | jb @f |
|
- | 55 | inc [hd_error] |
|
- | 56 | jmp return_01 |
|
- | 57 | @@: |
|
52 | ; DMA read is permitted if [allow_dma_access]=1 or 2 |
58 | ; DMA read is permitted if [allow_dma_access]=1 or 2 |
53 | cmp [allow_dma_access], 2 |
59 | cmp [allow_dma_access], 2 |
54 | ja .nodma |
60 | ja .nodma |
55 | cmp [dma_hdd], 1 |
61 | cmp [dma_hdd], 1 |
56 | jnz .nodma |
62 | jnz .nodma |
Line 233... | Line 239... | ||
233 | pop edi esi ecx |
239 | pop edi esi ecx |
234 | ret |
240 | ret |
Line 235... | Line 241... | ||
235 | 241 | ||
236 | align 4 |
242 | align 4 |
- | 243 | cache_write_pio: |
|
- | 244 | cmp dword[esi],0x10000000 |
|
237 | cache_write_pio: |
245 | jae .bad |
Line 238... | Line 246... | ||
238 | ; call disable_ide_int |
246 | ; call disable_ide_int |
239 | 247 | ||
240 | call wait_for_hd_idle |
248 | call wait_for_hd_idle |
Line 293... | Line 301... | ||
293 | 301 | ||
294 | ; call enable_ide_int |
302 | ; call enable_ide_int |
Line 295... | Line 303... | ||
295 | pop esi ecx |
303 | pop esi ecx |
- | 304 | ||
- | 305 | ret |
|
- | 306 | .bad: |
|
Line 296... | Line 307... | ||
296 | 307 | inc [hd_error] |
|
Line 297... | Line 308... | ||
297 | ret |
308 | ret |
298 | 309 | ||
Line 684... | Line 695... | ||
684 | mov [cache_chain_size],1 |
695 | mov [cache_chain_size],1 |
685 | mov [cache_chain_pos],edi |
696 | mov [cache_chain_pos],edi |
686 | write_cache_chain: |
697 | write_cache_chain: |
687 | cmp [hdpos], 0x80 |
698 | cmp [hdpos], 0x80 |
688 | jae bd_write_cache_chain |
699 | jae bd_write_cache_chain |
- | 700 | mov eax,[cache_chain_ptr] |
|
- | 701 | cmp dword[eax],0x10000000 |
|
- | 702 | jae .bad |
|
689 | push esi |
703 | push esi |
690 | mov eax, IDE_descriptor_table |
704 | mov eax, IDE_descriptor_table |
691 | mov edx,eax |
705 | mov edx,eax |
692 | pusha |
706 | pusha |
693 | mov esi,[cache_chain_pos] |
707 | mov esi,[cache_chain_pos] |
Line 777... | Line 791... | ||
777 | @@: |
791 | @@: |
778 | cmp [hd_error], 0 |
792 | cmp [hd_error], 0 |
779 | jnz hd_write_error_dma |
793 | jnz hd_write_error_dma |
780 | pop esi |
794 | pop esi |
781 | ret |
795 | ret |
- | 796 | .bad: |
|
- | 797 | inc [hd_error] |
|
- | 798 | ret |
|
Line 782... | Line 799... | ||
782 | 799 | ||
783 | uglobal |
800 | uglobal |
784 | IDEContrRegsBaseAddr dw ? |
801 | IDEContrRegsBaseAddr dw ? |
785 | endg |
802 | endg |
Line 914... | Line 931... | ||
914 | mov word [ebx+v86_regs.esp], 0A000h |
931 | mov word [ebx+v86_regs.esp], 0A000h |
915 | mov word [ebx+v86_regs.eip], 500h |
932 | mov word [ebx+v86_regs.eip], 500h |
916 | mov [ebx+v86_regs.eflags], 20200h |
933 | mov [ebx+v86_regs.eflags], 20200h |
917 | mov esi, [sys_v86_machine] |
934 | mov esi, [sys_v86_machine] |
918 | mov ecx, 0x502 |
935 | mov ecx, 0x502 |
- | 936 | push fs |
|
919 | call v86_start |
937 | call v86_start |
- | 938 | pop fs |
|
920 | and [bios_hdpos], 0 |
939 | and [bios_hdpos], 0 |
921 | pop edi esi ecx ebx |
940 | pop edi esi ecx ebx |
922 | movzx edx, byte [OS_BASE + 512h] |
941 | movzx edx, byte [OS_BASE + 512h] |
923 | test byte [int13_regs_out+v86_regs.eflags], 1 |
942 | test byte [int13_regs_out+v86_regs.eflags], 1 |
924 | jnz @f |
943 | jnz @f |