Subversion Repositories Kolibri OS

Rev

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

Rev 431 Rev 465
Line 1... Line 1...
1
$Revision: 431 $
1
$Revision: 465 $
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 398... Line 398...
398
    ret
398
    ret
Line 399... Line 399...
399
 
399
 
Line 400... Line 400...
400
save_hd_wait_timeout:
400
save_hd_wait_timeout:
401
 
401
 
402
    push  eax
402
    push  eax
403
    mov   eax,[timer_ticks];[0xfdf0]
403
    mov   eax,[timer_ticks]
404
    add   eax,300               ; 3 sec timeout
404
    add   eax,300               ; 3 sec timeout
405
    mov   [hd_wait_timeout],eax
405
    mov   [hd_wait_timeout],eax
Line 406... Line 406...
406
    pop   eax
406
    pop   eax
407
    ret
407
    ret
Line 408... Line 408...
408
 
408
 
409
align 4
409
align 4
410
check_hd_wait_timeout:
410
check_hd_wait_timeout:
411
 
411
 
412
    push  eax
412
    push  eax
413
    mov   eax,[hd_wait_timeout]
413
    mov   eax,[hd_wait_timeout]
414
    cmp   [timer_ticks], eax ;[0xfdf0],eax
414
    cmp   [timer_ticks], eax
Line 429... Line 429...
429
;    call  clear_hd_cache
429
;    call  clear_hd_cache
430
;    call  clear_application_table_status
430
;    call  clear_application_table_status
431
;    mov   esi,hd_timeout_str
431
;    mov   esi,hd_timeout_str
432
;    call  sys_msg_board_str
432
;    call  sys_msg_board_str
433
    DEBUGF 1,"K : FS - HD timeout\n"
433
    DEBUGF 1,"K : FS - HD timeout\n"
434
;    jmp   $
434
 
435
    mov   [hd_error],1
435
    mov   [hd_error],1
436
    pop   eax
436
    pop   eax
437
    ret
437
    ret
Line 438... Line 438...
438
 
438
 
Line 580... Line 580...
580
 
580
 
581
iglobal
581
iglobal
582
align 4
582
align 4
583
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
583
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
584
IDE_descriptor_table:
584
IDE_descriptor_table:
585
        dd      OS_BASE+284000h
585
        dd      0x284000
586
        dw      2000h
586
        dw      0x2000
Line 587... Line 587...
587
        dw      8000h
587
        dw      0x8000
588
 
588
 
589
dma_cur_sector  dd      not 40h
589
dma_cur_sector  dd      not 40h
590
irq14_func      dd      hdd_irq_null
590
irq14_func      dd      hdd_irq_null
Line 611... Line 611...
611
        pushad
611
        pushad
612
        mov     [irq14_func], hdd_irq_null
612
        mov     [irq14_func], hdd_irq_null
613
        mov     dx, [IDEContrRegsBaseAddr]
613
        mov     dx, [IDEContrRegsBaseAddr]
614
        mov     al, 0
614
        mov     al, 0
615
        out     dx, al
615
        out     dx, al
616
        call    update_counters
616
;        call    update_counters
617
        mov     ebx, [dma_process]
617
;        mov     ebx, [dma_process]
618
        cmp     [CURRENT_TASK], ebx
618
;        cmp     [CURRENT_TASK], ebx
619
        jz      .noswitch
619
;        jz      .noswitch
620
        mov     [dma_task_switched], 1
620
;        mov     [dma_task_switched], 1
621
        mov     edi, [dma_slot_ptr]
621
;        mov     edi, [dma_slot_ptr]
622
        mov     eax, [CURRENT_TASK]
622
;        mov     eax, [CURRENT_TASK]
623
        mov     [dma_process], eax
623
;        mov     [dma_process], eax
624
        mov     eax, [TASK_BASE]
624
;        mov     eax, [TASK_BASE]
625
        mov     [dma_slot_ptr], eax
625
;        mov     [dma_slot_ptr], eax
626
        mov     [CURRENT_TASK], ebx
626
;        mov     [CURRENT_TASK], ebx
627
        mov     [TASK_BASE], edi
627
;        mov     [TASK_BASE], edi
628
        mov     byte [0xFFFF], 1
628
;        mov     byte [DONT_SWITCH], 1
629
        call    do_change_task
629
;        call    do_change_task
630
.noswitch:
630
.noswitch:
631
        popad
631
        popad
632
        popfd
632
        popfd
633
align 4
633
align 4
634
hdd_irq_null:
634
hdd_irq_null:
Line 642... Line 642...
642
        mov     [irq15_func], hdd_irq_null
642
        mov     [irq15_func], hdd_irq_null
643
        mov     dx, [IDEContrRegsBaseAddr]
643
        mov     dx, [IDEContrRegsBaseAddr]
644
        add     dx, 8
644
        add     dx, 8
645
        mov     al, 0
645
        mov     al, 0
646
        out     dx, al
646
        out     dx, al
647
        call    update_counters
647
;        call    update_counters
648
        mov     ebx, [dma_process]
648
;        mov     ebx, [dma_process]
649
        cmp     [CURRENT_TASK], ebx
649
;        cmp     [CURRENT_TASK], ebx
650
        jz      .noswitch
650
;        jz      .noswitch
651
        mov     [dma_task_switched], 1
651
;        mov     [dma_task_switched], 1
652
        mov     edi, [dma_slot_ptr]
652
;        mov     edi, [dma_slot_ptr]
653
        mov     eax, [CURRENT_TASK]
653
;        mov     eax, [CURRENT_TASK]
654
        mov     [dma_process], eax
654
;        mov     [dma_process], eax
655
        mov     eax, [TASK_BASE]
655
;        mov     eax, [TASK_BASE]
656
        mov     [dma_slot_ptr], eax
656
;        mov     [dma_slot_ptr], eax
657
        mov     [CURRENT_TASK], ebx
657
;        mov     [CURRENT_TASK], ebx
658
        mov     [TASK_BASE], edi
658
;        mov     [TASK_BASE], edi
659
        mov     byte [0xFFFF], 1
659
;        mov     byte [DONT_SWITCH], 1
660
        call    do_change_task
660
;        call    do_change_task
661
.noswitch:
661
.noswitch:
662
        popad
662
        popad
663
        popfd
663
        popfd
664
        ret
664
        ret
Line 687... Line 687...
687
        pop     edi esi ecx
687
        pop     edi esi ecx
688
        pop     edx
688
        pop     edx
689
        pop     eax
689
        pop     eax
690
        ret
690
        ret
691
.notread:
691
.notread:
692
        mov     eax, IDE_descriptor_table-OS_BASE
692
        mov     eax, IDE_descriptor_table
693
        mov     dword [eax+OS_BASE],  0x284000
693
        mov     dword [eax],  0x284000
694
        mov     word [eax+4+OS_BASE], 0x2000
694
        mov     word [eax+4], 0x2000
-
 
695
        sub     eax, OS_BASE
695
        mov     dx, [IDEContrRegsBaseAddr]
696
        mov     dx, [IDEContrRegsBaseAddr]
696
        cmp     [hdbase], 0x1F0
697
        cmp     [hdbase], 0x1F0
697
        jz      @f
698
        jz      @f
698
        add     edx, 8
699
        add     edx, 8
699
@@:
700
@@:
Line 772... Line 773...
772
write_cache_chain:
773
write_cache_chain:
773
        push    esi
774
        push    esi
774
        mov     eax, IDE_descriptor_table
775
        mov     eax, IDE_descriptor_table
775
        mov     edx, [cache_chain_pos]
776
        mov     edx, [cache_chain_pos]
776
        shl     edx, 9
777
        shl     edx, 9
777
        add     edx, OS_BASE+0x610000
778
        add     edx, 0x610000
778
        mov     [eax], edx
779
        mov     [eax], edx
779
        movzx   edx, [cache_chain_size]
780
        movzx   edx, [cache_chain_size]
780
        shl     edx, 9
781
        shl     edx, 9
781
        mov     [eax+4], dx
782
        mov     [eax+4], dx
782
        jmp     do_write_dma
783
        jmp     do_write_dma
783
write_cache_sector:
784
write_cache_sector:
784
        push    esi
785
        push    esi
785
        mov     eax, IDE_descriptor_table
786
        mov     eax, IDE_descriptor_table
786
        mov     edx, edi
787
        mov     edx, edi
787
        shl     edx, 9
788
        shl     edx, 9
788
        add     edx, OS_BASE+0x610000
789
        add     edx, 0x610000
789
        mov     [eax], edx
790
        mov     [eax], edx
790
        mov     word [eax+4], 0x200
791
        mov     word [eax+4], 0x200
791
do_write_dma:
792
do_write_dma:
-
 
793
        sub     eax, OS_BASE
792
        mov     dx, [IDEContrRegsBaseAddr]
794
        mov     dx, [IDEContrRegsBaseAddr]
793
        cmp     [hdbase], 0x1F0
795
        cmp     [hdbase], 0x1F0
794
        jz      @f
796
        jz      @f
795
        add     edx, 8
797
        add     edx, 8
796
@@:
798
@@: