[PATCH] Drives above 64GB

Tomasz Przygoda (tprzyg@securities.com)
Sun, 01 Nov 1998 14:40:32 -0500


Hi,

I assume it's going to be more and more often that people have drives
bigger than 64GB, unfortunately there's one (at least one, that I spot):
scsicam_bios_param - the parameters calculated there (number of sectors,
heads and cylinders) are only integer, whereas these days the number of
cylinders may go above 65535. I don't know if this is the best way to
fix the "problem", but:
1. It fixes the problem I had (tested).
2. Doesn't change the type of the structure (actually array) that holds
the the values.

I hope either this, or something similar can make it into the kernel
(both 2.0.x and 2.1.x are affected).

The patch below should work for up to 502GB.

--- linux/drivers/scsi/scsicam.c.orig Mon Jun 29 15:33:48 1998
+++ linux/drivers/scsi/scsicam.c Mon Jun 29 15:32:58 1998
@@ -45,6 +45,7 @@
struct buffer_head *bh;
int ret_code;
int size = disk->capacity;
+ unsigned long temp_cyl;

if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, 1024)))
return -1;
@@ -67,6 +68,11 @@
if (ret_code || ip[0] > 255 || ip[1] > 63) {
ip[0] = 64;
ip[1] = 32;
+ temp_cyl = size / (ip[0] * ip[1]);
+ if (temp_cyl > 65535) {
+ ip[0] = 255;
+ ip[1] = 63;
+ }
ip[2] = size / (ip[0] * ip[1]);
}

Thanks!

-- Tomek,
"In theory there's no difference between theory and practice, but in practice...."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/