Find all stage2 clusters
Posted: Tue Feb 01, 2011 6:41 pm
In tutorial 6 i can't understand the piece of code where we load file stage2 into memory.First of all how do we check if the next cluster to read is contiguous to the current one? In other words how do we know that the next contiguous cluster is the one we want to read and load?
code:
mov WORD [cluster], dx ; store new cluster
cmp dx, 0x0FF0 ; test for end of file
jb LOAD_IMAGE ; we are not done yet--go to next cluster
We just check for end-of-file, not where the next cluster to read is.
I don't understand this because i think that a file located at FAT is not at contiguous clusters but is fragmented.
Thanks in advance.
code:
mov WORD [cluster], dx ; store new cluster
cmp dx, 0x0FF0 ; test for end of file
jb LOAD_IMAGE ; we are not done yet--go to next cluster
We just check for end-of-file, not where the next cluster to read is.
I don't understand this because i think that a file located at FAT is not at contiguous clusters but is fragmented.
Thanks in advance.