Re: QESTION For Real Kernel Hackers. ATA IDENTIFY DATA & NT/2K

> I shall simplify a question:

I have only IDENTIFY DATA buffer. And i want to count up a
HDD size. It is possible or not?

For LBA mode disks, UserAddressableSectors is the thing.
For CHS mode - C*H*S is the thing.
Use:

if( ( C == 16383 ) && ( H == 16 ) && ( S == 63 ) )

  • as a condition for a LBA-mode disk.

This is how NT4SPx works.

I have NT4SP6 and the following drives:

C2490 H16 S63
UserAddressableSectors 2511840

  • 1.2GB disk (it is in CHS mode) - and:

C16383 H16 S63
UserAddressableSectors 26688576

  • 13GB disk in LBA mode - not listed in the BIOS at all.

Note that all disks larger then 8GB will have C16383 H16 S63.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> If no - then why not query

the system’s ATA driver for the disk IDENTIFY data?

My method is faster.

My first objection is - no. :-)))
You access the hardware registers over the PCI bus. This is slow.
Querying ATA driver will result in returning the stored IDENTIFY data from
the ATA driver’s device extension without touching any hardware.

My second objection is - only the device’s driver can touch the device
hardware.
Only. No other code must do this. This can hinder the driver from the normal
work.
This is a rather fundamental principle which must not be violated.

BTW - if you need the disk size only, not the whole IDENTIFY data, then
sending SCSIOP_READ_CAPACITY will be a thing to do.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com