Subversion Repositories Kolibri OS

Rev

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

Rev 133 Rev 136
Line 1971... Line 1971...
1971
    cmp   [hd_error],0
1971
    cmp   [hd_error],0
1972
    jne   return_01
1972
    jne   return_01
Line 1973... Line 1973...
1973
 
1973
 
Line -... Line 1974...
-
 
1974
    push  eax edx
-
 
1975
 
1974
    push  eax edx
1976
    call  disable_ide_int
1975
 
1977
 
1976
    call  wait_for_hd_idle
1978
    call  wait_for_hd_idle
Line 1977... Line 1979...
1977
    cmp   [hd_error],0
1979
    cmp   [hd_error],0
1978
    jne   hd_read_error    
1980
    jne   hd_read_error    
1979
 
1981
 
1980
    cli
1982
;    cli
1981
    xor   eax,eax
1983
    xor   eax,eax
1982
    mov   edx,[hdbase]
1984
    mov   edx,[hdbase]
Line 2001... Line 2003...
2001
    add   al,128+64+32
2003
    add   al,128+64+32
2002
    out   dx,al   ; ­®¬¥à £®«®¢ª¨/­®¬¥à ¤¨áª 
2004
    out   dx,al   ; ­®¬¥à £®«®¢ª¨/­®¬¥à ¤¨áª 
2003
    inc   edx
2005
    inc   edx
2004
    mov   al,20h
2006
    mov   al,20h
2005
    out   dx,al   ; ATACommand ॣ¨áâà ª®¬ ­¤
2007
    out   dx,al   ; ATACommand ॣ¨áâà ª®¬ ­¤
2006
    sti
2008
;    sti
Line 2007... Line 2009...
2007
 
2009
 
Line 2008... Line 2010...
2008
    call  wait_for_sector_buffer
2010
    call  wait_for_sector_buffer
2009
 
2011
 
Line 2010... Line 2012...
2010
    cmp   [hd_error],0
2012
    cmp   [hd_error],0
2011
    jne   hd_read_error
2013
    jne   hd_read_error
2012
 
2014
 
2013
    cli
2015
;    cli
2014
    push  edi
2016
    push  edi
2015
    shl   edi,9
2017
    shl   edi,9
2016
    add   edi,0x600000+65536
2018
    add   edi,0x600000+65536
2017
    mov   ecx,256
2019
    mov   ecx,256
2018
    mov   edx,[hdbase]
2020
    mov   edx,[hdbase]
2019
    cld
2021
    cld
-
 
2022
    rep   insw
-
 
2023
    pop   edi
Line 2020... Line 2024...
2020
    rep   insw
2024
;    sti
2021
    pop   edi
2025
 
2022
    sti
2026
    call  enable_ide_int
2023
 
2027
 
Line 2038... Line 2042...
2038
    rep   movsd                 ; move data
2042
    rep   movsd                 ; move data
2039
 return_01:
2043
 return_01:
2040
    pop   edi esi ecx
2044
    pop   edi esi ecx
2041
    ret
2045
    ret
Line -... Line 2046...
-
 
2046
 
-
 
2047
disable_ide_int:    
-
 
2048
        mov edx,[hdbase]
-
 
2049
        add edx,0x206
-
 
2050
        mov al,2
-
 
2051
        out dx,al
-
 
2052
        ret
-
 
2053
 
-
 
2054
enable_ide_int:
-
 
2055
        mov edx,[hdbase]
-
 
2056
        add edx,0x206
-
 
2057
        mov al,0
-
 
2058
        out dx,al
Line 2042... Line 2059...
2042
    
2059
        ret
2043
 
2060
 
2044
hd_write:
2061
hd_write:
2045
;-----------------------------------------------------------
2062
;-----------------------------------------------------------
Line 2117... Line 2134...
2117
    cmp   eax,[PARTITION_START]
2134
    cmp   eax,[PARTITION_START]
2118
    jb    danger
2135
    jb    danger
2119
    cmp   eax,[PARTITION_END]
2136
    cmp   eax,[PARTITION_END]
2120
    ja    danger
2137
    ja    danger
Line -... Line 2138...
-
 
2138
 
-
 
2139
    call  disable_ide_int
2121
 
2140
 
2122
    call  wait_for_hd_idle
2141
    call  wait_for_hd_idle
2123
    cmp   [hd_error],0
2142
    cmp   [hd_error],0
Line 2124... Line 2143...
2124
    jne   hd_write_error
2143
    jne   hd_write_error
2125
 
2144
 
2126
    cli
2145
;    cli
2127
    xor   eax,eax
2146
    xor   eax,eax
2128
    mov   edx,[hdbase]
2147
    mov   edx,[hdbase]
2129
    inc   edx
2148
    inc   edx
Line 2147... Line 2166...
2147
    add   al,128+64+32
2166
    add   al,128+64+32
2148
    out   dx,al
2167
    out   dx,al
2149
    inc   edx
2168
    inc   edx
2150
    mov   al,30h
2169
    mov   al,30h
2151
    out   dx,al
2170
    out   dx,al
2152
    sti
2171
;    sti
Line 2153... Line 2172...
2153
 
2172
 
Line 2154... Line 2173...
2154
    call  wait_for_sector_buffer
2173
    call  wait_for_sector_buffer
2155
 
2174
 
Line 2156... Line 2175...
2156
    cmp   [hd_error],0
2175
    cmp   [hd_error],0
Line 2157... Line 2176...
2157
    jne   hd_write_error
2176
    jne   hd_write_error
2158
 
2177
 
2159
    push  ecx esi
2178
    push  ecx esi
2160
 
2179
 
2161
    cli
2180
;    cli
2162
    mov   esi,edi
2181
    mov   esi,edi
2163
    shl   esi,9
2182
    shl   esi,9
2164
    add   esi,0x600000+65536    ; esi = from memory position
2183
    add   esi,0x600000+65536    ; esi = from memory position
2165
    mov   ecx,256
2184
    mov   ecx,256
Line 2166... Line 2185...
2166
    mov   edx,[hdbase]
2185
    mov   edx,[hdbase]
Line -... Line 2186...
-
 
2186
    cld
-
 
2187
    rep   outsw
2167
    cld
2188
;    sti
2168
    rep   outsw
2189
 
Line 2169... Line 2190...
2169
    sti
2190
    pop   esi ecx
2170
 
2191