support 512e drives. - capacity now automaticly uses capacity16 if there are too many sectors to be properly represented by capacity10. - capacity16 now recoginzes 512e extensions and prints the physical geometry as well as the logical geometry and the first aligned sector. e.g. block size: 512 capacity 7814037167 512 (976754645 4096 physical, first aligned sec 0) ok 32 Reference: /n/atom/patch/applied2013/scuzz512e Date: Thu Nov 14 17:54:47 CET 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/scuzz/scuzz.c Thu Nov 14 17:51:12 2013 +++ /sys/src/cmd/scuzz/scuzz.c Thu Nov 14 17:51:12 2013 @@ -1378,37 +1378,47 @@ } static long -capacity(ScsiReq *rp, int nbyte) +capacity16(ScsiReq *rp, int, char **) { uchar d[32]; - long n, r; + long n, r, l2p, align; uvlong i; - if(nbyte == 16){ - if((r = SRrcapacity16(rp, d)) == -1) - return -1; - i = GETBEVL(d); - n = GETBELONG(d + 8); - }else{ - if((r = SRrcapacity(rp, d)) == -1) - return -1; - i = GETBELONG(d); - n = GETBELONG(d + 4); - } - Bprint(&bout, " %llud %lud\n", i, n); + if((r = SRrcapacity16(rp, d)) == -1) + return -1; + i = GETBEVL(d); + n = GETBELONG(d + 8); + l2p = d[13] & 7; + if(l2p != 0){ + align = GETBE16(d+14) & 0x3fff; + Bprint(&bout, " %llud %lud (%llud %lud physical, first aligned sec %ld)\n", + i, n, i>>l2p, n<