Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 1996 18:45:41 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-scsi@freebsd.org
Cc:        y0002257@ws.rz.tu-bs.de (Sven Brandenburg)
Subject:   Re: turning off scsi disks
Message-ID:  <199607191645.SAA01264@uriah.heep.sax.de>
In-Reply-To: <9607191425.AA78962@rzrtr1.rz.tu-bs.de> from Sven Brandenburg at "Jul 19, 96 04:25:39 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
As Sven Brandenburg wrote:

> > Making it spin down while being idle would require additional timers
> > in the driver, but should not be undoable. [...]

> When do we start working on it ;-)

You've got the source.  You can start today if you want. :)

> As you may have noticed I am new to FreeBSD (not to computers, though)
> and canīt imagine how much work this could be (shame on me - Iīve never
> taken a look on the related sources.. I will do right now..)

/sys/scsi/sd.c is the driver file.  Watch out the usage of the
function scsi_start_unit().  In FreeBSD-current, there is even a man
page now for timeout(9) explaining the kernel timer handling.  This
should be almost all you need for playing.

You can also have a look at /sys/scsi/od.c, remember, my od does
already spin down at close() time.  (It's a compile-time option, to be
moved out into an ioctl some day.)

You can perhaps start with a fixed timeout first, but should consider
an ioctl to adjust it later.  This will most likely require some
utility like sdcontrol(8) then.

You should also read the chapter about kernel debugging in the
handbook.  Single-stepping some functions, or tweaking some kernel
variable comes extremely handy sometimes.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607191645.SAA01264>