mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +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:
|
||||
push ecx
|
||||
; 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 es,bx
|
||||
xor bx,bx ; We will load it to [7000:0000h]
|
||||
mov cx,1
|
||||
call ReadSectors
|
||||
|
||||
LoadFatSectorAlreadyLoaded:
|
||||
mov bx,7000h
|
||||
mov es,bx
|
||||
pop ecx
|
||||
|
@ -439,6 +446,9 @@ LoadFatSector:
|
|||
|
||||
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]
|
||||
ReadCluster:
|
||||
|
|
Loading…
Reference in a new issue