forked from KolibriOS/kolibrios
Function 70.1 now supports ANSI+UNICODE. Flag CF in function 49 corrected.
git-svn-id: svn://kolibrios.org@78 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0b65f18e93
commit
60290f1452
@ -30,14 +30,11 @@ calculatefatchain:
|
|||||||
shl eax,4
|
shl eax,4
|
||||||
and eax,0x0fffffff ;2 ok
|
and eax,0x0fffffff ;2 ok
|
||||||
shr ax,4 ;1 ok
|
shr ax,4 ;1 ok
|
||||||
mov dword [edi],eax
|
mov dword [edi],eax
|
||||||
add edi,4
|
mov dword [edi+4],ebx
|
||||||
mov dword [edi],ebx
|
mov dword [edi+8],ecx
|
||||||
add edi,4
|
mov dword [edi+12],edx
|
||||||
mov dword [edi],ecx
|
add edi,16
|
||||||
add edi,4
|
|
||||||
mov dword [edi],edx
|
|
||||||
add edi,4
|
|
||||||
add esi,12
|
add esi,12
|
||||||
|
|
||||||
cmp edi,0x280000+2856*2 ;2849 clusters
|
cmp edi,0x280000+2856*2 ;2849 clusters
|
||||||
@ -63,10 +60,9 @@ restorefatchain: ; restore fat chain
|
|||||||
shr ebx,4
|
shr ebx,4
|
||||||
shrd eax,ebx,8
|
shrd eax,ebx,8
|
||||||
shr ebx,8
|
shr ebx,8
|
||||||
mov dword [edi],eax
|
mov dword [edi],eax
|
||||||
add edi,4
|
mov word [edi+4],bx
|
||||||
mov word [edi],bx
|
add edi,6
|
||||||
add edi,2
|
|
||||||
add esi,8
|
add esi,8
|
||||||
|
|
||||||
cmp edi,0x100000+512+4278 ;4274 bytes - all used FAT
|
cmp edi,0x100000+512+4278 ;4274 bytes - all used FAT
|
||||||
@ -100,8 +96,8 @@ ramdisk_free_space:
|
|||||||
repne scasw
|
repne scasw
|
||||||
jnz rdfs2 ;if last cluster not 0
|
jnz rdfs2 ;if last cluster not 0
|
||||||
inc ebx
|
inc ebx
|
||||||
jcxz rdfs2 ;if last cluster=0
|
test ecx, ecx
|
||||||
jmp rdfs1 ;if not last
|
jnz rdfs1
|
||||||
rdfs2:
|
rdfs2:
|
||||||
shl ebx,9 ;free clusters*512
|
shl ebx,9 ;free clusters*512
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
@ -438,15 +434,11 @@ mov [edi+22],ax ; time
|
|||||||
jbe flnsa
|
jbe flnsa
|
||||||
sub eax,512
|
sub eax,512
|
||||||
mov [esp+12],eax
|
mov [esp+12],eax
|
||||||
mov eax,[esp+16]
|
add dword [esp+16], 512
|
||||||
add eax,512
|
|
||||||
mov [esp+16],eax
|
|
||||||
jmp frnewds
|
jmp frnewds
|
||||||
|
|
||||||
flnsa:
|
flnsa:
|
||||||
dec edi
|
mov [edi-2],word 4095 ; mark end of file - last cluster
|
||||||
dec edi
|
|
||||||
mov [edi],word 4095 ; mark end of file - last cluster
|
|
||||||
|
|
||||||
frnoreadds:
|
frnoreadds:
|
||||||
|
|
||||||
@ -644,7 +636,7 @@ fat_get_name:
|
|||||||
push ecx
|
push ecx
|
||||||
mov ecx, 8
|
mov ecx, 8
|
||||||
push edi ebp ecx
|
push edi ebp ecx
|
||||||
cmp byte [ebp-4], 0
|
test byte [ebp-4], 1
|
||||||
jnz .unicode_short
|
jnz .unicode_short
|
||||||
@@:
|
@@:
|
||||||
mov al, [edi]
|
mov al, [edi]
|
||||||
@ -763,7 +755,7 @@ fat_get_name:
|
|||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
; if this is first entry:
|
; if this is first entry:
|
||||||
cmp byte [ebp-4], 0
|
test byte [ebp-4], 1
|
||||||
jnz .ret
|
jnz .ret
|
||||||
; buffer at ebp contains UNICODE name, convert it to ANSI
|
; buffer at ebp contains UNICODE name, convert it to ANSI
|
||||||
push esi edi
|
push esi edi
|
||||||
@ -872,50 +864,57 @@ fat_entry_to_bdfe:
|
|||||||
push ecx edi
|
push ecx edi
|
||||||
lea edi, [esi+40]
|
lea edi, [esi+40]
|
||||||
mov esi, ebp
|
mov esi, ebp
|
||||||
mov ecx, 259/2
|
test byte [esi-4], 1
|
||||||
|
jz .ansi
|
||||||
|
mov ecx, 260/2
|
||||||
rep movsd
|
rep movsd
|
||||||
movsw
|
mov [edi-2], ax
|
||||||
stosw
|
@@:
|
||||||
mov esi, edi
|
mov esi, edi
|
||||||
pop edi ecx
|
pop edi ecx
|
||||||
ret
|
ret
|
||||||
|
.ansi:
|
||||||
|
mov ecx, 264/4
|
||||||
|
rep movsd
|
||||||
|
mov [edi-1], al
|
||||||
|
jmp @b
|
||||||
|
|
||||||
rd_find_lfn:
|
rd_find_lfn:
|
||||||
; in: esi->name
|
; in: esi->name
|
||||||
; out: CF=1 - file not found
|
; out: CF=1 - file not found
|
||||||
; else CF=0 and edi->direntry
|
; else CF=0 and edi->direntry
|
||||||
push esi ebp edi
|
push esi ebp edi
|
||||||
sub esp, 262*2 ; allocate space for LFN
|
sub esp, 262*2 ; allocate space for LFN
|
||||||
mov ebp, esp ; ebp points to buffer
|
mov ebp, esp ; ebp points to buffer
|
||||||
push 0 ; for fat_get_name: read ASCII name
|
push 0 ; for fat_get_name: read ASCII name
|
||||||
mov edi, 0x100000+512*19 ; to root dir
|
mov edi, 0x100000+512*19 ; to root dir
|
||||||
.l1:
|
.l1:
|
||||||
call fat_get_name
|
call fat_get_name
|
||||||
jc .l2
|
jc .l2
|
||||||
call fat_compare_name
|
call fat_compare_name
|
||||||
jz .found
|
jz .found
|
||||||
.l2:
|
.l2:
|
||||||
add edi, 0x20
|
add edi, 0x20
|
||||||
cmp edi, 0x100000+512*33
|
cmp edi, 0x100000+512*33
|
||||||
jb .l1
|
jb .l1
|
||||||
.notfound:
|
.notfound:
|
||||||
add esp, 262*2+4
|
add esp, 262*2+4
|
||||||
pop edi ebp esi
|
pop edi ebp esi
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
.found:
|
.found:
|
||||||
; found
|
; found
|
||||||
; if this is LFN entry, advance to true entry
|
; if this is LFN entry, advance to true entry
|
||||||
cmp byte [edi+11], 0xF
|
cmp byte [edi+11], 0xF
|
||||||
jnz @f
|
jnz @f
|
||||||
add edi, 0x20
|
add edi, 0x20
|
||||||
@@:
|
@@:
|
||||||
; folders are not supported
|
; folders are not supported
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
jnz .notfound
|
jnz .notfound
|
||||||
add esp, 262*2+4+4 ; CF=0
|
add esp, 262*2+4+4 ; CF=0
|
||||||
pop ebp esi
|
pop ebp esi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
;
|
;
|
||||||
@ -1013,7 +1012,9 @@ fs_RamdiskRead:
|
|||||||
; fs_RamdiskReadFolder - LFN variant for reading sys floppy folder
|
; fs_RamdiskReadFolder - LFN variant for reading sys floppy folder
|
||||||
;
|
;
|
||||||
; esi points to filename; only root is folder on ramdisk
|
; esi points to filename; only root is folder on ramdisk
|
||||||
; ebx pointer to 32-bit number = first wanted block
|
; ebx pointer to structure 32-bit number = first wanted block
|
||||||
|
; & flags (bitfields)
|
||||||
|
; flags: bit 0: 0=ANSI names, 1=UNICODE names
|
||||||
; ecx number of blocks to read, 0+
|
; ecx number of blocks to read, 0+
|
||||||
; edx mem location to return data
|
; edx mem location to return data
|
||||||
;
|
;
|
||||||
@ -1022,7 +1023,6 @@ fs_RamdiskRead:
|
|||||||
;
|
;
|
||||||
;--------------------------------------------------------------
|
;--------------------------------------------------------------
|
||||||
fs_RamdiskReadFolder:
|
fs_RamdiskReadFolder:
|
||||||
mov ebx, [ebx]
|
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
jz @f
|
jz @f
|
||||||
; ramdisk doesn't support folders
|
; ramdisk doesn't support folders
|
||||||
@ -1042,7 +1042,8 @@ fs_RamdiskReadFolder:
|
|||||||
push ebp
|
push ebp
|
||||||
sub esp, 262*2 ; allocate space for LFN
|
sub esp, 262*2 ; allocate space for LFN
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
push 1 ; for fat_get_name: read UNICODE name
|
push dword [ebx+4] ; for fat_get_name: read ANSI/UNICODE name
|
||||||
|
mov ebx, [ebx]
|
||||||
; read root
|
; read root
|
||||||
mov esi, edi ; esi points to block of data of folder entry (BDFE)
|
mov esi, edi ; esi points to block of data of folder entry (BDFE)
|
||||||
mov edi, 0x100000+512*19
|
mov edi, 0x100000+512*19
|
||||||
@ -1075,4 +1076,4 @@ fs_RamdiskReadFolder:
|
|||||||
pop ecx edi esi
|
pop ecx edi esi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; \end{diamond}
|
; \end{diamond}
|
||||||
|
@ -2235,6 +2235,27 @@ dword-
|
|||||||
* <20>®«ì§®¢ â¥«ì ¬®¦¥â ¨§¬¥ïâì ᪨ áâ â¨ç¥áª¨, ᮧ¤ ¢ ᢮©
|
* <20>®«ì§®¢ â¥«ì ¬®¦¥â ¨§¬¥ïâì ᪨ áâ â¨ç¥áª¨, ᮧ¤ ¢ ᢮©
|
||||||
default.skn, ¨«¨ ¤¨ ¬¨ç¥áª¨ á ¯®¬®éìî ¯à¨«®¦¥¨ï desktop.
|
default.skn, ¨«¨ ¤¨ ¬¨ç¥áª¨ á ¯®¬®éìî ¯à¨«®¦¥¨ï desktop.
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
============ ”ãªæ¨ï 49 - Advanced Power Management (APM). ===========
|
||||||
|
======================================================================
|
||||||
|
<EFBFBD> à ¬¥âàë:
|
||||||
|
* eax = 49 - ®¬¥à äãªæ¨¨
|
||||||
|
* dx = ®¬¥à äãªæ¨¨ APM ( «®£ ax ¢ ᯥæ¨ä¨ª 樨)
|
||||||
|
* bx, cx = ¯ à ¬¥âàë äãªæ¨¨ APM
|
||||||
|
‚®§¢à é ¥¬®¥ § 票¥:
|
||||||
|
* 16-¡¨âë¥ à¥£¨áâàë ax, bx, cx, dx, si, di ¨ ä« £ CF
|
||||||
|
ãáâ ®¢«¥ë ¢ ᮮ⢥âá⢨¨ ᮠᯥæ¨ä¨ª 樥© APM
|
||||||
|
* áâ à訥 ¯®«®¢¨ë 32-¡¨âëå ॣ¨áâ஢ eax, ebx, ecx,
|
||||||
|
edx, esi, edi à §àãè îâáï
|
||||||
|
‡ ¬¥ç ¨ï:
|
||||||
|
* ‘¯¥æ¨ä¨ª æ¨ï APM 1.2 ®¯¨áë¢ ¥âáï ¢ ¤®ªã¬¥â¥
|
||||||
|
"Advanced Power Management (APM) BIOS Specification"
|
||||||
|
(Revision 1.2), ¤®áâ㯮¬
|
||||||
|
http://www.microsoft.com/whdc/archive/amp_12.mspx;
|
||||||
|
ªà®¬¥ ⮣®, ® ¢ª«îç¥ ¢ ¨§¢¥áâë© Interrupt List by Ralf Brown
|
||||||
|
(http://www.pobox.com/~ralf/files.html,
|
||||||
|
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
================= ”ãªæ¨ï 50 - ãáâ ®¢ª ä®à¬ë ®ª . =================
|
================= ”ãªæ¨ï 50 - ãáâ ®¢ª ä®à¬ë ®ª . =================
|
||||||
======================================================================
|
======================================================================
|
||||||
@ -4077,7 +4098,11 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
|||||||
”®à¬ â ¨ä®à¬ 樮®© áâàãªâãàë:
|
”®à¬ â ¨ä®à¬ 樮®© áâàãªâãàë:
|
||||||
* +0: dword: 1 = ®¬¥à ¯®¤äãªæ¨¨
|
* +0: dword: 1 = ®¬¥à ¯®¤äãªæ¨¨
|
||||||
* +4: dword: ¨¤¥ªá ç «ì®£® ¡«®ª (áç¨â ï á 0)
|
* +4: dword: ¨¤¥ªá ç «ì®£® ¡«®ª (áç¨â ï á 0)
|
||||||
* +8: dword: 0 (§ १¥à¢¨à®¢ ®)
|
* +8: dword: ¯®«¥ ä« £®¢:
|
||||||
|
* ¡¨â 0 (¬ ᪠1): ¢ ª ª®¬ ä®à¬ ⥠¢®§¢à é âì ¨¬¥ ,
|
||||||
|
0=ANSI, 1=UNICODE
|
||||||
|
* ¯à®ç¨¥ ¡¨âë § १¥à¢¨à®¢ ë ¨ ¤®«¦ë ¡ëâì ãáâ ®¢«¥ë ¢ 0
|
||||||
|
¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨
|
||||||
* +12 = +0xC: dword: ᪮«ìª® ¡«®ª®¢ ç¨â âì
|
* +12 = +0xC: dword: ᪮«ìª® ¡«®ª®¢ ç¨â âì
|
||||||
* +16 = +0x10: dword: 㪠§ â¥«ì ¡ãä¥à, ªã¤ ¡ã¤ãâ § ¯¨á ë
|
* +16 = +0x10: dword: 㪠§ â¥«ì ¡ãä¥à, ªã¤ ¡ã¤ãâ § ¯¨á ë
|
||||||
¤ ë¥, à §¬¥à ¡ãä¥à ¤®«¦¥ ¡ëâì ¥ ¬¥ìè¥ 32 + [+12]*560 ¡ ©â
|
¤ ë¥, à §¬¥à ¡ãä¥à ¤®«¦¥ ¡ëâì ¥ ¬¥ìè¥ 32 + [+12]*560 ¡ ©â
|
||||||
@ -4114,7 +4139,8 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
|||||||
íâ® ¬®¦¥â ¡ëâì ¯®«¥§® ¤«ï ¢â®¬ â¨ç¥áª®£® ᮧ¤ ¨ï
|
íâ® ¬®¦¥â ¡ëâì ¯®«¥§® ¤«ï ¢â®¬ â¨ç¥áª®£® ᮧ¤ ¨ï
|
||||||
backup- à娢®¢, ¨¡® ¯à¨ § ¯¨á¨ ¡¨â ®¡ëç® ãáâ ¢«¨¢ ¥âáï
|
backup- à娢®¢, ¨¡® ¯à¨ § ¯¨á¨ ¡¨â ®¡ëç® ãáâ ¢«¨¢ ¥âáï
|
||||||
(¥ ¢ Kolibri, ¯à ¢¤ )
|
(¥ ¢ Kolibri, ¯à ¢¤ )
|
||||||
* +4: byte: ⨯ ¤ ëå ¨¬¥¨: (¤«ï ⥪ã饩 ॠ«¨§ 樨 ¢á¥£¤ 1)
|
* +4: byte: ⨯ ¤ ëå ¨¬¥¨:
|
||||||
|
(ᮢ¯ ¤ ¥â á ¡¨â®¬ 0 ä« £®¢ ¨ä®à¬ 樮®© áâàãªâãàë)
|
||||||
* 0 = ASCII = 1-¡ ©â®¥ ¯à¥¤áâ ¢«¥¨¥ ª ¦¤®£® ᨬ¢®«
|
* 0 = ASCII = 1-¡ ©â®¥ ¯à¥¤áâ ¢«¥¨¥ ª ¦¤®£® ᨬ¢®«
|
||||||
* 1 = UNICODE = 2-¡ ©â®¥ ¯à¥¤áâ ¢«¥¨¥ ª ¦¤®£® ᨬ¢®«
|
* 1 = UNICODE = 2-¡ ©â®¥ ¯à¥¤áâ ¢«¥¨¥ ª ¦¤®£® ᨬ¢®«
|
||||||
* +5: 3*byte: § १¥à¢¨à®¢ ® (㫨)
|
* +5: 3*byte: § १¥à¢¨à®¢ ® (㫨)
|
||||||
@ -4142,11 +4168,12 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
|||||||
* +2: word: £®¤
|
* +2: word: £®¤
|
||||||
* ¯à¨¬¥à, 25.11.1979 § ¯¨áë¢ ¥âáï ª ª (¢ hex) 19 0B BB 07
|
* ¯à¨¬¥à, 25.11.1979 § ¯¨áë¢ ¥âáï ª ª (¢ hex) 19 0B BB 07
|
||||||
‡ ¬¥ç ¨ï:
|
‡ ¬¥ç ¨ï:
|
||||||
* ’¥ªãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â ¨¬¥ ⮫쪮 ¢ ä®à¬ ⥠UNICODE.
|
|
||||||
* …᫨ ¢ <20>„‚Š ¯à¨áãâáâ¢ã¥â ¨¬ï ¢ ASCII, â® ¤«¨ <20>„‚Š á®áâ ¢«ï¥â
|
* …᫨ ¢ <20>„‚Š ¯à¨áãâáâ¢ã¥â ¨¬ï ¢ ASCII, â® ¤«¨ <20>„‚Š á®áâ ¢«ï¥â
|
||||||
304 ¡ ©â , ¥á«¨ ¢ UNICODE - 560 ¡ ©â. ‡ 票¥ ¤«¨ë ¢ëà ¢¥®
|
304 ¡ ©â , ¥á«¨ ¢ UNICODE - 560 ¡ ©â. ‡ 票¥ ¤«¨ë ¢ëà ¢¥®
|
||||||
楫®¥ ªà ⮥ 16 ¡ ©â
|
楫®¥ ªà ⮥ 16 ¡ ©â
|
||||||
(¤«ï ãáª®à¥¨ï ®¡à ¡®âª¨ ¢ ªíè-¯ ¬ï⨠CPU).
|
(¤«ï ãáª®à¥¨ï ®¡à ¡®âª¨ ¢ ªíè-¯ ¬ï⨠CPU).
|
||||||
|
* <20>¥à¢ë© ᨬ¢®« ¯®á«¥ ¨¬¥¨ ã«¥¢®© (ASCIIZ-áâப ). „ «ì¥©è¨¥
|
||||||
|
¤ ë¥ á®¤¥à¦ â ¬ãá®à.
|
||||||
* …᫨ ä ©«ë ¢ ¯ ¯ª¥ ª®ç¨«¨áì à ìè¥, 祬 ¡ë«® ¯à®ç¨â ®
|
* …᫨ ä ©«ë ¢ ¯ ¯ª¥ ª®ç¨«¨áì à ìè¥, 祬 ¡ë«® ¯à®ç¨â ®
|
||||||
§ ¯à®è¥®¥ ª®«¨ç¥á⢮, â® äãªæ¨ï ¯à®ç¨â ¥â, ᪮«ìª® ᬮ¦¥â,
|
§ ¯à®è¥®¥ ª®«¨ç¥á⢮, â® äãªæ¨ï ¯à®ç¨â ¥â, ᪮«ìª® ᬮ¦¥â,
|
||||||
¯®á«¥ 祣® ¢¥àñâ eax=6 (EOF).
|
¯®á«¥ 祣® ¢¥àñâ eax=6 (EOF).
|
||||||
|
@ -55,7 +55,6 @@ floppy_free_space:
|
|||||||
rdfs1_1:
|
rdfs1_1:
|
||||||
mov ebx,[eax]
|
mov ebx,[eax]
|
||||||
and ebx,4095
|
and ebx,4095
|
||||||
cmp ebx,0
|
|
||||||
jne rdfs2_1
|
jne rdfs2_1
|
||||||
add edi,512
|
add edi,512
|
||||||
rdfs2_1:
|
rdfs2_1:
|
||||||
@ -1268,7 +1267,9 @@ fs_FloppyRead:
|
|||||||
; fs_FloppyReadFolder - LFN variant for reading floppy folders
|
; fs_FloppyReadFolder - LFN variant for reading floppy folders
|
||||||
;
|
;
|
||||||
; esi points to filename
|
; esi points to filename
|
||||||
; ebx pointer to 32-bit number = first wanted block, 0+
|
; ebx pointer to structure: 32-bit number = first wanted block, 0+
|
||||||
|
; & flags (bitfields)
|
||||||
|
; flags: bit 0: 0=ANSI names, 1=UNICODE names
|
||||||
; ecx number of blocks to read, 0+
|
; ecx number of blocks to read, 0+
|
||||||
; edx mem location to return data
|
; edx mem location to return data
|
||||||
;
|
;
|
||||||
@ -1278,7 +1279,6 @@ fs_FloppyRead:
|
|||||||
;--------------------------------------------------------------
|
;--------------------------------------------------------------
|
||||||
fs_FloppyReadFolder:
|
fs_FloppyReadFolder:
|
||||||
call read_flp_fat
|
call read_flp_fat
|
||||||
mov ebx, [ebx]
|
|
||||||
push edi
|
push edi
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
jz .root
|
jz .root
|
||||||
@ -1307,7 +1307,8 @@ fs_FloppyReadFolder:
|
|||||||
push ecx ebp
|
push ecx ebp
|
||||||
sub esp, 262*2 ; reserve space for LFN
|
sub esp, 262*2 ; reserve space for LFN
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
push 1 ; for fat_get_name: read UNICODE names
|
push dword [ebx+4] ; for fat_get_name: read ANSI/UNICODE names
|
||||||
|
mov ebx, [ebx]
|
||||||
; init header
|
; init header
|
||||||
push eax ecx
|
push eax ecx
|
||||||
mov edi, edx
|
mov edi, edx
|
||||||
@ -1397,4 +1398,4 @@ fs_FloppyReadFolder:
|
|||||||
pop ecx edi edi
|
pop ecx edi edi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; \end{diamond}
|
; \end{diamond}
|
||||||
|
@ -3202,7 +3202,9 @@ fs_HdRead:
|
|||||||
; fs_HdReadFolder - LFN variant for reading hard disk folder
|
; fs_HdReadFolder - LFN variant for reading hard disk folder
|
||||||
;
|
;
|
||||||
; esi points to filename
|
; esi points to filename
|
||||||
; ebx pointer to 32-bit number = first wanted block, 0+
|
; ebx pointer to structure 32-bit number = first wanted block, 0+
|
||||||
|
; & flags (bitfields)
|
||||||
|
; flags: bit 0: 0=ANSI names, 1=UNICODE names
|
||||||
; ecx number of blocks to read, 0+
|
; ecx number of blocks to read, 0+
|
||||||
; edx mem location to return data
|
; edx mem location to return data
|
||||||
;
|
;
|
||||||
@ -3211,7 +3213,6 @@ fs_HdRead:
|
|||||||
;
|
;
|
||||||
;--------------------------------------------------------------
|
;--------------------------------------------------------------
|
||||||
fs_HdReadFolder:
|
fs_HdReadFolder:
|
||||||
mov ebx, [ebx]
|
|
||||||
mov eax, [ROOT_CLUSTER]
|
mov eax, [ROOT_CLUSTER]
|
||||||
push edi
|
push edi
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
@ -3237,7 +3238,8 @@ fs_HdReadFolder:
|
|||||||
push ebp
|
push ebp
|
||||||
sub esp, 262*2 ; reserve space for LFN
|
sub esp, 262*2 ; reserve space for LFN
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
push 1 ; for fat_get_name: read UNICODE name
|
push dword [ebx+4] ; for fat_get_name: read ANSI/UNICODE name
|
||||||
|
mov ebx, [ebx]
|
||||||
; init header
|
; init header
|
||||||
push eax ecx
|
push eax ecx
|
||||||
mov edi, edx
|
mov edi, edx
|
||||||
|
@ -32,17 +32,17 @@ rootdirs:
|
|||||||
|
|
||||||
virtual_root_query:
|
virtual_root_query:
|
||||||
dd fs_HasRamdisk
|
dd fs_HasRamdisk
|
||||||
du 'rd',0
|
db 'rd',0
|
||||||
dd fs_HasFloppy
|
dd fs_HasFloppy
|
||||||
du 'fd',0
|
db 'fd',0
|
||||||
dd fs_HasHd0
|
dd fs_HasHd0
|
||||||
du 'hd0',0
|
db 'hd0',0
|
||||||
dd fs_HasHd1
|
dd fs_HasHd1
|
||||||
du 'hd1',0
|
db 'hd1',0
|
||||||
dd fs_HasHd2
|
dd fs_HasHd2
|
||||||
du 'hd2',0
|
db 'hd2',0
|
||||||
dd fs_HasHd3
|
dd fs_HasHd3
|
||||||
du 'hd3',0
|
db 'hd3',0
|
||||||
dd 0
|
dd 0
|
||||||
endg
|
endg
|
||||||
|
|
||||||
@ -104,9 +104,10 @@ file_system_lfn:
|
|||||||
mov ebp, [ebx+12]
|
mov ebp, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
add edx, std_application_base_address
|
||||||
mov ebx, [ebx+4]
|
push dword [ebx+4] ; first block
|
||||||
|
mov ebx, [ebx+8] ; flags
|
||||||
mov esi, [edi+4]
|
mov esi, [edi+4]
|
||||||
; ebx=first block, ebp=number of blocks, edx=return area, esi='Next' handler
|
; ebx=flags, [esp]=first block, ebp=number of blocks, edx=return area, esi='Next' handler
|
||||||
mov edi, edx
|
mov edi, edx
|
||||||
mov ecx, 32/4
|
mov ecx, 32/4
|
||||||
rep stosd
|
rep stosd
|
||||||
@ -115,7 +116,7 @@ file_system_lfn:
|
|||||||
call esi
|
call esi
|
||||||
jc .maindir_done
|
jc .maindir_done
|
||||||
inc dword [edx+8]
|
inc dword [edx+8]
|
||||||
dec ebx
|
dec dword [esp]
|
||||||
jns .maindir_loop
|
jns .maindir_loop
|
||||||
dec ebp
|
dec ebp
|
||||||
js .maindir_loop
|
js .maindir_loop
|
||||||
@ -142,15 +143,27 @@ file_system_lfn:
|
|||||||
@@:
|
@@:
|
||||||
pop eax
|
pop eax
|
||||||
add al, '0'
|
add al, '0'
|
||||||
stosw
|
stosb
|
||||||
|
test bl, 1 ; UNICODE name?
|
||||||
|
jz .ansi2
|
||||||
|
mov byte [edi], 0
|
||||||
|
inc edi
|
||||||
|
.ansi2:
|
||||||
|
test al, al
|
||||||
jnz @b
|
jnz @b
|
||||||
mov byte [edi-1], 0
|
mov byte [edi-1], 0
|
||||||
pop edi
|
pop edi
|
||||||
|
; UNICODE name length is 520 bytes, ANSI - 264
|
||||||
add edi, 520
|
add edi, 520
|
||||||
|
test bl, 1
|
||||||
|
jnz @f
|
||||||
|
sub edi, 520-264
|
||||||
|
@@:
|
||||||
pop edx eax
|
pop edx eax
|
||||||
jmp .maindir_loop
|
jmp .maindir_loop
|
||||||
.maindir_done:
|
.maindir_done:
|
||||||
mov ebx, [edx+8]
|
pop eax
|
||||||
|
mov ebx, [edx+4]
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
dec ebp
|
dec ebp
|
||||||
js @f
|
js @f
|
||||||
@ -173,9 +186,10 @@ file_system_lfn:
|
|||||||
mov ebp, [ebx+12]
|
mov ebp, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
add edx, std_application_base_address
|
||||||
mov ebx, [ebx+4]
|
push dword [ebx+4] ; first block
|
||||||
|
mov ebx, [ebx+8] ; flags
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
; eax=0, ebx=first block, ebp=number of blocks, edx=return area
|
; eax=0, [esp]=first block, ebx=flags, ebp=number of blocks, edx=return area
|
||||||
mov edi, edx
|
mov edi, edx
|
||||||
mov ecx, 32/4
|
mov ecx, 32/4
|
||||||
rep stosd
|
rep stosd
|
||||||
@ -190,13 +204,13 @@ file_system_lfn:
|
|||||||
.readroot_next:
|
.readroot_next:
|
||||||
or ecx, -1
|
or ecx, -1
|
||||||
xchg esi, edi
|
xchg esi, edi
|
||||||
repnz scasw
|
repnz scasb
|
||||||
xchg esi, edi
|
xchg esi, edi
|
||||||
jmp .readroot_loop
|
jmp .readroot_loop
|
||||||
@@:
|
@@:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc dword [edx+8]
|
inc dword [edx+8]
|
||||||
dec ebx
|
dec dword [esp]
|
||||||
jns .readroot_next
|
jns .readroot_next
|
||||||
dec ebp
|
dec ebp
|
||||||
js .readroot_next
|
js .readroot_next
|
||||||
@ -208,15 +222,24 @@ file_system_lfn:
|
|||||||
rep stosd
|
rep stosd
|
||||||
push edi
|
push edi
|
||||||
@@:
|
@@:
|
||||||
lodsw
|
lodsb
|
||||||
stosw
|
stosb
|
||||||
|
test bl, 1
|
||||||
|
jz .ansi
|
||||||
|
mov byte [edi], 0
|
||||||
|
inc edi
|
||||||
|
.ansi:
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jnz @b
|
jnz @b
|
||||||
pop edi
|
pop edi
|
||||||
add edi, 520
|
add edi, 520
|
||||||
|
test bl, 1
|
||||||
|
jnz .readroot_loop
|
||||||
|
sub edi, 520-264
|
||||||
jmp .readroot_loop
|
jmp .readroot_loop
|
||||||
.readroot_done:
|
.readroot_done:
|
||||||
mov ebx, [edx+8]
|
pop eax
|
||||||
|
mov ebx, [edx+4]
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
dec ebp
|
dec ebp
|
||||||
js @f
|
js @f
|
||||||
|
@ -4888,7 +4888,7 @@ align 4
|
|||||||
sys_apm:
|
sys_apm:
|
||||||
cmp word [apm_vf], 0 ; Check APM BIOS enable
|
cmp word [apm_vf], 0 ; Check APM BIOS enable
|
||||||
jne @f
|
jne @f
|
||||||
or [esp + 40], byte 1 ; error
|
or [esp + 56], byte 1 ; error
|
||||||
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported
|
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -4897,13 +4897,13 @@ sys_apm:
|
|||||||
|
|
||||||
cmp al, 3
|
cmp al, 3
|
||||||
ja @f
|
ja @f
|
||||||
and [esp + 40], byte 0xfe ; emulate func 0..3 as func 0
|
and [esp + 56], byte 0xfe ; emulate func 0..3 as func 0
|
||||||
mov eax, [apm_vf]
|
mov eax, [apm_vf]
|
||||||
mov [esp + 36], eax
|
mov [esp + 36], eax
|
||||||
shr eax, 16
|
shr eax, 16
|
||||||
mov [esp + 32], eax
|
mov [esp + 32], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@: call pword [apm_entry] ; call APM BIOS
|
@@: call pword [apm_entry] ; call APM BIOS
|
||||||
mov [esp + 8 ], edi
|
mov [esp + 8 ], edi
|
||||||
mov [esp + 12], esi
|
mov [esp + 12], esi
|
||||||
@ -4912,8 +4912,8 @@ sys_apm:
|
|||||||
mov [esp + 32], ecx
|
mov [esp + 32], ecx
|
||||||
mov [esp + 36], eax
|
mov [esp + 36], eax
|
||||||
setc al
|
setc al
|
||||||
and [esp + 40], byte 0xfe
|
and [esp + 56], byte 0xfe
|
||||||
or [esp + 40], al
|
or [esp + 56], al
|
||||||
ret
|
ret
|
||||||
; -----------------------------------------
|
; -----------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user