CHS, LBA, performance (was: ELF Bootloader)

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

CHS, LBA, performance (was: ELF Bootloader)

Post 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?
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: ELF Bootloader

Post 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.
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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.
rdos
Member
Member
Posts: 3271
Joined: Wed Oct 01, 2008 1:55 pm

Re: ELF Bootloader

Post 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.
rdos
Member
Member
Posts: 3271
Joined: Wed Oct 01, 2008 1:55 pm

Re: ELF Bootloader

Post 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.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: ELF Bootloader

Post by Combuster »

SparrowOS wrote:And CHS is faster still! because... the drive doesn't have to do the math.
Proof wanted.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: ELF Bootloader

Post 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.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: ELF Bootloader

Post 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.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: ELF Bootloader

Post 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.
Last edited by Combuster on Mon Nov 19, 2012 6:49 am, edited 1 time in total.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: ELF Bootloader

Post 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.
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
SparrowOS
Member
Member
Posts: 72
Joined: Wed Nov 14, 2012 5:22 pm
Location: Vegas
Contact:

Re: ELF Bootloader

Post 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?
Post Reply