/kernel/trunk/fs/fat32.inc |
---|
1973,11 → 1973,13 |
push eax edx |
call disable_ide_int |
call wait_for_hd_idle |
cmp [hd_error],0 |
jne hd_read_error |
cli |
; cli |
xor eax,eax |
mov edx,[hdbase] |
inc edx |
2003,7 → 2005,7 |
inc edx |
mov al,20h |
out dx,al ; ATACommand ॣ¨áâà ª®¬ ¤ |
sti |
; sti |
call wait_for_sector_buffer |
2010,7 → 2012,7 |
cmp [hd_error],0 |
jne hd_read_error |
cli |
; cli |
push edi |
shl edi,9 |
add edi,0x600000+65536 |
2019,8 → 2021,10 |
cld |
rep insw |
pop edi |
sti |
; sti |
call enable_ide_int |
pop edx eax |
blok_read_2: |
lea esi,[edi*8+0x600000] |
2040,7 → 2044,20 |
pop edi esi ecx |
ret |
disable_ide_int: |
mov edx,[hdbase] |
add edx,0x206 |
mov al,2 |
out dx,al |
ret |
enable_ide_int: |
mov edx,[hdbase] |
add edx,0x206 |
mov al,0 |
out dx,al |
ret |
hd_write: |
;----------------------------------------------------------- |
; input : eax = block |
2119,11 → 2136,13 |
cmp eax,[PARTITION_END] |
ja danger |
call disable_ide_int |
call wait_for_hd_idle |
cmp [hd_error],0 |
jne hd_write_error |
cli |
; cli |
xor eax,eax |
mov edx,[hdbase] |
inc edx |
2149,7 → 2168,7 |
inc edx |
mov al,30h |
out dx,al |
sti |
; sti |
call wait_for_sector_buffer |
2158,7 → 2177,7 |
push ecx esi |
cli |
; cli |
mov esi,edi |
shl esi,9 |
add esi,0x600000+65536 ; esi = from memory position |
2166,10 → 2185,12 |
mov edx,[hdbase] |
cld |
rep outsw |
sti |
; sti |
pop esi ecx |
call enable_ide_int |
danger: |
does_not_need_writing: |