Are Windows & Linux Drivers That SLOW !! (AHCI)
Are Windows & Linux Drivers That SLOW !! (AHCI)
Hello, I've seen that from my successful AHCI Driver it took exactly 1100 ms to read 500 MB from the Hard Drive of an old laptop (Using 0x40000 Bytes per command and Mesured with HPET), ATA_IDENTIFY_DEVICE_DATA.ModelNumber = wdc wd3200bekt-75pvmt1 (Said 300 MB/S 7200 RPM). QEMU Took over 500-600 ms to read 500 MB which is very fast for some HDD. Is it an effect of native command queuing? Windows (and maybe Linux) are way slower than this !
Windows Crystal Disk Mark returns 98 MB/S.
Another Question! I want to know the number of sectors in the hard disk (it is 320 GB), when I read ATA_IDENTIFY_DEVICE_DATA.UserAccessibleSectors it returns only 131000 MB (Around 100GB).
Windows Crystal Disk Mark returns 98 MB/S.
Another Question! I want to know the number of sectors in the hard disk (it is 320 GB), when I read ATA_IDENTIFY_DEVICE_DATA.UserAccessibleSectors it returns only 131000 MB (Around 100GB).
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
There is a READ CAPACITY(16) command that will return the block size and the highest LBA. The product of both (OK, one more than highest LBA times block size) is the capacity of the device. Ought to be supported by most devices, as it is typically used by drivers to find the drive capacity. Also, it is the only thing that tells you the block size.devc1 wrote:Another Question! I want to know the number of sectors in the hard disk (it is 320 GB), when I read ATA_IDENTIFY_DEVICE_DATA.UserAccessibleSectors it returns only 131000 MB (Around 100GB).
Carpe diem!
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
I will try that, Thanks!
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
I have no idea which structure you're referring to there, but it sounds like you're talking about the value in words 60 and 61. That value is limited to 28 bits, which means 128 GiB for a drive with 512-byte sectors. Larger drives will report the maximum 48-bit LBA in words 100-103. I strongly suggest you read the draft of the ATA version supported by your drive to understand what information it reports.devc1 wrote:Another Question! I want to know the number of sectors in the hard disk (it is 320 GB), when I read ATA_IDENTIFY_DEVICE_DATA.UserAccessibleSectors it returns only 131000 MB (Around 100GB).
That's SCSI, not ATA.nullplan wrote:There is a READ CAPACITY(16) command
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Okay but that's not answering my question, why my driver reads the hard drive with almost 500 mb/s, the specs say it is 300 mb/s and windows benchmarks say it is 98 mb/s.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
There may be a problem with how you're using the timer to measure the transfer time, or you may be transferring less data than you think. SATA 3Gb/s is not physically capable of transferring more than 300MB per second.
-
- Member
- Posts: 426
- Joined: Tue Apr 03, 2018 2:44 am
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Are you doing this under QEMU?devc1 wrote:Okay but that's not answering my question, why my driver reads the hard drive with almost 500 mb/s, the specs say it is 300 mb/s and windows benchmarks say it is 98 mb/s.
Are you sure you're actually reading from the disk, and not from some virtual disk on the host filesystem, which may well be caching the data and thus giving you inflated read speeds?
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Yeah it is reading the disk using 0x40000 bytes per cmd, and I print some sectors. Qemu reads 500 mb in 500-650ms and in real hardware (my old mentionned laptop) it reads 500 mb in 1100 ms without Task File Errors.
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
My Drive Image in QEMU is only 32MB, Different commands from higher LBA doesn't Task File Error. This is weird ? I know QEMU Skips alot of checks but for this ??
-
- Member
- Posts: 426
- Joined: Tue Apr 03, 2018 2:44 am
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
QEMU is probably using a sparse file, reading blank media that has not yet been written as blocks of zeroes. Hence the seemingly high performance in your test, it's using constant data.devc1 wrote:My Drive Image in QEMU is only 32MB, Different commands from higher LBA doesn't Task File Error. This is weird ? I know QEMU Skips alot of checks but for this ??
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Congratulations, you've found a QEMU bug.devc1 wrote:My Drive Image in QEMU is only 32MB, Different commands from higher LBA doesn't Task File Error. This is weird ? I know QEMU Skips alot of checks but for this ??
I wonder if you can use this bug to bypass hypervisor security...
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Mr. Octoconbrass, can you provide further information ?
I'm now in a vacation and I'll be there in the next 2 weeks, I don't really know what you're talking about (hypervisor security...), do you mean running kernel mode code in Windows ? Or writing system files ? Or logging through users without password ? This is interesting right ??
I'm now in a vacation and I'll be there in the next 2 weeks, I don't really know what you're talking about (hypervisor security...), do you mean running kernel mode code in Windows ? Or writing system files ? Or logging through users without password ? This is interesting right ??
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
I mean simpler things, like crashing QEMU or making your disk image grow bigger than 32MB. Probably nothing as exciting as you're imagining.
Re: Are Windows & Linux Drivers That SLOW !! (AHCI)
Okay I'm gonna try that, what does this have with "hypervisor security". And can u answer the question in the last forum "High performance graphics for all GPUS.."