Page 1 of 1
LBA addresses used in a file system's structure
Posted: Thu Jul 12, 2007 12:40 am
by XCHG
I am now coding a program that formats my OS' HDD image in my own file system (SSFS). Now there are a lot of fields in my boot sector and Index Sector that will point to other areas in my file system and I am using LBA 28/48/64 addresses for those fields. Now I was wondering if absolute LBA addresses are more effective or should the addresses be relative? For example, in my boot sector where I have the LBA address of my Index Sector, should I put the LBA address of the Index Sector from the beginning of the media (LBA 0 ... x) or should I put the relative LBA address starting from my boot sector to ... x.
Anybody has any ideas which one is more efficient?
Posted: Thu Jul 12, 2007 6:52 am
by davidv1992
i guess absolute addresses would be faster, just because of the fact that you don't have to add another value to them before using.
Posted: Thu Jul 12, 2007 7:33 am
by mathematician
It is difficult to see any merit in relative addresses - the address you have to supply to the hardware is absolute.
Posted: Thu Jul 12, 2007 7:51 am
by JamesM
I don't know - relative addresses might allow dynamic moving of partitions
And one add instruction is totally negligible compared to the delay involved in reading/writing to the HDD.
Posted: Thu Jul 12, 2007 11:17 am
by XCHG
So suppose I am using Absolute LBA addresses and now I want to move a file from one partition to another. I should then just calculate the start (LBA) address of the destination partition and add it to the new location of the file in the new partition, right? But if I use relative addresses, I will either have to calculate almost nothing if the new partition has the space for the new file exactly where it was in the previous partition or I will have to calculate some more stuff if it doesn't. It's just a little confusing right now
Have any of you guys used any of these methods? could you explain why and why not? Thanks guys.