I apologize beforehand
for the long post.
Blame a certain
person for insinuating that I may have problems in learning or am a
bozo not to recognize why 386
machines can't deal with LBA (as if it mattered).
Especially when it comes from
a so-called expert who is clearly ill informed. Jeez!!
So I go set out who the real
BOZO is. AND I DO IT THOUROUGHLY.
My comments are recognized by
my initials (FR)
Red is
traditional CHS, blue is CHS translation and
green is Logical Block Addressing.
Best viewed this
wide:
--!---------!---------!---------!---------!---------!---------!---------!---------!---------!--
Information Technology
-
AT Attachment with
Packet Interface - 6
(ATA/ATAPI-6)
6.2 Register delivered data
transfer command sector addressing
For register delivered data transfer commands all addressing of data
sectors recorded on the device's media
is by a logical sector address. There is no implied relationship between
logical sector addresses and the
actual physical location of the data sector on the media.
Devices shall support translations as described
below:
-All devices shall
support LBA translation.
-
If the device’s capacity is greater than or
equal to one sector and less than or equal to
16,514,064 (8GB, FR)
sectors, then the device shall support CHS
translation.
-
If the device’s capacity is greater
than 16,514,064 (8GB,FR) sectors, the device
may support
CHS
translation.
-
If a device supports CHS translation, then,
following a power-on or hardware reset, the CHS
translation enabled by the device shall be the default
translation.
-
If a device supports CHS
translation, a device may allow a host to use the
INITIALIZE DEVICE
PARAMETERS command to select other CHS translations (called current translation, FR).
-If a device supports CHS translation, IDENTIFY DEVICE words
1,3, and 6 shall describe the
default translation, and words 53-58 shall
describe the current translation.
A CHS address is made up of three fields: the sector number, the head
number, and the cylinder number.
Sectors are numbered from 1 to the maximum value allowed by the current CHS
translation but shall not
exceed 255. Heads are numbered from 0 to the maximum value allowed by the
current CHS translation but
shall not exceed 15. Cylinders are numbered from 0 to the maximum value
allowed by the current CHS
translation but shall not exceed 65,535.
When the host selects a CHS translation using the INITIALIZE DEVICE
PARAMETERS command, the host
requests the number of sectors per logical track and the number of heads
per logical cylinder. The device
then computes the number of logical cylinders available in the requested
translation.
A device shall not change the addressing method specified by the command
and shall return status
information utilizing the addressing method specified for the
command.
Page 21-22
T13/1410D revision 0a
Annex C
(informative)
Identify device data for devices with more than 1024 logical
cylinders
C.1 Definitions and background information
The original IBM PC BIOS
(Basic Input/Output System) imposed several restrictions on the support
of
devices, and these have been incorporated into many
higher level software products. One such restriction
limits the capacity of a device. BIOS software
cannot support a device with more than 1,024
cylinders, 16
heads, and 63
sectors per track without
translating an input logical geometry to a different output
logical
geometry. The maximum addressable capacity of a device that does not require
BIOS translation
is
1,032,192
sectors.(That is
528 MB, FR.)
These rules allow BIOSes using bit shifting translation to access 15,481,935 (16,38
3/15/63)
(That
is 8GB, FR) sectors, and BIOSes using LBA
assisted translation to access 16,450,560
(1024/255/63) (Again 8GB, FR.) sectors.
Extended BIOS functionality is defined
in BIOS Enhanced Disk Drive (EDD), NCITS TR-21, which describes
new services provided by BIOS firmware
to support ATA hard disks up to 16 mega-terra-sectors.
C.2 Cylinder, head, and sector addressing
BIOSs and other software that operate a
device in CHS translation employ a combination of IDENTIFY
DEVICE data words 1, 3, 6, words 53-58, and words 60-61 to ascertain the
appropriate translation to use and
determine the capacity of a device.
Maximum compatibility is facilitated if the following guidelines are used.
These guidelines limit the values
placed into words 1, 3, 6, 53-58, and 60-61.
Accessing beyond 15,481,935 sectors
(8GB, FR) should be
performed using LBA.
C.2.1 Word 1
For devices with a capacity less than or equal to 1,032,192 sectors, if
IDENTIFY DEVICE data word
1 (Default Cylinders) does not specify a value greater than 1,024, then no
guideline is necessary.
If a device is greater than 1,032,192
sectors, but less than or equal to 16,514,064
sectors,
(528MB-8GB, FR) the
maximum value that can be placed into this word is determined
by the value in word 3 as shown in table C.1. (we're still talking CHS here, FR)
If a device is greater than 15,481,935
sectors and supports CHS, this word should contain
16,383 (3FFFh).
The INITIALIZE DEVICE PARAMETERS command does not change this value.
The value in this word is changed by the SET MAX ADDRESS command.
Page 341
T13/1410D revision 0a
Table C.1
-Word 1
value for devices between 1,032,192 and 16,514,064 sectors
Value in word 3
Maximum value in word 1
1 1h 65,535
FFFFh
2 2h 65,535
FFFFh
3 3h 65,535
FFFFh
4 4h 65,535
FFFFh
5 5h 32,767
7FFFh
6 6h 32,767
7FFFh
7 7h 32,767
7FFFh
8 8h 32,767
7FFFh
9 9h 16,383
3FFFh
10 Ah 16,383
3FFFh
11 Bh 16,383
3FFFh
12 Ch 16,383
3FFFh
13 Dh 16,383
3FFFh
14 Eh 16,383
3FFFh
15 Fh 16,383
3FFFh
16 10h 16,383
3FFFh
C.2.2 Word 3
IDENTIFY DEVICE data word 3 (Default Heads) does not
specify a value greater than 16. If the device has
less than or equal to 8,257,536 sectors, then set word 3
to 16 heads. If the device has more than 16,514,064
sectors, then set word 3 to 15 heads. If this value is set
to 16 when the device has more than 16,514,064
sectors, some systems will not boot some operating
systems.
The INITIALIZE DEVICE PARAMETERS command does not change
this value.
C.2.3 Word 6
If the device is above 1,032,192 sectors then the value
should be 63. This value does not exceed 63 (3Fh).
The INITIALIZE DEVICE PARAMETERS command does not change
this value.
C.2.4 Use of words 53 through 58
Devices with a capacity over
1,032,192 sectors implement words 53-58. Devices with a capacity
less
than or equal to 1,032,192 sectors (528 MB, FR) may also
implement these words.
These words define the address range for all
sectors accessible in CHS mode under 16,514,064.
(0<=8GB, F.R.)
The product of word 54, word 55, and word 56 must not exceed 16,514,064.
(note that we're talking still CHS
here, F.R.).
C.2.5 Words 60-61
IDENTIFY DEVICE data words 60-61
contain a 32-bit value that is equal to the total number of sectors
that can be accessed using
LBA. If the device is less than or
equal to 15,481,935 sectors, this value
should
be the
product of words 1,
3, and 6. Setting the total number of LBA sectors in this manner
reduces
the probability of conflicting device capacities being calculated by different operating
systems.
Page 342
T13/1410D revision 0a
C.3 Orphan sectors
The sectors, if any, between the last sector
addressable in CHS mode and the last sector addressable in
LBA mode are known as
"orphan" sectors. A device may or may not allow access to these sectors in
CHS
addressing mode.
The values in words 1, 3, and 6 are selected such that the
number of orphan sectors is minimized. Normally,
the number of orphan sectors should not exceed ( [word55]
x [word56] - 1 ). However, the host system may
create conditions where there are a larger number of
orphans sectors by issuing the INITIALIZE DEVICE
PARAMETERS command with values other than the values in
words 3 and 6. If the recommendation in C.2.5
is followed, there will be no orphan sectors and problems
associated with new operating systems calculating
a different device size from older operating systems will
be minimized.
Page 343
Working T13
Draft D1386
Revision 1
August 23, 1999
Information Technology -BIOS
Enhanced Disk Drive Services (EDD)
4 Overview
In the past, DOS has accessed its mass storage devices using a BIOS
provided INT 13 interface.
This interface was designed in the early 1980’s and upgraded in the late
1980’s. The maximum
theoretical capacity of this API is 8.4
giga-bytes. This INT 13 interface, now known as the
legacy INT 13 interface,
uses function numbers 1-15h and is Cylinder-Head-Sector (CHS) oriented.
An extended INT 13 interface has been created, the purpose of these Int 13h extensions is
to:
·
Replace CHS addressing with Logical Block
Addressing (LBA).
·
Remove the current requirement of using
interrupt 41h/46h to point at the Fixed Disk Parameter Table
information.
·
Give the BIOS better control over how this
data is used.
·
Make location and configuration
information available to operating systems that do not use the BIOS to
access mass storage devices.
·
Use data structures that apply to both
IA-32 and IA-64 architecture systems.
·
Use data structures that can address media
capacities for the next 20 years.
Page 14
From Phoenix/Microfirmware
(partial):
Some Notes on LBA
Filename: LBA.TXT
WWW URL: http://www.firmware.com/support/bios/lba.htm
If used by operating systems and applications on the
software side of the BIOS as well
as by the drive on the hardware
side of the BIOS, LBA can be a more efficient way to
address hard drives than the CHS
(Cylinder, Head, Sector) method of addressing.
It may be awhile before this becomes widely used by
hardware, BIOSes, and software.
In the meantime it isn't necessarily a performance
increase to use LBA and may even be
less efficient. There is widespread confusion throughout
the industry on the subject of LBA
and BIOS support for large drives - may people mistakenly
think these to be the same thing.
Most drives that support LBA do not require that LBA is
used and LBA addressing is not
normally required in order for a BIOS to support large
drives.
What is required to support large drives is a translating BIOS.
There are two widely used translation algorithms used in
PC BIOSes to support large drives.
One kind is called Extended CHS (ECHS,
also called CHS to CHS and sometimes called
"bit-shift").
In some BIOSes, this translation type is refered to as "Large".
This type of translation works by halving the cylinder
count and doubling the head count
until the cylinder count is 1024 or less. The other main
type of translation used is called
LBA Assist or Assisted LBA, often just called LBA.
See our document OVER4GB.TXT for more details on these
translation methods.
LBA addressing has always been used on SCSI drives. IDE
drives began to use LBA
addressing as an option at about the same time that large
(over 504MB) IDE drives began
to appear. Most large IDE (or EIDE) drives support LBA
mode. Normally, LBA mode is
optional on drives that support it.
To use LBA addressing it must be implemented in the BIOS
as well as by the hard drive.
In order for LBA mode to be used on the software side of
the BIOS, the operating system
or application must support the new "INT13 extensions" and
the BIOS must also support
INT13 extensions.
Now to conclude the above (FR):
Translation modes are called Extended CHS (ECHS, also called CHS to CHS and
sometimes called "bit-shift") (or Large) or LBA(assist). They all use CHS
for
above 528 MB.
Drives may use LBA but the bios may still use CHS using CHS translation on
the
OS/application side. (This is also the default for SCSI below 8 GB).
"Real" LBA uses LBA mode throughout: drive and bios and
OS/application.
up to 528 MB, 4 and 8GB, CHS values are stored in Identify Device
words 1, 3
and 6 according to specific rules which differ for the different
capacities:
"Normal" for up to 528MB, "ECHS" for 4 and 8 GB and "LBA assist"
for up to 8GB.
Capacity is calculated by the host from CHS or can be gained from words
60-61 as
calculated by the device from CHS (if available).
An alternative translation can be ordered by specifying H and S so
the device
can calculate C, the results are stored in words 54 - 56. It is
volatile.
A different set of rules apply here, just limiting H to 15 and C to
65,535.
Capacity shall not exceed 8 GB, is calculated by the device in sectors and
is stored
in words 57 - 58.
up to 138 GB LBA capacity in sectors is found in words 60 and 61.
All this assuming no set max address was issued to shortstroke the
drive.
Now, this is all nicely documented for the drive-bios interface.
One can select a preferred translation mode in the bios setup.
Unfortunately current OSs use drivers that directly interface with the
hardware.
That poses an interresting question: What mode(s) will a driver use?
Other comments interspersed with the original post:
--
:
"Folkert Rienstra" <
s...@replyaddress.nl> wrote:
: >
"Zvi Netiv" <
z...@invircible.com>
wrote in message
: > : "Norton" <
nor...@chartertn.net> wrote:
:
: > : > I have a 640MB hard drive, fdisk likes it, BIOS likes, but
when I format it
: > : > claims to only be a 504MB hard drive. I have
tried a boot disk from
: > : > Windows98(FAT32) and DOS(FAT16) with the
same results. I also tried a 1.6GB
: > : > hard drive, same thing, but
this time format thought it was 1.2GB or something.
:
: > : 504 mb is
the capacity limit recognized by old BIOSes, with no LBA support.
:
: > I don't think so, although there is quite some confusion over this
matter
: > and changing one word makes it right again (support ->
assist).
:
: I'm afraid that your corrections add more confusion than
"assist". ;)
Yup. The material is highly complex so that is a BIG possibility.
:
: > As I understand it LBA support emerged at the same time as
the 504MB
: > CHS limit emerged. Drives over 504 MB still supported CHS
but used a
: > different translation called ECHS or LARGE or LBA
Assist.
: > It seems the latter was also called LBA for short.
:
:
LBA stands for 'logical block access', there is no "assist" involved
there.
Read the post Zvi.
I mentioned the term 'LBA for short' in combination with a translation
bios,
not as an explanation of Logical Block Access.
Perhaps I would have been clearer if I had said 'wrongfully called LBA for
short'
Also read Hale Landis (strong) opinion on calling a
certain translation bios mode
"LBA mode".
: The 504 meg limit didn't "emerge" at any specific date, it was the
result of early
: IDE drives design, prior to the introduction of EIDE.
The use of LBA and its
: becoming standard in the BIOS predates the
appearance of large capacity drives
: (larger than 504 meg) by a few years.
Yes, SCSI and LBA were indeed available before that date. Duh!
:
: > As I understand it this still works with INT13 using
CHS.
: > Real LBA comes with INT13ext and became necessary IIRC over 8
GB
:
: There is no such thing as "real" and unreal LBA,
Yes Zvi, there is.
The correct term for 'unreal LBA' is Assisted LBA or LBA Assist and is used
for a
certain type of translating bios.
LBA is used for a non-translating bios.
IIRC it uses Logical Block Addressing on both sides of the bios.
: and logical block access is the natural addressing mode of IDE
drives ever since,
Nope, they used extended CHS by using a translating bios.
: although it wasn't called LBA till circa '93.
Which probably was a ECHS variation called "LBA assist".
: Extended Int 13 was introduced years after the introduction of LBA,
concurrently
: with the larger than 8 gig drives.
Thank you for acknowledging what I said originally.
: LBA didn't change nor become more "real" with extended Int
13. LBA didn't
: become necessary from 8 gig and up but from 504 meg and up.
Nope. CHS translation still uses CHS. Drives that use it
also CAN use LBA.
It is in the ATA specification. It would do you good to read them
sometimes.
: Otherwise why would it be necessary to use the
: EZ-Drive or Ontrack
boot overlay on larger than 504 meg drives with old BIOSes?
Because older bioses using the 'normal' CHS interface couldn't handle
CHS translation
perhaps? What do you think? Duh.
: If you were right then old 386's should be able to handle up to 8 gig
drives,
Indeed it would if that 386 bios would handle 'CHS Translation'.
I don't know if such a bios was ever available to a 386 PC. It's
irrelevant.
There have been a myriad of bios problems over time that
demanded the use of a
boot overlay, the 528MB limit is just one of them and has nothing to do
with LBA.
Only with over 8GB does LBA addressing enter the issue as there is no
alternative.
: with their CHS based BIOS. Yet every bozo knows that this is
crap.
Nope.
It appears that you are the bozo by not being aware of the
existence of translation
bioses and you are therefor spouting the crap.
:
: > but can of course be used at lower capacities too (504 and
up).
:
: Wrong again. LBA cannot be used from 504 and up, it MUST,
or you won't be able
: to access the full capacity of the drive.
Nope, you are the one being 'wrong again' and I have shown it in the top of
this post
several times where I backed up my claims.
Now, how about a nice fat apology to the Bozo.
:
: Regards, Zvi