Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-08 Thread Adam Kropelin

Jim Roland said:
>I expect someone will rebut my comments about the kernel (which is fine, I'm 
>not a Kernel hacker

Okay, I'll take the bait, but I'm not a kernel hacker, either, so someone 
should feel free to rebut *my* comments as well.

>but it is my understanding that the kernel uses your system BIOS for actual 
>reads/writes at the hardware level, 

No. There are many reasons this isn't done, but a big one is:

BIOS = real mode
Kernel = protected mode

The kernel makes use of some BIOS *tables* (which are coped to known 
locations before the Big Switch), but actual BIOS interrupt routines are used 
only during the early stages of boot. Aside from the RM/PM issue, the BIOS 
isn't used because it is 16-bit, slow, and generally buggy.

See Alan Cox's paper on kernel BIOS usage posted back on 6/22/01 for a nice 
discussion of what use the kernel has for the BIOS.

>When you turn BIOS to  the OS does what it can, but 
>the BIOS in your system *SHOULD* refuse to process the call, instead it's 
>doing the read/writes, but not the same way as if IDE was turned on. 

An interesting theory, but off the mark.

That said, I don't know what the Right Answer for Martin is, but here are a 
few ideas:

* I notice the boot log shows a CMD646 IDE controller. Make sure the CMD640 
bug-fix support is enabled in your kernel (assuming this applies to 64x 
chips). If you're using a vendor's kernel it almost certainly is already, but 
if you built your own, make sure.

* It is possible that when a drive is assigned in the BIOS, the BIOS will do 
some configuration of the controller or the drive itself which the kernel is 
not doing on its own. I don't know what the state of kernel support for that 
646 chipset is.

* That's a pretty old drive, so I wouldn't rule out hardware problems. 
Strange that it only fails when not configured in the BIOS, though.

Regards,
Adam

-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-08 Thread Adam Kropelin

Jim Roland said:
I expect someone will rebut my comments about the kernel (which is fine, I'm 
not a Kernel hacker

Okay, I'll take the bait, but I'm not a kernel hacker, either, so someone 
should feel free to rebut *my* comments as well.

but it is my understanding that the kernel uses your system BIOS for actual 
reads/writes at the hardware level, 

No. There are many reasons this isn't done, but a big one is:

BIOS = real mode
Kernel = protected mode

The kernel makes use of some BIOS *tables* (which are coped to known 
locations before the Big Switch), but actual BIOS interrupt routines are used 
only during the early stages of boot. Aside from the RM/PM issue, the BIOS 
isn't used because it is 16-bit, slow, and generally buggy.

See Alan Cox's paper on kernel BIOS usage posted back on 6/22/01 for a nice 
discussion of what use the kernel has for the BIOS.

When you turn BIOS to NONE the OS does what it can, but 
the BIOS in your system *SHOULD* refuse to process the call, instead it's 
doing the read/writes, but not the same way as if IDE was turned on. 

An interesting theory, but off the mark.

That said, I don't know what the Right Answer for Martin is, but here are a 
few ideas:

* I notice the boot log shows a CMD646 IDE controller. Make sure the CMD640 
bug-fix support is enabled in your kernel (assuming this applies to 64x 
chips). If you're using a vendor's kernel it almost certainly is already, but 
if you built your own, make sure.

* It is possible that when a drive is assigned in the BIOS, the BIOS will do 
some configuration of the controller or the drive itself which the kernel is 
not doing on its own. I don't know what the state of kernel support for that 
646 chipset is.

* That's a pretty old drive, so I wouldn't rule out hardware problems. 
Strange that it only fails when not configured in the BIOS, though.

Regards,
Adam

-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Rik van Riel

On Sat, 7 Jul 2001, Jim Roland wrote:

> but it's possible that the kernel is making a BIOS call,

Not really ...

Rik
--
Executive summary of a recent Microsoft press release:
   "we are concerned about the GNU General Public License (GPL)"


http://www.surriel.com/
http://www.conectiva.com/   http://distro.conectiva.com/

-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Jim Roland


- Original Message -
From: "M.H.VanLeeuwen" <[EMAIL PROTECTED]>
To: "Jim Roland" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 8:47 AM
Subject: Re: Does kernel require IDE enabled in BIOS to access HD, FS
errors?


> Jim,
>
> Thanks for the info, comments interleaved below
>
[snip]
>
> But, that's kind of the point I'm driving at if the OS can't correctly
access the
> IDE interface it shouldn't do it at all.

Right.  It's possible that your BIOS may be letting the kernel write.  While
I don't write the kernel, it's probably best for Linus to answer this one,
but it's possible that the kernel is making a BIOS call, and the BIOS does
not refuse to write data (which it should just say "no IDE drives are on the
system right now") with the IDE setting to  in your BIOS.  OTOH, the
kernel may be making calls of it's own or as you say, there may be a broken
driver.  I seem to remember there was a "bug workaround" option in the
kernel for the CMD640 chipset.

> > Are you getting IDE corruption with the BIOS set to  for your IDE
> > drive?
>
> None whatsoever.

Then AFAIK, it's definitely a BIOS issue. There might be (if not there
already) a kernel option to check to see what the BIOS setting is for number
of IDE drives (of course set to  would mean 0 drives), and refuse to
write it.  This workaround (if any) would be required for buggy BIOSes (I'm
sure yours isn't the only one ).



-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread M.H.VanLeeuwen

Jim,

Thanks for the info, comments interleaved below

Thanks
Martin

Jim Roland wrote:
> 
> Activating an IDE drive in an older BIOS (newer ones have a SCSI option in
> the "A/C/CDROM" options) will always force an IDE drive boot with older
> BIOSes.  Older BIOSes are written to stop looking for a boot device once it
> has found one, and it's own IDE is where it says "Ok, I have boot
> capability", otherwise no IDE drive, means it passes boot control to other
> system BIOSes (like your SCSI or NIC cards).  This is by default with older
> systems.

This behavior is acceptable, as I can as you suggest move the kernel to the
IDE and tell it the root device is /dev/md0.  Actually that is what I did
to a floppy to get access to the system while the BIOS was set to 
detect the IDE drives.   Since I only boot whenever Linus puts out a new
kernel that isn't so much of a concern.

> 
> I expect someone will rebut my comments about the kernel (which is fine, I'm
> not a Kernel hacker--PROPERLY USED TERM HERE (not the media's term) ),
> but it is my understanding that the kernel uses your system BIOS for actual
> reads/writes at the hardware level, this way it does not have to account for
> EVERY possible BIOS out there.  (Other OSes use BIOS system calls for this
> purpose as well)  When you turn BIOS to  the OS does what it can, but
> the BIOS in your system *SHOULD* refuse to process the call, instead it's
> doing the read/writes, but not the same way as if IDE was turned on.

But, that's kind of the point I'm driving at if the OS can't correctly access the
IDE interface it shouldn't do it at all.

My guess is that the CMD64X driver is broken since the system can write data
to the HD but with random corruption. Ditto for reading data.  Likewise,
why would I see an increase in write performance when "dd if=/dev/zero of=/dev/null"
is running simultaneously on another console.

> Are you getting IDE corruption with the BIOS set to  for your IDE
> drive?

None whatsoever.
-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Jim Roland

Activating an IDE drive in an older BIOS (newer ones have a SCSI option in
the "A/C/CDROM" options) will always force an IDE drive boot with older
BIOSes.  Older BIOSes are written to stop looking for a boot device once it
has found one, and it's own IDE is where it says "Ok, I have boot
capability", otherwise no IDE drive, means it passes boot control to other
system BIOSes (like your SCSI or NIC cards).  This is by default with older
systems.

I expect someone will rebut my comments about the kernel (which is fine, I'm
not a Kernel hacker--PROPERLY USED TERM HERE (not the media's term) ),
but it is my understanding that the kernel uses your system BIOS for actual
reads/writes at the hardware level, this way it does not have to account for
EVERY possible BIOS out there.  (Other OSes use BIOS system calls for this
purpose as well)  When you turn BIOS to  the OS does what it can, but
the BIOS in your system *SHOULD* refuse to process the call, instead it's
doing the read/writes, but not the same way as if IDE was turned on.

My suggestion is that you install the OS onto the IDE drive, let it boot,
and use it for a boot only drive.  Mount user data from your SCSI drive onto
the IDE's mount points.  Otherwise, since your reason for doing this is that
you're out of space, add another SCSI drive.

Are you getting IDE corruption with the BIOS set to  for your IDE
drive?

Regards,
Jim Roland, RHCE


- Original Message -
From: "M.H.VanLeeuwen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 12:25 AM
Subject: Does kernel require IDE enabled in BIOS to access HD, FS errors?


> Hi,
>
> I have a SMP P166 system that has been running for years with an AIC7xxx
SCSI card as
> opposed to the native IDE interface.  The BIOS has the IDE 0,1,2,3 set to
.
> Running out of disk space I installed one of the original IDE drives. The
kernel
> booted and ID'd the drive correctly.  Kernel version 2.4.5/6 behave the
same.
>
> Uniform Multi-Platform E-IDE driver Revision: 6.31
> ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
> CMD646: IDE controller on PCI bus 00 dev 10
> CMD646: chipset revision 1
> CMD646: not 100% native mode: will probe irqs later
> CMD646: chipset revision 0x01, MultiWord DMA Limited, IRQ workaround
enabled
> CMD646: simplex device:  DMA disabled
> ide0: CMD646 Bus-Master DMA disabled (BIOS)
> CMD646: simplex device:  DMA disabled
> ide1: CMD646 Bus-Master DMA disabled (BIOS)
> hdb: CD-ROM CDU76E, ATAPI CD/DVD-ROM drive
> ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
> hdc: WDC AC2850F, ATA DISK drive
> ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> ide1 at 0x170-0x177,0x376 on irq 15
> hdc: 1667232 sectors (854 MB) w/64KiB Cache, CHS=1654/16/63
> hdb: packet command error: status=0x51 { DriveReady SeekComplete Error }
> hdb: packet command error: error=0x44
> hdb: ATAPI 4X CD-ROM drive, 256kB Cache
> Uniform CD-ROM driver Revision: 3.12
> Partition check:
>  hdc: [PTBL] [827/32/63] hdc1
>
> However I can't boot from the SCSI drives if the IDE HD is enabled due to
deficiencies
> in the BIOS... boot "A: then C:" or "C: then A:" are the only choices, if
neither are
> present the system boots from the SCSI card, otherwise it fails to boot.
>
> PROBLEM: cannot reliably R/W to the HD unless the BIOS is set to 
recognize.
> I consistently see MD5SUM errors and FS corruption and other strange FS
symptoms
> when the BIOS is set to  for the drive and _never_ see any errors
with the
> setting set to .  There are no messages emitted by the kernel that
there
> were any system errors encountered leading one to believe that all is
well, when
> it isn't.
>
> What is interesting, is that the I/O writes increase from once every 14
seconds to
> once every 2-3 seconds and the FS corruption diminishes but don't
disappear
> if a background "dd if=/dev/zero of=/dev/null" is running.
>
> Is this expected kernel behavior?
>
> VMSTAT follow... when copying files from SCSI drives to IDE drive.
>
> More info available if needed...
>
> Thanks,
> Martin
>
> The waiting processes are kupdated and bdflush. (I have Alt-SysRq- trace
of them)
>
> VMSTAT 1 for the case w/ BIOS set to  looks like (w/o dd running):
>
>procs  memoryswap  io system
cpu
>  r  b  w   swpd   free   buff  cache  si  sobibo   incs  us
sy  id
>  0  0  0  0  83180   1056  39800   0   0   261 3   8343   5
8  87
>  0  0  0  0  83176   1056  39800   0   0 0 0  11920   3
2  95
>  0  0  0  0  83176   1056  39800   0   0 0 0  11620   2
2  96
>  0  1  0  0  83012   1096  39812   0   0   329 0  196   183   3
8  89
>  0  1  0  0  81268   1128  41444   0   0  1021 0  309   275   3
17  80
>  0  1  0  0  74464   1200  47716   0   0  313127  292   264   6
25  69
>  2  0  0  0  67772   1276  53632   0   0  2962 0  397   245  12
25  63
>  2  0  0  0  64016   1324  56900   0 

Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Jim Roland

Activating an IDE drive in an older BIOS (newer ones have a SCSI option in
the A/C/CDROM options) will always force an IDE drive boot with older
BIOSes.  Older BIOSes are written to stop looking for a boot device once it
has found one, and it's own IDE is where it says Ok, I have boot
capability, otherwise no IDE drive, means it passes boot control to other
system BIOSes (like your SCSI or NIC cards).  This is by default with older
systems.

I expect someone will rebut my comments about the kernel (which is fine, I'm
not a Kernel hacker--PROPERLY USED TERM HERE (not the media's term) grin),
but it is my understanding that the kernel uses your system BIOS for actual
reads/writes at the hardware level, this way it does not have to account for
EVERY possible BIOS out there.  (Other OSes use BIOS system calls for this
purpose as well)  When you turn BIOS to NONE the OS does what it can, but
the BIOS in your system *SHOULD* refuse to process the call, instead it's
doing the read/writes, but not the same way as if IDE was turned on.

My suggestion is that you install the OS onto the IDE drive, let it boot,
and use it for a boot only drive.  Mount user data from your SCSI drive onto
the IDE's mount points.  Otherwise, since your reason for doing this is that
you're out of space, add another SCSI drive.

Are you getting IDE corruption with the BIOS set to AUTO for your IDE
drive?

Regards,
Jim Roland, RHCE


- Original Message -
From: M.H.VanLeeuwen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, July 07, 2001 12:25 AM
Subject: Does kernel require IDE enabled in BIOS to access HD, FS errors?


 Hi,

 I have a SMP P166 system that has been running for years with an AIC7xxx
SCSI card as
 opposed to the native IDE interface.  The BIOS has the IDE 0,1,2,3 set to
NONE.
 Running out of disk space I installed one of the original IDE drives. The
kernel
 booted and ID'd the drive correctly.  Kernel version 2.4.5/6 behave the
same.

 Uniform Multi-Platform E-IDE driver Revision: 6.31
 ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
 CMD646: IDE controller on PCI bus 00 dev 10
 CMD646: chipset revision 1
 CMD646: not 100% native mode: will probe irqs later
 CMD646: chipset revision 0x01, MultiWord DMA Limited, IRQ workaround
enabled
 CMD646: simplex device:  DMA disabled
 ide0: CMD646 Bus-Master DMA disabled (BIOS)
 CMD646: simplex device:  DMA disabled
 ide1: CMD646 Bus-Master DMA disabled (BIOS)
 hdb: CD-ROM CDU76E, ATAPI CD/DVD-ROM drive
 ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
 hdc: WDC AC2850F, ATA DISK drive
 ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
 ide1 at 0x170-0x177,0x376 on irq 15
 hdc: 1667232 sectors (854 MB) w/64KiB Cache, CHS=1654/16/63
 hdb: packet command error: status=0x51 { DriveReady SeekComplete Error }
 hdb: packet command error: error=0x44
 hdb: ATAPI 4X CD-ROM drive, 256kB Cache
 Uniform CD-ROM driver Revision: 3.12
 Partition check:
  hdc: [PTBL] [827/32/63] hdc1

 However I can't boot from the SCSI drives if the IDE HD is enabled due to
deficiencies
 in the BIOS... boot A: then C: or C: then A: are the only choices, if
neither are
 present the system boots from the SCSI card, otherwise it fails to boot.

 PROBLEM: cannot reliably R/W to the HD unless the BIOS is set to auto
recognize.
 I consistently see MD5SUM errors and FS corruption and other strange FS
symptoms
 when the BIOS is set to NONE for the drive and _never_ see any errors
with the
 setting set to AUTO.  There are no messages emitted by the kernel that
there
 were any system errors encountered leading one to believe that all is
well, when
 it isn't.

 What is interesting, is that the I/O writes increase from once every 14
seconds to
 once every 2-3 seconds and the FS corruption diminishes but don't
disappear
 if a background dd if=/dev/zero of=/dev/null is running.

 Is this expected kernel behavior?

 VMSTAT follow... when copying files from SCSI drives to IDE drive.

 More info available if needed...

 Thanks,
 Martin

 The waiting processes are kupdated and bdflush. (I have Alt-SysRq- trace
of them)

 VMSTAT 1 for the case w/ BIOS set to NONE looks like (w/o dd running):

procs  memoryswap  io system
cpu
  r  b  w   swpd   free   buff  cache  si  sobibo   incs  us
sy  id
  0  0  0  0  83180   1056  39800   0   0   261 3   8343   5
8  87
  0  0  0  0  83176   1056  39800   0   0 0 0  11920   3
2  95
  0  0  0  0  83176   1056  39800   0   0 0 0  11620   2
2  96
  0  1  0  0  83012   1096  39812   0   0   329 0  196   183   3
8  89
  0  1  0  0  81268   1128  41444   0   0  1021 0  309   275   3
17  80
  0  1  0  0  74464   1200  47716   0   0  313127  292   264   6
25  69
  2  0  0  0  67772   1276  53632   0   0  2962 0  397   245  12
25  63
  2  0  0  0  64016   1324  56900   0   0  1602 0  414   155  48
27  26
  1  1  0 

Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread M.H.VanLeeuwen

Jim,

Thanks for the info, comments interleaved below

Thanks
Martin

Jim Roland wrote:
 
 Activating an IDE drive in an older BIOS (newer ones have a SCSI option in
 the A/C/CDROM options) will always force an IDE drive boot with older
 BIOSes.  Older BIOSes are written to stop looking for a boot device once it
 has found one, and it's own IDE is where it says Ok, I have boot
 capability, otherwise no IDE drive, means it passes boot control to other
 system BIOSes (like your SCSI or NIC cards).  This is by default with older
 systems.

This behavior is acceptable, as I can as you suggest move the kernel to the
IDE and tell it the root device is /dev/md0.  Actually that is what I did
to a floppy to get access to the system while the BIOS was set to auto
detect the IDE drives.   Since I only boot whenever Linus puts out a new
kernel that isn't so much of a concern.

 
 I expect someone will rebut my comments about the kernel (which is fine, I'm
 not a Kernel hacker--PROPERLY USED TERM HERE (not the media's term) grin),
 but it is my understanding that the kernel uses your system BIOS for actual
 reads/writes at the hardware level, this way it does not have to account for
 EVERY possible BIOS out there.  (Other OSes use BIOS system calls for this
 purpose as well)  When you turn BIOS to NONE the OS does what it can, but
 the BIOS in your system *SHOULD* refuse to process the call, instead it's
 doing the read/writes, but not the same way as if IDE was turned on.

But, that's kind of the point I'm driving at if the OS can't correctly access the
IDE interface it shouldn't do it at all.

My guess is that the CMD64X driver is broken since the system can write data
to the HD but with random corruption. Ditto for reading data.  Likewise,
why would I see an increase in write performance when dd if=/dev/zero of=/dev/null
is running simultaneously on another console.

 Are you getting IDE corruption with the BIOS set to AUTO for your IDE
 drive?

None whatsoever.
-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Jim Roland


- Original Message -
From: M.H.VanLeeuwen [EMAIL PROTECTED]
To: Jim Roland [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 07, 2001 8:47 AM
Subject: Re: Does kernel require IDE enabled in BIOS to access HD, FS
errors?


 Jim,

 Thanks for the info, comments interleaved below

[snip]

 But, that's kind of the point I'm driving at if the OS can't correctly
access the
 IDE interface it shouldn't do it at all.

Right.  It's possible that your BIOS may be letting the kernel write.  While
I don't write the kernel, it's probably best for Linus to answer this one,
but it's possible that the kernel is making a BIOS call, and the BIOS does
not refuse to write data (which it should just say no IDE drives are on the
system right now) with the IDE setting to NONE in your BIOS.  OTOH, the
kernel may be making calls of it's own or as you say, there may be a broken
driver.  I seem to remember there was a bug workaround option in the
kernel for the CMD640 chipset.

  Are you getting IDE corruption with the BIOS set to AUTO for your IDE
  drive?

 None whatsoever.

Then AFAIK, it's definitely a BIOS issue. There might be (if not there
already) a kernel option to check to see what the BIOS setting is for number
of IDE drives (of course set to NONE would mean 0 drives), and refuse to
write it.  This workaround (if any) would be required for buggy BIOSes (I'm
sure yours isn't the only one grin).



-
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/



Re: Does kernel require IDE enabled in BIOS to access HD, FS errors?

2001-07-07 Thread Rik van Riel

On Sat, 7 Jul 2001, Jim Roland wrote:

 but it's possible that the kernel is making a BIOS call,

Not really ...

Rik
--
Executive summary of a recent Microsoft press release:
   we are concerned about the GNU General Public License (GPL)


http://www.surriel.com/
http://www.conectiva.com/   http://distro.conectiva.com/

-
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/