2001-12-25 10:56:29

by Josep Lladonosa i Capell

[permalink] [raw]
Subject: 2.4.x kernels, big ide disks and old bios

Hello,

the problem is this:

bios only supports disks up to 32 Gb.

hard disk is 60 Gb.

kernel is 2.4.17

hard disk reports its correct size when reading parameters from the
disk, not from the bios

verd:/proc/ide/hdc# cat geometry
physical 65530/16/63
logical 119150/16/63


when booting (dmesg):

hdc: IC35L060AVER07-0, ATA DISK drive
hdc: 66055247 sectors (33820 MB) w/1916KiB Cache, CHS=119150/16/63,
UDMA(33)


Linux adopts the 'false' geometry (65530/16/63) ) to bypass the bios
boot.



I know that there are patches for 2.2 kernels and 2.3 kernels, so as
linux adopts the logical geometry (a kiddy trick with lba size). They
are very simple (a line), but 2.4 ide implementation is (a little more)
complicated. Any patch?

Bon Nadal - Merry Christmas

--
Salutacions...Josep
http://www.geocities.com/SiliconValley/Horizon/1065/
--




2001-12-25 14:10:53

by Santiago Garcia Mantinan

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

> bios only supports disks up to 32 Gb.
> hard disk is 60 Gb.

What I'm using is change the geometry after the boot and before any
partition besides root is mounted, I do this at the beginning of
checkroot.sh by calling "/sbin/setmax -d 0 /dev/hda" but you can do it on
your own script or where ever you want, just taking care that it is done
befor any FS that goes above the 32gigs is accessed.

Setmax is a small program that I downloaded from the net, sorry, I don't
remember where did I download it from or his author, but it was posted to
this list some time ago, I have a version for the 2.4 kernel at
ftp.manty.net/linux/programs/setmax.c

This works ok for me, of course you can have other solutions.

Regards...
--
Manty/BestiaTester -> http://manty.net

2001-12-25 16:38:31

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Josep Lladonosa i Capell:

> Linux adopts the 'false' geometry (65530/16/63) ) to bypass the bios
> boot.

You can see that this is the wrong way around.
When you start your computer, first the BIOS boots, then Linux.
But maybe you mean to say that you set a jumper on the disk
so as to bypass the BIOS boot problem, and that as a result
also Linux sees a smaller disk?

> hdc: IC35L060AVER07-0, ATA DISK drive
> hdc: 66055247 sectors (33820 MB) w/1916KiB Cache, CHS=119150/16/63,

Funny. Where did this CHS come from? Did you give boot parameters?

> setmax.c does its job for my ide ibm - 60Gb, but kernel
> leaves bios parameters - 32Gb

Can you be more explicit? What precisely do you do?
Call setmax in a boot script? And afterwards you can access
the entire disk, but some proc files still mention the old
geometry? Or are there any real problems?
What precisely do you mean by "kernel leaves bios parameters"?


Santiago Garcia Mantinan:

: What I'm using is change the geometry after the boot and before any
: partition besides root is mounted, I do this at the beginning of
: checkroot.sh by calling "/sbin/setmax -d 0 /dev/hda"
: This works ok for me, of course you can have other solutions.

Good to hear that it works OK. Sooner or later setmax or something
similar must become part of the standard kernel, but so far I've
gotten almost no feedback. Can you give the disk manufacturer and model
(mail [email protected])?

Andries

2001-12-25 19:40:52

by James Stevenson

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Hi

i have the same problem weith a 40GB disk
its not a linux problem but a bios / disk problem

my workaround:

dont set the jumper on the disk to make it look smaller.
this however will stop it working in the bios so you need to
disable the disk in the bios completly and turn off the ide
auto detection process in the bios this is because it will
probably hang if you try to use it :)

linux will then pick the disk up from the ide controller.

----- Original Message -----
From: "Josep Lladonosa i Capell" <[email protected]>
To: <[email protected]>
Sent: Tuesday, December 25, 2001 10:56 AM
Subject: 2.4.x kernels, big ide disks and old bios


> Hello,
>
> the problem is this:
>
> bios only supports disks up to 32 Gb.
>
> hard disk is 60 Gb.
>
> kernel is 2.4.17
>
> hard disk reports its correct size when reading parameters from the
> disk, not from the bios
>
> verd:/proc/ide/hdc# cat geometry
> physical 65530/16/63
> logical 119150/16/63
>
>
> when booting (dmesg):
>
> hdc: IC35L060AVER07-0, ATA DISK drive
> hdc: 66055247 sectors (33820 MB) w/1916KiB Cache, CHS=119150/16/63,
> UDMA(33)
>
>
> Linux adopts the 'false' geometry (65530/16/63) ) to bypass the bios
> boot.
>
>
>
> I know that there are patches for 2.2 kernels and 2.3 kernels, so as
> linux adopts the logical geometry (a kiddy trick with lba size). They
> are very simple (a line), but 2.4 ide implementation is (a little more)
> complicated. Any patch?
>
> Bon Nadal - Merry Christmas
>
> --
> Salutacions...Josep
> http://www.geocities.com/SiliconValley/Horizon/1065/
> --
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


2001-12-25 22:52:58

by Eric Lammerts

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios


On Tue, 25 Dec 2001 [email protected] wrote:
> : What I'm using is change the geometry after the boot and before any
> : partition besides root is mounted, I do this at the beginning of
> : checkroot.sh by calling "/sbin/setmax -d 0 /dev/hda"
> : This works ok for me, of course you can have other solutions.
>
> Good to hear that it works OK. Sooner or later setmax or something
> similar must become part of the standard kernel, but so far I've
> gotten almost no feedback. Can you give the disk manufacturer and model
> (mail [email protected])?

The kernel part is already there in Andre Hedrick's IDE-patches for
2.2.x and 2.4.x. I don't know why it's not in standard 2.4.x.

Patch below is for 2.4.x, extracted from Andre's code. Works For Me(tm).

Eric


--- linux/drivers/ide/ide-disk.c~ Fri Oct 27 08:35:48 2000
+++ linux/drivers/ide/ide-disk.c Sun Jan 7 23:04:57 2001
@@ -513,24 +513,149 @@
current_capacity(drive));
}

+
+/*
+ * Tests if the drive supports Host Protected Area feature.
+ * Returns true if supported, false otherwise.
+ */
+static inline int idedisk_supports_host_protected_area(ide_drive_t *drive)
+{
+ int flag = (drive->id->command_set_1 & 0x0400) ? 1 : 0;
+ printk("%s: host protected area => %d\n", drive->name, flag);
+ return flag;
+}
+
+/*
+ * Queries for true maximum capacity of the drive.
+ * Returns maximum LBA address (> 0) of the drive, 0 if failed.
+ */
+static unsigned long idedisk_read_native_max_address(ide_drive_t *drive)
+{
+ byte args[7];
+ unsigned long addr = 0;
+
+ printk("%s: checking for max native LBA...\n", drive->name);
+
+ /* Create IDE/ATA command request structure
+ *
+ * NOTE: I'm not sure if I can safely use IDE_*_OFFSET macro
+ * here...For real ATA command structure, offset for IDE
+ * command is 7, but in IDE driver, it needs to be at 0th
+ * index (same goes for IDE status offset below). Hmm...
+ */
+ args[0] = 0xf8; /* READ_NATIVE_MAX - see ATA spec */
+ args[IDE_FEATURE_OFFSET] = 0x00;
+ args[IDE_NSECTOR_OFFSET] = 0x00;
+ args[IDE_SECTOR_OFFSET] = 0x00;
+ args[IDE_LCYL_OFFSET] = 0x00;
+ args[IDE_HCYL_OFFSET] = 0x00;
+ args[IDE_SELECT_OFFSET] = 0x40;
+
+ /* submit command request - if OK, read current max LBA value */
+ if (ide_wait_cmd_task(drive, args) == 0) {
+ if ((args[0] & 0x01) == 0) {
+ addr = ((args[IDE_SELECT_OFFSET] & 0x0f) << 24)
+ | ((args[IDE_HCYL_OFFSET] ) << 16)
+ | ((args[IDE_LCYL_OFFSET] ) << 8)
+ | ((args[IDE_SECTOR_OFFSET] ));
+ }
+ }
+
+ printk("%s: max native LBA is %lu\n", drive->name, addr);
+
+ return addr;
+}
+
+/*
+ * Sets maximum virtual LBA address of the drive.
+ * Returns new maximum virtual LBA address (> 0) or 0 on failure.
+ */
+static unsigned long idedisk_set_max_address(ide_drive_t *drive,
+ unsigned long addr_req)
+{
+ byte args[7];
+ unsigned long addr_set = 0;
+
+ printk("%s: (un)clipping max LBA...\n", drive->name);
+
+ /* Create IDE/ATA command request structure
+ *
+ * NOTE: I'm not sure if I can safely use IDE_*_OFFSET macro
+ * here...For real ATA command structure, offset for IDE
+ * command is 7, but in IDE driver, it needs to be at 0th
+ * index (same goes for IDE status offset below). Hmm...
+ */
+ args[0] = 0xf9; /* SET_MAX - see ATA spec */
+ args[IDE_FEATURE_OFFSET] = 0x00;
+ args[IDE_NSECTOR_OFFSET] = 0x00;
+ args[IDE_SECTOR_OFFSET] = ((addr_req ) & 0xff);
+ args[IDE_LCYL_OFFSET] = ((addr_req >> 8) & 0xff);
+ args[IDE_HCYL_OFFSET] = ((addr_req >> 16) & 0xff);
+ args[IDE_SELECT_OFFSET] = ((addr_req >> 24) & 0x0f) | 0x40;
+
+ /* submit command request - if OK, read new max LBA value */
+ if (ide_wait_cmd_task(drive, args) == 0) {
+ if ((args[0] & 0x01) == 0) {
+ addr_set = ((args[IDE_SELECT_OFFSET] & 0x0f) << 24)
+ | ((args[IDE_HCYL_OFFSET] ) << 16)
+ | ((args[IDE_LCYL_OFFSET] ) << 8)
+ | ((args[IDE_SECTOR_OFFSET] ));
+ }
+ }
+
+ printk("%s: max LBA (un)clipped to %lu\n", drive->name, addr_set);
+
+ return addr_set;
+}
+
/*
* Compute drive->capacity, the full capacity of the drive
* Called with drive->id != NULL.
+ *
+ * To compute capacity, this uses either of
+ *
+ * 1. CHS value set by user (whatever user sets will be trusted)
+ * 2. LBA value from target drive (require new ATA feature)
+ * 3. LBA value from system BIOS (new one is OK, old one may break)
+ * 4. CHS value from system BIOS (traditional style)
+ *
+ * in above order (i.e., if value of higher priority is available,
+ * rest of the values are ignored).
*/
static void init_idedisk_capacity (ide_drive_t *drive)
{
+ unsigned long hd_max;
+ unsigned long hd_cap = drive->cyl * drive->head * drive->sect;
+ int is_lba = 0;
+
struct hd_driveid *id = drive->id;
- unsigned long capacity = drive->cyl * drive->head * drive->sect;

- drive->select.b.lba = 0;
+ /* Unless geometry is given by user, use autodetected value */
+ if (! drive->forced_geom) {
+ /* If BIOS LBA geometry is available, use it */
+ if ((id->capability & 2) && lba_capacity_is_ok(id)) {
+ hd_cap = id->lba_capacity;
+ is_lba = 1;
+ }

- /* Determine capacity, and use LBA if the drive properly supports it */
- if ((id->capability & 2) && lba_capacity_is_ok(id)) {
- capacity = id->lba_capacity;
- drive->cyl = capacity / (drive->head * drive->sect);
- drive->select.b.lba = 1;
+ /* If new ATA feature is supported, try using it */
+ if (idedisk_supports_host_protected_area(drive)) {
+ hd_max = idedisk_read_native_max_address(drive);
+ hd_max = idedisk_set_max_address(drive, hd_max);
+
+ if (hd_max > 0) {
+ hd_cap = hd_max+1;
+ is_lba = 1;
+ }
+ }
}
- drive->capacity = capacity;
+
+ printk("%s: lba = %d, cap = %lu\n", drive->name, is_lba, hd_cap);
+
+ /* update parameters with fetched results */
+ drive->select.b.lba = is_lba;
+ drive->capacity = hd_cap;
+ drive->cyl = hd_cap / (drive->head * drive->sect);
}

static unsigned long idedisk_capacity (ide_drive_t *drive)

2001-12-26 02:12:39

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

> The kernel part is already there in Andre Hedrick's IDE-patches

Yes. By some coincidence this code fails on my Maxtor,
but it will work on most disks.

Andries

2001-12-26 09:28:39

by Josep Lladonosa i Capell

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Eric Lammerts wrote:

> The kernel part is already there in Andre Hedrick's IDE-patches for
> 2.2.x and 2.4.x. I don't know why it's not in standard 2.4.x.

suppose first references are to 2.2.x and 2.3.x.


>
> Patch below is for 2.4.x, extracted from Andre's code. Works For Me(tm).

patch rejected for 2.4.17 kernel. Not Working For Me :-(



--
Salutacions...Josep
http://www.geocities.com/SiliconValley/Horizon/1065/
--



2001-12-26 10:40:24

by Santiago Garcia Mantinan

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

> Good to hear that it works OK. Sooner or later setmax or something
> similar must become part of the standard kernel, but so far I've
> gotten almost no feedback. Can you give the disk manufacturer and model
> (mail [email protected])?

Well, yes, as I had not said it on my previous mail, I'm not putting any
geometry or anything like that on lilo, the disk I have now working like
that is a 60Gigs Seagate Model=ST340823A which is recogniced by Linux as...

hda: 66055248 sectors (33820 MB) w/512KiB Cache, CHS=4111/255/63, UDMA(33)

Of course after using setmax I can access the hole disk.

I have also tried this on a 80 Gigs Seagate Model=ST380020A and it also
works ok.

Regards...
--
Manty/BestiaTester -> http://manty.net

2001-12-26 16:33:51

by Stephan von Krawczynski

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

On Tue, 25 Dec 2001 19:09:22 -0000
"James Stevenson" <[email protected]> wrote:

> Hi
>
> i have the same problem weith a 40GB disk
> its not a linux problem but a bios / disk problem
>
> my workaround:
>
> dont set the jumper on the disk to make it look smaller.
> this however will stop it working in the bios so you need to
> disable the disk in the bios completly and turn off the ide
> auto detection process in the bios this is because it will
> probably hang if you try to use it :)
>
> linux will then pick the disk up from the ide controller.

I tried this one some time ago, and had to find out, that I was not able to
write to the upper cylinders of the disk. You can check this out _before_ using
the drive via dd from /dev/zero to your /dev/drive and look at the results.

Regards,
Stephan

2001-12-27 17:45:51

by James Stevenson

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios



> > my workaround:
> >
> > dont set the jumper on the disk to make it look smaller.
> > this however will stop it working in the bios so you need to
> > disable the disk in the bios completly and turn off the ide
> > auto detection process in the bios this is because it will
> > probably hang if you try to use it :)
> >
> > linux will then pick the disk up from the ide controller.
>
> I tried this one some time ago, and had to find out, that I was not able
to
> write to the upper cylinders of the disk. You can check this out _before_
using
> the drive via dd from /dev/zero to your /dev/drive and look at the
results.

it seems to work fine for me.
could it be possible that the chipset that you are using does not support
disks bigger than 32GB ?


2001-12-27 18:51:28

by Stephan von Krawczynski

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

On Thu, 27 Dec 2001 13:14:43 -0000
"James Stevenson" <[email protected]> wrote:

> > I tried this one some time ago, and had to find out, that I was not able
> to
> > write to the upper cylinders of the disk. You can check this out _before_
> using
> > the drive via dd from /dev/zero to your /dev/drive and look at the
> results.
>
> it seems to work fine for me.
> could it be possible that the chipset that you are using does not support
> disks bigger than 32GB ?

I don't know. I tried once with

00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev d0)

and it did not work. I could definitely not write beyond the 32 GB border. I
replaced the mobo then.

Regards,
Stephan

2001-12-27 19:54:13

by Ido Diamant

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Hi,

I am having an old Pentium 120, with an old BIOS.
I got new 40GB hard disk, and in order to make it readable, I needed to
use the cable-select jumper in order to make the hard disk look smaller
for the bios.
The only problem is that the linux recognizes my hard drive as 33GB (maybe
its 32 as you said). will what you said about disabling the hard disk
recognision at the BIOS help me?
I don't want to play with the BIOS for nothing, so please let me know.

Thanks,
Ido

On Thu, 27 Dec 2001, Stephan von Krawczynski wrote:

> On Thu, 27 Dec 2001 13:14:43 -0000
> "James Stevenson" <[email protected]> wrote:
>
> > > I tried this one some time ago, and had to find out, that I was not able
> > to
> > > write to the upper cylinders of the disk. You can check this out _before_
> > using
> > > the drive via dd from /dev/zero to your /dev/drive and look at the
> > results.
> >
> > it seems to work fine for me.
> > could it be possible that the chipset that you are using does not support
> > disks bigger than 32GB ?
>
> I don't know. I tried once with
>
> 00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev d0)
>
> and it did not work. I could definitely not write beyond the 32 GB border. I
> replaced the mobo then.
>
> Regards,
> Stephan
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2001-12-27 22:41:31

by Guest section DW

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

On Thu, Dec 27, 2001 at 07:51:01PM +0100, Stephan von Krawczynski wrote:

> I don't know. I tried once with
>
> 00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev d0)
>
> and it did not work. I could definitely not write beyond the 32 GB border. I
> replaced the mobo then.

Did you try setmax?

2001-12-27 23:04:26

by Stephan von Krawczynski

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

> On Thu, Dec 27, 2001 at 07:51:01PM +0100, Stephan von Krawczynski
wrote:
>
> > I don't know. I tried once with
> >
> > 00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
(rev d0)
> >
> > and it did not work. I could definitely not write beyond the 32 GB
border. I
> > replaced the mobo then.
>
> Did you try setmax?

unfortunately not, I did not even know it existed before this thread.
I must admit I have still not had a look at it, but on the other hand:
if it makes big IDE drives work on old mobo & bios, it may be a good
idea to include its intelligence into the kernel, or not?
Yes, I know that people nowadays tend to strip down _old_ stuff from
the current sources, but I guess it is not a big loss in code size
either, is it?
knock, knock .. hello IDE maintainer, how about a Xmas present ?
:-)

Regards,
Stephan


2001-12-28 00:06:53

by Eric Lammerts

[permalink] [raw]
Subject: [PATCH] Re: 2.4.x kernels, big ide disks and old bios


On Fri, 28 Dec 2001, Stephan von Krawczynski wrote:
> I must admit I have still not had a look at it, but on the other hand:
> if it makes big IDE drives work on old mobo & bios, it may be a good
> idea to include its intelligence into the kernel, or not?

I cleaned up the patch a bit (see below). It now performs the
SET_MAX command only when needed, and is far less verbose (only
prints 1 line when unclipping). It applies against 2.4.18pre1 and
2.5.2pre2.

I've tested it with a Maxtor 96147U8 (60Gb), Maxtor 98196H8 (80Gb)
and WDC WD300BB (30Gb) (the last one just for testing, and I had to
use ibmsetmax instead of setmax to make the drive remember it).
It also worked with some 2.5" IBM hdd a while back (don't remember
the exact model).

Jens, please consider this patch for inclusion into 2.4 and/or 2.5.
(or should I talk to someone else?)

Eric


--- linux/drivers/ide/ide-disk.c.orig Thu Dec 27 22:19:11 2001
+++ linux/drivers/ide/ide-disk.c Fri Dec 28 00:37:36 2001
@@ -500,6 +500,78 @@
current_capacity(drive));
}

+
+/*
+ * Queries for true maximum capacity of the drive and (if needed) sets
+ * maximum virtual LBA address accordingly. Also updates drive->*
+ * settings.
+ */
+static void idedisk_unclip(ide_drive_t *drive)
+{
+ byte args[7];
+ unsigned long addr = 0;
+
+ if(!(drive->id->command_set_1 & 0x0400)) {
+ /* drive does not support Host Protected Area feature. */
+ return;
+ }
+
+ /* create IDE/ATA command request structure */
+ args[0] = 0xf8; /* READ_NATIVE_MAX - see ATA spec */
+ args[IDE_FEATURE_OFFSET] = 0x00;
+ args[IDE_NSECTOR_OFFSET] = 0x00;
+ args[IDE_SECTOR_OFFSET] = 0x00;
+ args[IDE_LCYL_OFFSET] = 0x00;
+ args[IDE_HCYL_OFFSET] = 0x00;
+ args[IDE_SELECT_OFFSET] = 0x40;
+
+ if(ide_wait_cmd_task(drive, args) != 0 || (args[0] & 0x01) != 0) {
+ /* silently ignore failed command */
+ return;
+ }
+
+ /* read max LBA value */
+ addr = ((args[IDE_SELECT_OFFSET] & 0x0f) << 24) |
+ (args[IDE_HCYL_OFFSET] << 16) |
+ (args[IDE_LCYL_OFFSET] << 8) |
+ (args[IDE_SECTOR_OFFSET]);
+
+ /* sanity check */
+ if(addr == 0) return;
+
+ if(drive->capacity == (addr + 1)) {
+ /* no unclipping needed */
+ return;
+ }
+
+ printk("%s: unclipping drive from %lu sectors to %lu sectors\n",
+ drive->name, drive->capacity, addr + 1);
+
+ /* create IDE/ATA command request structure */
+ args[0] = 0xf9; /* SET_MAX - see ATA spec */
+ args[IDE_FEATURE_OFFSET] = 0x00;
+ args[IDE_NSECTOR_OFFSET] = 0x00;
+ args[IDE_SECTOR_OFFSET] = addr & 0xff;
+ args[IDE_LCYL_OFFSET] = (addr >> 8) & 0xff;
+ args[IDE_HCYL_OFFSET] = (addr >> 16) & 0xff;
+ args[IDE_SELECT_OFFSET] = ((addr >> 24) & 0x0f) | 0x40;
+
+ /* submit command request - if OK, read new max LBA value */
+ if(ide_wait_cmd_task(drive, args) == 0 && (args[0] & 0x01) == 0) {
+ addr = ((args[IDE_SELECT_OFFSET] & 0x0f) << 24) |
+ (args[IDE_HCYL_OFFSET] << 16) |
+ (args[IDE_LCYL_OFFSET] << 8) |
+ (args[IDE_SECTOR_OFFSET]);
+
+ drive->select.b.lba = 1;
+ drive->capacity = addr + 1;
+ drive->cyl = drive->capacity / (drive->head * drive->sect);
+ } else {
+ printk("%s: unclipping drive failed\n", drive->name);
+ }
+}
+
+
/*
* Compute drive->capacity, the full capacity of the drive
* Called with drive->id != NULL.
@@ -518,6 +590,8 @@
drive->select.b.lba = 1;
}
drive->capacity = capacity;
+
+ idedisk_unclip(drive);
}

static unsigned long idedisk_capacity (ide_drive_t *drive)

2001-12-28 03:31:49

by Andre Hedrick

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios


You have it called "STROKE".

Use a patch and execute a soft-clip operation to the device and you are
fixed. To bad the kernel maintainers do not see value in this or any
other driver that follows the standards for the physical layers.

Regards,

On Fri, 28 Dec 2001, Stephan von Krawczynski wrote:

> > On Thu, Dec 27, 2001 at 07:51:01PM +0100, Stephan von Krawczynski
> wrote:
> >
> > > I don't know. I tried once with
> > >
> > > 00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
> (rev d0)
> > >
> > > and it did not work. I could definitely not write beyond the 32 GB
> border. I
> > > replaced the mobo then.
> >
> > Did you try setmax?
>
> unfortunately not, I did not even know it existed before this thread.
> I must admit I have still not had a look at it, but on the other hand:
> if it makes big IDE drives work on old mobo & bios, it may be a good
> idea to include its intelligence into the kernel, or not?
> Yes, I know that people nowadays tend to strip down _old_ stuff from
> the current sources, but I guess it is not a big loss in code size
> either, is it?
> knock, knock .. hello IDE maintainer, how about a Xmas present ?
> :-)
>
> Regards,
> Stephan
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

Andre Hedrick
CEO/President, LAD Storage Consulting Group
Linux ATA Development
Linux Disk Certification Project

2001-12-30 01:09:56

by Jorge Nerin

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Josep Lladonosa i Capell wrote:

> Hello,
>
> the problem is this:
>
> bios only supports disks up to 32 Gb.


I have a 486, bios (as i remember) does not even see the disk.


>
> hard disk is 60 Gb.


HD is 40Gb


>
> kernel is 2.4.17
>

2.4.15-pre9 + tux2 patches


> hard disk reports its correct size when reading parameters from the
> disk, not from the bios
>
> verd:/proc/ide/hdc# cat geometry
> physical 65530/16/63
> logical 119150/16/63
>


[root@head (22:45:56) ~]# cat /proc/ide/hda/geometry
physical 77545/16/63
logical 77545/16/63
[root@head (22:46:07) ~]#


>
> when booting (dmesg):
>
> hdc: IC35L060AVER07-0, ATA DISK drive
> hdc: 66055247 sectors (33820 MB) w/1916KiB Cache, CHS=119150/16/63,
> UDMA(33)
>
>


hda: 78165360 sectors (40021 MB) w/1024KiB Cache, CHS=77545/16/63


> Linux adopts the 'false' geometry (65530/16/63) ) to bypass the bios
> boot.
>
>


All I can say is that I have a /boot partition of about 64 Megs, because
I have / formated as reiser so /boot is ext2 because it's from the time
that you cannot boot from reiser without notail.


>
> I know that there are patches for 2.2 kernels and 2.3 kernels, so as
> linux adopts the logical geometry (a kiddy trick with lba size). They
> are very simple (a line), but 2.4 ide implementation is (a little more)
> complicated. Any patch?
>


Well, it works for me, and as I have said, I have a 486, I'm not sure if
the bios supports this size, but I seem to remember that it even does
not detect it at boot, or perhaps it detects it as a strange size such
as 8Gb or 32Gb, just don't remember.

Linux boots and works for me with no problem in this system.


> Bon Nadal - Merry Christmas
>


Feliz Navidad.


> --
> Salutacions...Josep
> http://www.geocities.com/SiliconValley/Horizon/1065/



--
Jorge Nerin
<[email protected]>

2001-12-30 01:42:04

by Josep Lladonosa i Capell

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Andre Hedrick wrote:

> You have it called "STROKE".
>
> Use a patch and execute a soft-clip operation to the device and you are
> fixed.

...depends. I want the big disk to be /dev/hda, and bootable (an unattended
boot).

Disk is 119150/16/63. I soft (un)clipped it to max capacity (60Gb) with setmax
.

Configured it in the bios (32Gb limit) as a smaller disk, bios complained,
telling an error, asking to press F1 to continue. The LBA mode (4111/255/63,
LBA, for example) told the error, and asking for F1, as well. With
(65530/16/63, NORM), it booted well.
Kernel (2.4.17, patched) corrected the geometry while booting, but mke2fs
generated many io-errors, I suspect beyond the 32Gb.

Finally, a bios upgrade (unfortunately not for sizes beyond 32Gb), let me to
configure the setup with
the LBA mode, and boot works well, and mke2fs doesn't complain.

I don't need to use setmax to clip-unclip when booting.

What's the meaning of the 65535 max limit in bios_cyl? *

*I don't think it is a kernel limit.
*Is it the max value accepted by the physical disk, and that's why lba is used?

*Was that the problem with the io-errors?


# cat /proc/ide/hdc/settings
name value min max mode
---- ----- --- --- ----
bios_cyl 119150 0 65535 rw
bios_head 16 0 255 rw
bios_sect 63 0 63 rw


--
Salutacions...Josep
http://www.geocities.com/SiliconValley/Horizon/1065/
--



2001-12-30 02:48:01

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

> # cat /proc/ide/hdc/settings
> name value min max mode
> ---- ----- --- --- ----
> bios_cyl 119150 0 65535 rw
> bios_head 16 0 255 rw
> bios_sect 63 0 63 rw

> What's the meaning of the 65535 max limit in bios_cyl?

It is meaningless.

(Maybe there was some meaning long ago, for example because
HDIO_GETGEO only uses a 16-bit field for #cyls.
These days bios_cyl is not used anywhere. Not in the kernel,
not in user space. It is just some random number, computed
by taking disk-size / (heads*secs).)

2001-12-30 09:34:30

by Josep Lladonosa i Capell

[permalink] [raw]
Subject: Re: 2.4.x kernels, big ide disks and old bios

Jorge Nerin wrote:

> I have a 486, bios (as i remember) does not even see the disk.
>
> HD is 40Gb
>
> Linux boots and works for me with no problem in this system.

Is your disk hda, not configured in the bios, and it boots?????

Perhaps you have it configured in the bios as a smaler size (8G - 32G).


--
Salutacions...Josep
http://www.geocities.com/SiliconValley/Horizon/1065/
--