mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Caches the current FAT sector so it doesn't read again if it doesn't have to.
svn path=/trunk/; revision=3047
This commit is contained in:
parent
65ae3074e9
commit
a89e08d368
1 changed files with 10 additions and 0 deletions
|
@ -426,11 +426,18 @@ GetActiveFatOffset:
|
||||||
LoadFatSector:
|
LoadFatSector:
|
||||||
push ecx
|
push ecx
|
||||||
; EAX holds logical FAT sector number
|
; EAX holds logical FAT sector number
|
||||||
|
; Check if we have already loaded it
|
||||||
|
cmp eax,DWORD [FatSectorInCache]
|
||||||
|
je LoadFatSectorAlreadyLoaded
|
||||||
|
|
||||||
|
mov DWORD [FatSectorInCache],eax
|
||||||
mov bx,7000h
|
mov bx,7000h
|
||||||
mov es,bx
|
mov es,bx
|
||||||
xor bx,bx ; We will load it to [7000:0000h]
|
xor bx,bx ; We will load it to [7000:0000h]
|
||||||
mov cx,1
|
mov cx,1
|
||||||
call ReadSectors
|
call ReadSectors
|
||||||
|
|
||||||
|
LoadFatSectorAlreadyLoaded:
|
||||||
mov bx,7000h
|
mov bx,7000h
|
||||||
mov es,bx
|
mov es,bx
|
||||||
pop ecx
|
pop ecx
|
||||||
|
@ -439,6 +446,9 @@ LoadFatSector:
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
FatSectorInCache: ; This variable tells us which sector we currently have in memory
|
||||||
|
dd 0ffffffffh ; There is no need to re-read the same sector if we don't have to
|
||||||
|
|
||||||
|
|
||||||
; Reads cluster number in EAX into [ES:0000]
|
; Reads cluster number in EAX into [ES:0000]
|
||||||
ReadCluster:
|
ReadCluster:
|
||||||
|
|
Loading…
Reference in a new issue