LBA addresses used in a file system's structure

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

LBA addresses used in a file system's structure

Post 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?
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
davidv1992
Member
Member
Posts: 223
Joined: Thu Jul 05, 2007 8:58 am

Post 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.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Post by mathematician »

It is difficult to see any merit in relative addresses - the address you have to supply to the hardware is absolute.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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.
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post 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 :roll:

Have any of you guys used any of these methods? could you explain why and why not? Thanks guys.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Post Reply