Re: [Hdaps-devel] Re: IBM HDAPS things are looking up

2005-07-04 Thread Shawn Starr

>From what I'm told its not specific to hard disk, you
can put any laptop HD and it will work the same (?).

Shawn.

--- Jens Axboe <[EMAIL PROTECTED]> wrote:

> On Mon, Jul 04 2005, Lenz Grimmer wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > Hi Jens!
> > 
> > Thanks for the sample code. I've trimmed the
> recipient list a bit...
> > 
> > Jens Axboe wrote:
> > 
> > > Perhaps the IDLE or IDLEIMMEDIATE commands imply
> a head parking, that
> > > would make sense. As you say, you can hear a
> drive parking its head.
> > > Here's a test case, it doesn't sound like it's
> parking the hard here.
> > 
> > Not here either, but let me check, if I understand
> this correctly:
> > 
> > > #include 
> > > #include 
> > > #include 
> > > #include 
> > > #include 
> > > 
> > > int main(int argc, char *argv[])
> > > {
> > >   char cmd[4] = { 0xe1, 0, 0, 0 };
> > 
> > The "0xe1" in here is what is defined as
> "WIN_IDLEIMMEDIATE" in hdreg.h,
> > correct?
> 
> Correct.
> 
> > >   int fd;
> > > 
> > >   if (argc < 2) {
> > >   printf("%s \n", argv[0]);
> > >   return 1;
> > >   }
> > > 
> > >   fd = open(argv[1], O_RDONLY);
> > 
> > Hmm, don't I need to actually have *write* access
> for sending an ioctl?
> 
> No, but you need CAP_SYS_RAWIO capability. So run it
> as root.
> 
> > >   if (fd == -1) {
> > >   perror("open");
> > >   return 1;
> > >   }
> > > 
> > >   if (ioctl(fd, HDIO_DRIVE_CMD, cmd))
> > >   perror("ioctl");
> > > 
> > >   close(fd);
> > >   return 0;
> > > }
> > 
> > I will give it another try, after clarifying the
> above questions - maybe
> > there is a command that will perform the desired
> task. If not, I guess
> > we're back at snooping what the Windows driver
> does here...
> 
> I'm not aware of a generally specificed command,
> it's likely that the
> ibm drive has a vendor specific one. Or that one of
> the idle commands
> can be configured to park the drive. Or... I'm not
> sure you'll find
> anything interesting in the windows driver, I would
> imagine that the
> user app is the one issuing the ide command (like
> the linux equiv would
> as well).
> 
> -- 
> Jens Axboe
> 
> 
> 
>
---
> SF.Net email is sponsored by: Discover Easy Linux
> Migration Strategies
> from IBM. Find simple to follow Roadmaps,
> straightforward articles,
> informative Webcasts and more! Get everything you
> need to get up to
> speed, fast.
>
http://ads.osdn.com/?ad_id=7477_id=16492=click
> ___
> Hdaps-devel mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/hdaps-devel
> 

-
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: [Hdaps-devel] Re: IBM HDAPS things are looking up

2005-07-04 Thread Shawn Starr

From what I'm told its not specific to hard disk, you
can put any laptop HD and it will work the same (?).

Shawn.

--- Jens Axboe [EMAIL PROTECTED] wrote:

 On Mon, Jul 04 2005, Lenz Grimmer wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  Hi Jens!
  
  Thanks for the sample code. I've trimmed the
 recipient list a bit...
  
  Jens Axboe wrote:
  
   Perhaps the IDLE or IDLEIMMEDIATE commands imply
 a head parking, that
   would make sense. As you say, you can hear a
 drive parking its head.
   Here's a test case, it doesn't sound like it's
 parking the hard here.
  
  Not here either, but let me check, if I understand
 this correctly:
  
   #include stdio.h
   #include unistd.h
   #include fcntl.h
   #include sys/ioctl.h
   #include linux/hdreg.h
   
   int main(int argc, char *argv[])
   {
 char cmd[4] = { 0xe1, 0, 0, 0 };
  
  The 0xe1 in here is what is defined as
 WIN_IDLEIMMEDIATE in hdreg.h,
  correct?
 
 Correct.
 
 int fd;
   
 if (argc  2) {
 printf(%s dev\n, argv[0]);
 return 1;
 }
   
 fd = open(argv[1], O_RDONLY);
  
  Hmm, don't I need to actually have *write* access
 for sending an ioctl?
 
 No, but you need CAP_SYS_RAWIO capability. So run it
 as root.
 
 if (fd == -1) {
 perror(open);
 return 1;
 }
   
 if (ioctl(fd, HDIO_DRIVE_CMD, cmd))
 perror(ioctl);
   
 close(fd);
 return 0;
   }
  
  I will give it another try, after clarifying the
 above questions - maybe
  there is a command that will perform the desired
 task. If not, I guess
  we're back at snooping what the Windows driver
 does here...
 
 I'm not aware of a generally specificed command,
 it's likely that the
 ibm drive has a vendor specific one. Or that one of
 the idle commands
 can be configured to park the drive. Or... I'm not
 sure you'll find
 anything interesting in the windows driver, I would
 imagine that the
 user app is the one issuing the ide command (like
 the linux equiv would
 as well).
 
 -- 
 Jens Axboe
 
 
 

---
 SF.Net email is sponsored by: Discover Easy Linux
 Migration Strategies
 from IBM. Find simple to follow Roadmaps,
 straightforward articles,
 informative Webcasts and more! Get everything you
 need to get up to
 speed, fast.

http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
 ___
 Hdaps-devel mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/hdaps-devel
 

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