/kernel/trunk/fs/fat12.inc |
---|
1241,7 → 1241,7 |
fd_find_lfn: |
; in: esi->name |
; out: CF=1 - file not found |
; else CF=0 and edi->direntry |
; else CF=0 and edi->direntry, eax=directory cluster (0 for root) |
push esi edi |
push 0 |
push flp_root_first |
1264,6 → 1264,7 |
stc |
ret |
.found: |
mov eax, [esp+8] |
add esp, 16 ; CF=0 |
pop esi |
ret |
1905,4 → 1906,58 |
pop edi ecx |
jmp .ret |
fs_FloppyGetFileInfo: |
call read_flp_fat |
cmp [FDC_Status], 0 |
jnz ret11 |
cmp byte [esi], 0 |
jnz @f |
mov eax, 2 ; unsupported |
ret |
@@: |
push edi |
call fd_find_lfn |
jmp fs_GetFileInfo_finish |
ret11: |
mov eax, 11 |
ret |
fs_FloppySetFileInfo: |
call read_flp_fat |
cmp [FDC_Status], 0 |
jnz ret11 |
cmp byte [esi], 0 |
jnz @f |
mov eax, 2 ; unsupported |
ret |
@@: |
push edi |
call fd_find_lfn |
jnc @f |
pop edi |
mov eax, ERROR_FILE_NOT_FOUND |
ret |
@@: |
push eax |
call bdfe_to_fat_entry |
pop eax |
test eax, eax |
jz .root |
add eax, 31 |
pusha |
call save_chs_sector |
popa |
jmp .cmn |
.root: |
call save_flp_root |
.cmn: |
pop edi |
xor eax, eax |
cmp [FDC_Status], 0 |
jz @f |
mov al, 11 |
@@: |
ret |
; \end{diamond} |
/kernel/trunk/fs/fat32.inc |
---|
7,6 → 7,7 |
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;; |
;; ;; |
;; See file COPYING for details ;; |
;; 15.06.2006 LFN get/set file/folder info - diamond ;; |
;; 27.05.2006 LFN create/rewrite file - diamond ;; |
;; 04.05.2006 LFN read folder - diamond ;; |
;; 29.04.2006 Elimination of hangup after the ;; |
2512,28 → 2513,28 |
xor eax,eax |
mov edx,[hdbase] |
inc edx |
out dx,al ; ATAFeatures ¥£ð¡¢ "®¡®¡¥®¡¢¥©" |
out dx,al ; ATAFeatures ॣ¨áâà "®á®¡¥®á⥩" |
inc edx |
inc eax |
out dx,al ; ATASectorCount ¡§¥¢§ðª ¡¥ª¢® ®¢ |
out dx,al ; ATASectorCount áç¥â稪 ᥪâ®à®¢ |
inc edx |
mov eax,[esp+4] |
out dx,al ; ATASectorNumber ¥£ð¡¢ ®¬¥ ¡¥ª¢® |
out dx,al ; ATASectorNumber ॣ¨áâà ®¬¥à ᥪâ®à |
shr eax,8 |
inc edx |
out dx,al ; ATACylinder ®¬¥ ¦ð«ð¤ (¬« ¤¨ð© ¡ ©¢) |
out dx,al ; ATACylinder ®¬¥à 樫¨¤à (¬« ¤è¨© ¡ ©â) |
shr eax,8 |
inc edx |
out dx,al ; ®¬¥ ¦ð«ð¤ (¡¢ ¨ð© ¡ ©¢) |
out dx,al ; ®¬¥à 樫¨¤à (áâ à訩 ¡ ©â) |
shr eax,8 |
inc edx |
and al,1+2+4+8 |
add al,byte [hdid] |
add al,128+64+32 |
out dx,al ; ®¬¥ £®«®¢ªð/®¬¥ ¤ð¡ª |
out dx,al ; ®¬¥à £®«®¢ª¨/®¬¥à ¤¨áª |
inc edx |
mov al,20h |
out dx,al ; ATACommand ¥£ð¡¢ ª®¬ ¤ |
out dx,al ; ATACommand ॣ¨áâà ª®¬ ¤ |
sti |
call wait_for_sector_buffer |
2934,7 → 2935,7 |
hd_find_lfn: |
; in: esi->name |
; out: CF=1 - file not found |
; else CF=0 and edi->direntry |
; else CF=0 and edi->direntry, eax=sector |
; destroys eax |
push esi edi |
push 0 |
2964,6 → 2965,15 |
stc |
ret |
.found: |
lea eax, [esp+8] |
cmp dword [eax], 0 |
jz .root |
call fat_get_sector |
jmp .cmn |
.root: |
mov eax, [eax+4] |
add eax, [ROOT_START] |
.cmn: |
add esp, 20 ; CF=0 |
pop esi |
ret |
3907,4 → 3917,65 |
popad |
ret |
fs_HdGetFileInfo: |
cmp [fat_type], 0 |
jnz @f |
mov eax, ERROR_UNKNOWN_FS |
ret |
@@: |
cmp byte [esi], 0 |
jnz @f |
mov eax, 2 |
ret |
@@: |
push edi |
call hd_find_lfn |
pushfd |
cmp [hd_error], 0 |
jz @f |
popfd |
pop edi |
mov eax, 11 |
ret |
@@: |
popfd |
jmp fs_GetFileInfo_finish |
fs_HdSetFileInfo: |
cmp [fat_type], 0 |
jnz @f |
mov eax, ERROR_UNKNOWN_FS |
ret |
@@: |
cmp byte [esi], 0 |
jnz @f |
mov eax, 2 |
ret |
@@: |
push edi |
call hd_find_lfn |
pushfd |
cmp [hd_error], 0 |
jz @f |
popfd |
pop edi |
mov eax, 11 |
ret |
@@: |
popfd |
jnc @f |
pop edi |
mov eax, ERROR_FILE_NOT_FOUND |
ret |
@@: |
push eax |
call bdfe_to_fat_entry |
pop eax |
mov ebx, buffer |
call hd_write |
call update_disk |
pop edi |
xor eax, eax |
ret |
; \end{diamond} |
/kernel/trunk/fs/fs_lfn.inc |
---|
54,11 → 54,12 |
; 2 : create/rewrite file |
; 3 : write/append to file - not implemented yet |
; 4 : set end of file - not implemented yet |
; 5 : get file attributes structure - not implemented yet |
; 6 : start application - not implemented yet |
; 7 : delete file - not implemented yet |
; 8 : create directory - not implemented yet |
; 9 : rename file/directory - not implemented yet |
; 5 : get file/directory attributes structure |
; 6 : set file/directory attributes structure |
; 7 : start application - not implemented yet |
; 8 : delete file - not implemented yet |
; 9 : create directory - not implemented yet |
; 10: rename file/directory - not implemented yet |
add eax, std_application_base_address |
; parse file name |
311,10 → 312,18 |
mov dword [esp+36], 2 ; not implemented |
ret |
fs_NotImplemented: |
mov eax, 2 |
ret |
fs_RamdiskServices: |
dd fs_RamdiskRead |
dd fs_RamdiskReadFolder |
dd fs_RamdiskRewrite |
dd fs_NotImplemented |
dd fs_NotImplemented |
dd fs_RamdiskGetFileInfo |
dd fs_RamdiskSetFileInfo |
fs_NumRamdiskServices = ($ - fs_RamdiskServices)/4 |
fs_OnFloppy: |
339,6 → 348,10 |
dd fs_FloppyRead |
dd fs_FloppyReadFolder |
dd fs_FloppyRewrite |
dd fs_NotImplemented |
dd fs_NotImplemented |
dd fs_FloppyGetFileInfo |
dd fs_FloppySetFileInfo |
fs_NumFloppyServices = ($ - fs_FloppyServices)/4 |
fs_OnHd0: |
401,6 → 414,10 |
dd fs_HdRead |
dd fs_HdReadFolder |
dd fs_HdRewrite |
dd fs_NotImplemented |
dd fs_NotImplemented |
dd fs_HdGetFileInfo |
dd fs_HdSetFileInfo |
fs_NumHdServices = ($ - fs_HdServices)/4 |
fs_HasRamdisk: |