File system addition: get/set file/folder attributes

git-svn-id: svn://kolibrios.org@86 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-06-15 13:13:03 +00:00
parent 62da2ad490
commit b3a457d97d
5 changed files with 358 additions and 45 deletions

View File

@ -834,13 +834,42 @@ fat_date_to_bdfe:
pop edx ecx
ret
bdfe_to_fat_time:
push edx
mov edx, eax
shr eax, 16
and dh, 0x3F
shl eax, 6
or al, dh
shr dl, 1
and dl, 0x1F
shl eax, 5
or al, dl
pop edx
ret
bdfe_to_fat_date:
push edx
mov edx, eax
shr eax, 16
sub ax, 1980
and dh, 0xF
shl eax, 4
or al, dh
and dl, 0x1F
shl eax, 5
or al, dl
pop edx
ret
fat_entry_to_bdfe:
; convert FAT entry at edi to BDFE (block of data of folder entry) at esi, advance esi
; destroys eax
movzx eax, byte [edi+11]
mov [esi], eax ; attributes
mov eax, [ebp-4]
mov [esi+4], eax ; ASCII/UNICODE name
fat_entry_to_bdfe2:
movzx eax, byte [edi+11]
mov [esi], eax ; attributes
movzx eax, word [edi+14]
call fat_time_to_bdfe
mov [esi+8], eax ; creation time
@ -861,6 +890,8 @@ fat_entry_to_bdfe:
mov [esi+32], eax ; file size (low dword)
xor eax, eax
mov [esi+36], eax ; file size (high dword)
test ebp, ebp
jz .ret
push ecx edi
lea edi, [esi+40]
mov esi, ebp
@ -872,6 +903,7 @@ fat_entry_to_bdfe:
@@:
mov esi, edi
pop edi ecx
.ret:
ret
.ansi:
mov ecx, 264/4
@ -879,41 +911,62 @@ fat_entry_to_bdfe:
mov [edi-1], al
jmp @b
bdfe_to_fat_entry:
; convert BDFE at edx to FAT entry at edi
; destroys eax
; attributes byte
test byte [edi+11], 8 ; volume label?
jnz @f
mov al, [edx]
and al, 0x27
and byte [edi+11], 0x10
or byte [edi+11], al
@@:
mov eax, [edx+8]
call bdfe_to_fat_time
mov [edi+14], ax ; creation time
mov eax, [edx+12]
call bdfe_to_fat_date
mov [edi+16], ax ; creation date
mov eax, [edx+20]
call bdfe_to_fat_date
mov [edi+18], ax ; last access date
mov eax, [edx+24]
call bdfe_to_fat_time
mov [edi+22], ax ; last write time
mov eax, [edx+28]
call bdfe_to_fat_date
mov [edi+24], ax ; last write date
ret
ramdisk_root_first:
mov edi, 0x100000+512*19
clc
ret
ramdisk_root_next:
add edi, 0x20
cmp edi, 0x100000+512*33
cmc
ret
rd_find_lfn:
; in: esi->name
; out: CF=1 - file not found
; else CF=0 and edi->direntry
push esi ebp edi
sub esp, 262*2 ; allocate space for LFN
mov ebp, esp ; ebp points to buffer
push 0 ; for fat_get_name: read ASCII name
mov edi, 0x100000+512*19 ; to root dir
.l1:
call fat_get_name
jc .l2
call fat_compare_name
jz .found
.l2:
add edi, 0x20
cmp edi, 0x100000+512*33
jb .l1
.notfound:
add esp, 262*2+4
pop edi ebp esi
stc
ret
.found:
; found
; if this is LFN entry, advance to true entry
cmp byte [edi+11], 0xF
jnz @f
add edi, 0x20
@@:
; folders are not supported
push esi edi
push ramdisk_root_first
push ramdisk_root_next
call fat_find_lfn
jc .notfound
cmp byte [esi], 0
jnz .notfound
add esp, 262*2+4+4 ; CF=0
pop ebp esi
add esp, 12
pop esi
ret ; CF=0
.notfound:
add esp, 8
pop edi esi
stc
ret
;----------------------------------------------------------------
@ -1594,4 +1647,46 @@ fs_RamdiskRewrite:
loop .read_symbols
ret
fs_RamdiskGetFileInfo:
cmp byte [esi], 0
jnz @f
mov eax, 2 ; unsupported
ret
@@:
push edi
call rd_find_lfn
fs_GetFileInfo_finish:
jnc @f
pop edi
mov eax, ERROR_FILE_NOT_FOUND
ret
@@:
push esi ebp
xor ebp, ebp
mov esi, edx
and dword [esi+4], 0
call fat_entry_to_bdfe2
pop ebp esi
pop edi
xor eax, eax
ret
fs_RamdiskSetFileInfo:
cmp byte [esi], 0
jnz @f
mov eax, 2 ; unsupported
ret
@@:
push edi
call rd_find_lfn
jnc @f
pop edi
mov eax, ERROR_FILE_NOT_FOUND
ret
@@:
call bdfe_to_fat_entry
pop edi
xor eax, eax
ret
; \end{diamond}

View File

@ -3131,6 +3131,7 @@ dword-
* ebx = ΰ §¬¥ΰ δ ©«  (Ά ΅ ©β ε) ¨«¨ 0 ¤«ο HD, -1 ¤«ο RD,
¥α«¨ δ ©« ­¥ ­ ©¤¥­
‡ ¬¥η ­¨ο:
* <20>â  äã­ªæ¨ï ãáâ à¥« , ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 5 ä㭪樨 70.
* ”γ­<CEB3>ζ¨ο ­¥ ―®¤¤¥ΰ¦¨Ά ¥βαο ¤«ο ¤¨α<C2A8>¥β.
* ¥<E28099>γι ο ΰ¥ «¨§ ζ¨ο ―®§Ά®«ο¥β β <CEB2>¦¥ ®―।¥«οβμ ΰ §¬¥ΰ ― <C2A0>¨
(―® ζ¥―®η<C2AE>¥ <20>« αβ¥ΰ®Ά Ά FAT), ­® ­¥ α«¥¤γ¥β ­  νβ® ―®« £ βμαο.
@ -3167,6 +3168,7 @@ dword-
¤«ο  Άβ®¬ β¨η¥α<C2A5>®£® ᮧ¤ ­¨ο backup- ΰε¨Ά®Ά, ¨΅® ―ΰ¨ § ―¨α¨
΅¨β ®΅λη­® γαβ ­ Ά«¨Ά ¥βαο (­¥ Ά Kolibri, ―ΰ Ά¤ )
‡ ¬¥η ­¨ο:
* <20>â  äã­ªæ¨ï ãáâ à¥« , ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 5 ä㭪樨 70.
* ”γ­<CEB3>ζ¨ο ­¥ ―®¤¤¥ΰ¦¨Ά ¥βαο ¤«ο ¤¨α<C2A8>¥β.
======================================================================
@ -3198,6 +3200,7 @@ dword-
* α«¥¤γξ騥 4 ΅¨β  = ¬¥αοζ, 1<=m<=12
* αβ ΰ訥 7 ΅¨β = £®¤ ®β­®α¨β¥«μ­® 1980
‡ ¬¥η ­¨ο:
* <20>â  äã­ªæ¨ï ãáâ à¥« , ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 5 ä㭪樨 70.
* ”γ­<CEB3>ζ¨ο ­¥ ―®¤¤¥ΰ¦¨Ά ¥βαο ¤«ο ¤¨α<C2A8>¥β.
* ‘®§¤ ­¨¥ δ ©« /― <C2A0>¨ αη¨β ¥βαο ¬®¤¨δ¨<CEB4> ζ¨¥©.
@ -4052,6 +4055,9 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* +12 = +0xC: dword: ΰ §¬¥ΰ
* +16 = +0x10: dword: γ<> § β¥«μ ­  ¤ ­­λ¥
* +20 = +0x14: n db: ASCIIZ-αβΰ®<CEB0>  α ¨¬¥­¥¬ δ ©« 
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
“β®η­¥­¨ο - Ά ¤®<C2A4>㬥­β ζ¨¨ ­  α®®βΆ¥βαβΆγξιγξ ―®¤δγ­<CEB3>ζ¨ξ.
<EFBFBD>¬ο δ ©«  ­¥ηγΆα⢨⥫쭮 <20> ΰ¥£¨αβΰγ ΅γ<CE85>Ά. <20>γαα<CEB1>¨¥ ΅γ<CE85>Άλ ¤®«¦­λ ΅λβμ
§ ―¨α ­λ Ά <20>®¤¨ΰ®Ά<C2AE>¥ cp866 (DOS).
@ -4076,6 +4082,8 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* ―®¤δγ­<CEB3>ζ¨ο 0 - ηβ¥­¨¥ δ ©« 
* ―®¤δγ­<CEB3>ζ¨ο 1 - ηβ¥­¨¥ ― <C2A0>¨
* ―®¤δγ­<CEB3>ζ¨ο 2 - ᮧ¤ ­¨¥/―¥ΰ¥§ ―¨αμ δ ©« 
* ¯®¤äã­ªæ¨ï 5 - ¯®«ã祭¨¥  âਡã⮢ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢ª   âਡã⮢ ä ©« /¯ ¯ª¨
======================================================================
= ”γ­<CEB3>ζ¨ο 70, ―®¤δγ­<CEB3>ζ¨ο 0 - ηβ¥­¨¥ δ ©«  α ―®¤¤¥ΰ¦<CEB0>®© ¤«¨­­λε ¨¬ρ­. =
@ -4091,6 +4099,9 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* +16 = +0x10: dword: γ<> § β¥«μ ­  ΅γδ¥ΰ, <20>γ¤  ΅γ¤γβ § ―¨α ­λ ¤ ­­λ¥
* +20 = +0x14: ASCIIZ-¨¬ο δ ©« , ―ΰ Ά¨«  δ®ΰ¬¨ΰ®Ά ­¨ο ¨¬ρ­ γ<> § ­λ Ά
®΅ι¥¬ ®―¨α ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* eax = 0 - γα―¥θ­®, ¨­ η¥ <20>®¤ ®θ¨΅<C2A8>¨ δ ©«®Ά®© α¨α⥬λ
* ebx = η¨α«® ―ΰ®η¨β ­­λε ΅ ©β ¨«¨
@ -4121,6 +4132,9 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
¤ ­­λ¥, ΰ §¬¥ΰ ΅γδ¥ΰ  ¤®«¦¥­ ΅λβμ ­¥ ¬¥­μθ¥ 32 + [+12]*560 ΅ ©β
* +20 = +0x14: ASCIIZ-¨¬ο ― <C2A0>¨, ―ΰ Ά¨«  δ®ΰ¬¨ΰ®Ά ­¨ο ¨¬ρ­ γ<> § ­λ Ά
®΅ι¥¬ ®―¨α ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* eax = 0 - γα―¥θ­®, ¨­ η¥ <20>®¤ ®θ¨΅<C2A8>¨ δ ©«®Ά®© α¨α⥬λ
* ebx = η¨α«® δ ©«®Ά, ¨­δ®ΰ¬ ζ¨ο ® <20>®β®ΰλε ΅λ«  § ―¨α ­  Ά ΅γδ¥ΰ,
@ -4213,6 +4227,9 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* +16 = +0x10: dword: γ<> § β¥«μ ­  ¤ ­­λ¥
* +20 = +0x14: ASCIIZ-¨¬ο δ ©« , ―ΰ Ά¨«  δ®ΰ¬¨ΰ®Ά ­¨ο ¨¬ρ­ γ<> § ­λ Ά
®΅ι¥¬ ®―¨α ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* eax = 0 - γα―¥θ­®, ¨­ η¥ <20>®¤ ®θ¨΅<C2A8>¨ δ ©«®Ά®© α¨α⥬λ
* ebx = η¨α«® § ―¨α ­­λε ΅ ©β (Ά®§¬®¦­®, 0)
@ -4222,6 +4239,64 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
* …᫨ αΆ®΅®¤­®£® ¬¥αβ  ­  ¤¨α<C2A8>¥ ­¥¤®αβ β®η­®, β® δγ­<CEB3>ζ¨ο § ―¨θ¥β,
α<>®«μ<C2AB>® ᬮ¦¥β, ―®α«¥ η¥£® Ά¥ΰ­ρβ <20>®¤ ®θ¨΅<C2A8>¨ 8.
======================================================================
=== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 5 - ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ® ä ©«¥/¯ ¯ª¥. ===
======================================================================
<EFBFBD> à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 5 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
(40 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
ˆ­ä®à¬ æ¨ï ® ä ©«¥ ¢®§¢à é ¥âáï ¢ ä®à¬ â¥ <20>Š
(¡«®ª  ¤ ­­ëå ¢å®¤  ª â «®£ ), 㪠§ ­­®¬ ¢ ®¯¨á ­¨¨
¯®¤ä㭪樨 1, ­® ¡¥§ ¨¬¥­¨ ä ©« 
(â® ¥áâì ¯¥à¢ë¥ 40 = 0x28 ¡ ©â).
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¢¨àâã «ì­ë¥ ¯ ¯ª¨ ⨯  /, /rd ¨
ª®à­¥¢ë¥ ¯ ¯ª¨ ⨯  /rd/1.
======================================================================
===== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢ª   âਡã⮢ ä ©« /¯ ¯ª¨. ====
======================================================================
<EFBFBD> à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 6 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à á  âਡãâ ¬¨ (32 ¡ ©â )
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
€âਡãâë ä ©«  - ¯¥à¢ë¥ 32 ¡ ©â  ¢ <20>Š (¡«®ª¥ ¤ ­­ëå ¢å®¤  ª â «®£ ),
ä®à¬ â ª®â®à®£® 㪠§ ­ ¢ ®¯¨á ­¨¨ ¯®¤ä㭪樨 1
(â® ¥áâì ¡¥§ ¨¬¥­¨ ¨ à §¬¥à  ä ©« ). €âਡãâ ä ©«/¯ ¯ª /¬¥âª  ⮬ 
(¡¨âë 3,4 ¢ dword'¥ +0) ­¥ ¬¥­ï¥âáï.
<EFBFBD> ©â +4 (ä®à¬ â ¨¬¥­¨) ¨£­®à¨àã¥âáï.
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¢¨àâã «ì­ë¥ ¯ ¯ª¨ ⨯  /, /rd ¨
ª®à­¥¢ë¥ ¯ ¯ª¨ ⨯  /rd/1.
======================================================================
========== ”γ­<CEB3>ζ¨ο -1 - § Ά¥ΰθ¨βμ Άλ―®«­¥­¨¥ ―®β®<CEB2> /―ΰ®ζ¥αα  =========
======================================================================

View File

@ -1241,7 +1241,7 @@ flp_notroot_extend_dir:
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 @@ fd_find_lfn:
stc
ret
.found:
mov eax, [esp+8]
add esp, 16 ; CF=0
pop esi
ret
@ -1905,4 +1906,58 @@ fs_FloppyRewrite:
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}

View File

@ -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 @@ hd_read:
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 @@ read_hd_file:
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 @@ hd_find_lfn:
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 @@ fs_HdRewrite:
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}

View File

@ -54,11 +54,12 @@ file_system_lfn:
; 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 @@ fs_OnRamdisk:
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 @@ fs_FloppyServices:
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 @@ fs_HdServices:
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: