Page 1 of 3
CHS, LBA, performance (was: ELF Bootloader)
Posted: Sun Nov 18, 2012 6:08 am
by SparrowOS
Yoda wrote:SparrowOS wrote:When faced with the problem of boot loaders for FAT32, EXT2, EXT3, EXT4, NTFS, Reiser, I had a brilliant idea! I'll write one bootloader that uses a fixed-block address and when I install my operating system, I'll patch the block address and make sure it is contiguous.
This will work until first disk defragmentation with making free space contiguous or until moving/copying/overwriting the file with bootloader.
SparrowOS wrote:I also do a minimum in my bootloaders, pushing work forward to a place without a size limit. Why do work in a boot-loader that has a 512 byte limit?
Till now the space in boot areas of at least FAT12/16/32/NTFS/Ext2/3 file systems is quite enough in case of PC architecture to boot file placed in root directory and located anywhere in the disk, even beyond 2TB limit.
How's that CHS workin for you? There's something wrong with 13h 42, am I right?
Re: ELF Bootloader
Posted: Sun Nov 18, 2012 10:16 am
by Yoda
SparrowOS wrote:How's that CHS workin for you? There's something wrong with 13h 42, am I right?
CHS addressing is used only if BIOS doesn't support LBA addressing for the drive or for access within CHS capacity limit (approximately 8GB). CHS geometry must be obtained from BIOS.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 12:38 am
by SparrowOS
Yoda wrote:SparrowOS wrote:How's that CHS workin for you? There's something wrong with 13h 42, am I right?
CHS addressing is used only if BIOS doesn't support LBA addressing for the drive or for access within CHS capacity limit (approximately 8GB). CHS geometry must be obtained from BIOS.
ROFLMAO
Dude! LBA28 is 5-years out dated. LBA48 is what you need!
I'll bet your 286 support is not very good.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 1:48 am
by rdos
Yoda wrote:SparrowOS wrote:How's that CHS workin for you? There's something wrong with 13h 42, am I right?
CHS addressing is used only if BIOS doesn't support LBA addressing for the drive or for access within CHS capacity limit (approximately 8GB). CHS geometry must be obtained from BIOS.
Not from BIOS, but from the drive itself. Disk drives has a "Get Parameters" command which returns the properties of the drive, including CHS parameters and LBA support.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 1:50 am
by rdos
SparrowOS wrote:
Dude! LBA28 is 5-years out dated. LBA48 is what you need!
The disk drive "Get Parameters" will also indicate support for LBA48. In general, there is no need to use LBA48 unless the drive is sufficiently large, since using LBA24 is faster.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 2:14 am
by SparrowOS
rdos wrote:SparrowOS wrote:
Dude! LBA28 is 5-years out dated. LBA48 is what you need!
The disk drive "Get Parameters" will also indicate support for LBA48. In general, there is no need to use LBA48 unless the drive is sufficiently large, since using LBA24 is faster.
And CHS is faster still! because... the drive doesn't have to do the math.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 2:29 am
by Combuster
SparrowOS wrote:And CHS is faster still! because... the drive doesn't have to do the math.
Proof wanted.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 2:45 am
by SparrowOS
Combuster wrote:SparrowOS wrote:And CHS is faster still! because... the drive doesn't have to do the math.
Proof wanted.
I was mocking him.
Why would 28-bit be faster than 48-bit?
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 5:15 am
by bluemoon
So, you are just trolling without knowing "Why would 28-bit be faster than 48-bit" - you did not proof anything, propose anything, just to raise the idea that "you are wrong" but without even got any reason that it might be wrong?
Ok, calculating 48 bit address in 32-bit OS require the use of 2 registers, it also require more memory or disk storage area to hold the extra bits compared to LBA28, so it may be is perfered for small disk under some situations. Sure there may be exceptional cases but I would not say either one is bad.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 5:25 am
by SparrowOS
bluemoon wrote:So, you are just trolling without knowing "Why would 28-bit be faster than 48-bit" - you did not proof anything, propose anything, just to raise the idea that "you are wrong" but without even got any reason that it might be wrong?
Ok, calculating 48 bit address in 32-bit OS require the use of 2 registers, it also require more memory or disk storage area to hold the extra bits compared to LBA28, so it may be is perfered for small disk under some situations. Sure there may be exceptional cases but I would not say either one is bad.
CHS is faster still, because the drive doesn't have to calculate geometry.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 5:30 am
by bluemoon
Proof wanted.
My counter-proof: modern hard disk uses LBA internally since CHS cannot address more than 2G disk space with 512B sectors. Whether this LBA would be further broken down into a somewhat internal CHS(different to BIOS CHS) or any block address(eg. for SSD) is irrelevant to the caller.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 5:44 am
by SparrowOS
bluemoon wrote:Proof wanted.
My counter-proof: modern hard disk uses LBA internally since CHS cannot address more than 2G disk space with 512B sectors. Whether this LBA would be further broken down into a somewhat internal CHS(different to BIOS CHS) or any block address(eg. for SSD) is irrelevant to the caller.
Modern hard drives are larger than 130GB, so they use LBA48.
You understand, now?
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 6:43 am
by Combuster
I understand that you are covering up the fact that you lied by attempting to post something unrelated to your original citation.
I think I'm going to publicly resent the staff's choice to give you a new chance over your permban because frankly, I still see you breaking forum rules every other post.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 6:48 am
by Yoda
SparrowOS wrote:Dude! LBA28 is 5-years out dated. LBA48 is what you need!
Where did I say something about LBA28? I use LBA48.
I'm talking about bootloader, not about disk driver. For that purposes CHS addressing is still acceptable keeping in mind it's limitations. Moreover, in some cases it is the only available way to access the drive through the BIOS. I know the BIOSes (yes, old, but still working hardware) that report inavailability of LBA addressing when booting from USB flash drives.
SparrowOS wrote:I'll bet your 286 support is not very good.
I forgot for many years about existence of hardware based on something earlier than 386. 286 is only in my CPU collection.
Re: ELF Bootloader
Posted: Mon Nov 19, 2012 7:17 am
by SparrowOS
bluemoon wrote:Proof wanted.
My counter-proof: modern hard disk uses LBA internally since CHS cannot address more than 2G disk space with 512B sectors. Whether this LBA would be further broken down into a somewhat internal CHS(different to BIOS CHS) or any block address(eg. for SSD) is irrelevant to the caller.
Modern hard drives use CHS internally, otherwise how would they access cylinder, head, sector?