Subversion Repositories Kolibri OS

Rev

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

Rev 256 Rev 321
Line 73... Line 73...
73
 
73
 
74
align 4
74
align 4
75
hd_read_pio:
75
hd_read_pio:
Line 76... Line -...
76
    push  eax edx
-
 
77
 
-
 
78
    call  disable_ide_int
76
    push  eax edx
79
 
77
 
80
    call  wait_for_hd_idle
78
    call  wait_for_hd_idle
Line 81... Line 79...
81
    cmp   [hd_error],0
79
    cmp   [hd_error],0
82
    jne   hd_read_error    
80
    jne   hd_read_error    
83
 
81
 
84
;    cli
82
    cli
85
    xor   eax,eax
83
    xor   eax,eax
86
    mov   edx,[hdbase]
84
    mov   edx,[hdbase]
Line 105... Line 103...
105
    add   al,128+64+32
103
    add   al,128+64+32
106
    out   dx,al   ; ­®¬¥à £®«®¢ª¨/­®¬¥à ¤¨áª 
104
    out   dx,al   ; ­®¬¥à £®«®¢ª¨/­®¬¥à ¤¨áª 
107
    inc   edx
105
    inc   edx
108
    mov   al,20h
106
    mov   al,20h
109
    out   dx,al   ; ATACommand ॣ¨áâà ª®¬ ­¤
107
    out   dx,al   ; ATACommand ॣ¨áâà ª®¬ ­¤
110
;    sti
108
    sti
Line 111... Line 109...
111
 
109
 
Line 112... Line 110...
112
    call  wait_for_sector_buffer
110
    call  wait_for_sector_buffer
113
 
111
 
Line 114... Line 112...
114
    cmp   [hd_error],0
112
    cmp   [hd_error],0
115
    jne   hd_read_error
113
    jne   hd_read_error
116
 
114
 
117
;    cli
115
    cli
118
    push  edi
116
    push  edi
119
    shl   edi,9
117
    shl   edi,9
120
    add   edi,0x600000+65536
118
    add   edi,0x600000+65536
121
    mov   ecx,256
119
    mov   ecx,256
122
    mov   edx,[hdbase]
120
    mov   edx,[hdbase]
123
    cld
121
    cld
124
    rep   insw
-
 
125
    pop   edi
-
 
Line 126... Line 122...
126
;    sti
122
    rep   insw
127
 
123
    pop   edi
Line 128... Line 124...
128
    call  enable_ide_int
124
    sti
Line 418... Line 414...
418
  hd_lba_str       db 'K : FS - HD LBA error',13,10,0
414
  hd_lba_str       db 'K : FS - HD LBA error',13,10,0
419
endg
415
endg
Line 420... Line 416...
420
 
416
 
Line 421... Line 417...
421
hd_timeout_error:
417
hd_timeout_error:
422
 
418
 
423
    call  clear_hd_cache
419
;    call  clear_hd_cache
424
    call  clear_application_table_status
420
;    call  clear_application_table_status
425
    mov   esi,hd_timeout_str
421
    mov   esi,hd_timeout_str
426
    call  sys_msg_board_str
422
    call  sys_msg_board_str
427
;    jmp   $
423
;    jmp   $
428
    mov   [hd_error],1
424
    mov   [hd_error],1
Line 429... Line 425...
429
    pop   eax
425
    pop   eax
Line 430... Line 426...
430
    ret
426
    ret
431
 
427
 
432
hd_read_error:
428
hd_read_error:
433
 
429
 
434
    call  clear_hd_cache
430
;    call  clear_hd_cache
435
    call  clear_application_table_status
431
;    call  clear_application_table_status
Line 436... Line 432...
436
    mov   esi,hd_read_str
432
    mov   esi,hd_read_str
Line 437... Line 433...
437
    call  sys_msg_board_str
433
    call  sys_msg_board_str
438
    pop   edx eax
434
    pop   edx eax
439
    ret
435
    ret
440
 
436
 
441
hd_write_error:
437
hd_write_error:
Line 442... Line 438...
442
 
438
 
443
    call  clear_hd_cache
439
;    call  clear_hd_cache
444
    call  clear_application_table_status
440
;    call  clear_application_table_status
445
    mov   esi,hd_write_str
441
    mov   esi,hd_write_str
446
    call  sys_msg_board_str
442
    call  sys_msg_board_str
447
    ret
443
    ret
448
 
444
 
Line 449... Line 445...
449
hd_write_error_dma:
445
hd_write_error_dma:
450
        call    clear_hd_cache
446
;        call    clear_hd_cache
451
        call    clear_application_table_status
447
;        call    clear_application_table_status
452
        mov     esi, hd_write_str
448
        mov     esi, hd_write_str
453
        call    sys_msg_board_str
449
        call    sys_msg_board_str
454
        pop     esi
450
        pop     esi