Subversion Repositories Kolibri OS

Rev

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

Rev 580 Rev 581
Line 1... Line 1...
1
$Revision: 580 $
1
$Revision: 581 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 468... Line 468...
468
 
468
 
469
iglobal
469
iglobal
470
align 4
470
align 4
471
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
471
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
472
IDE_descriptor_table:
472
IDE_descriptor_table:
473
        dd      0x284000
473
        dd      IDE_DMA
474
        dw      0x2000
474
        dw      0x2000
Line 475... Line 475...
475
        dw      0x8000
475
        dw      0x8000
476
 
476
 
Line 562... Line 562...
562
        cmp     [esp+4], edx
562
        cmp     [esp+4], edx
563
        ja      .notread
563
        ja      .notread
564
        mov     eax, [esp+4]
564
        mov     eax, [esp+4]
565
        sub     eax, [dma_cur_sector]
565
        sub     eax, [dma_cur_sector]
566
        shl     eax, 9
566
        shl     eax, 9
567
        add     eax, OS_BASE+0x284000
567
        add     eax, (OS_BASE+IDE_DMA)
568
        push    ecx esi edi
568
        push    ecx esi edi
569
        mov     esi, eax
569
        mov     esi, eax
570
        shl     edi, 9
570
        shl     edi, 9
571
;        add     edi, HD_CACHE+0x10000
571
;        add     edi, HD_CACHE+0x10000
572
        push  eax
572
        push  eax
Line 581... Line 581...
581
        pop     edx
581
        pop     edx
582
        pop     eax
582
        pop     eax
583
        ret
583
        ret
584
.notread:
584
.notread:
585
        mov     eax, IDE_descriptor_table
585
        mov     eax, IDE_descriptor_table
586
        mov     dword [eax],  0x284000
586
        mov     dword [eax],  IDE_DMA
587
        mov     word [eax+4], 0x2000
587
        mov     word [eax+4], 0x2000
588
        sub     eax, OS_BASE
588
        sub     eax, OS_BASE
589
        mov     dx, [IDEContrRegsBaseAddr]
589
        mov     dx, [IDEContrRegsBaseAddr]
590
        cmp     [hdbase], 0x1F0
590
        cmp     [hdbase], 0x1F0
591
        jz      @f
591
        jz      @f
Line 673... Line 673...
673
        pusha
673
        pusha
674
        mov     esi,[cache_chain_pos]
674
        mov     esi,[cache_chain_pos]
675
        shl     esi, 9
675
        shl     esi, 9
676
        call    calculate_cache_2
676
        call    calculate_cache_2
677
        add     esi,eax
677
        add     esi,eax
678
        mov     edi,OS_BASE+0x284000   ;HD_CACHE
678
        mov     edi, (OS_BASE+IDE_DMA)
679
        mov     dword [edx], 0x284000  ;DMA_HD_MEM
679
        mov     dword [edx], IDE_DMA
680
        movzx   ecx, [cache_chain_size]
680
        movzx   ecx, [cache_chain_size]
681
        shl     ecx, 9
681
        shl     ecx, 9
682
        mov     word [edx+4], cx
682
        mov     word [edx+4], cx
683
        shr     ecx,2
683
        shr     ecx,2
684
        cld
684
        cld