Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!killer!ssbn!bill
From: bill@ssbn.WLK.COM (Bill Kennedy)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Wanted: Software to park disk drive head on XT
Keywords: IBM XT, Seagate ST238R
Message-ID: <197@ssbn.WLK.COM>
Date: 11 May 88 15:30:58 GMT
References: <775@acornrc.UUCP>
Reply-To: bill@ssbn.UUCP (Bill Kennedy)
Distribution: na
Organization: W.L. Kennedy Jr. and Associates, Pipe Creek, TX
Lines: 45

In article <775@acornrc.UUCP> bob@acornrc.UUCP (Bob Weissman) writes:
>Does anyone have software to park the drive head on a Seagate ST-238R
>disk drive?

This one will park anything.  It asks the controller for the number of
drives, then for each drive, the maximum cylinder, and seeks one beyond
that.  Not trying to make it pretty, but to be brief, type it in with
debug and save it.

	mov	ah,08
	mov	dl,80h
	int	13h	;Get # of drives
	jb	error	;Couldn't do it, exit gracefully
	cmp	dl,0	;Maybe no drives?
	jz	error
	mov	count,dl	;Choose your own address
	mov	drive,80h	;ditto, 80h is zero
park:	mov	ah,8
	mov	dl,drive
	int	13	;Get max cylinder for this drive
	xchg	cl,ch
	and	ch,0c0h
	rol	ch,1
	rol	ch,1
	inc	cx
	xchg	cl,ch
	ror	cl,1
	ror	cl,1
	add	cl,1
	mov	ah,0c
	mov	dl,drive
	mov	dh,0
	int	13
	inc	drive
	dec	count
	jnz	park
	cli		;Disable interrupts
	jmp	$	;Replace $ with IP
You should probably set up a stack, and you should provide some graceful
exit if there aren't any drives or the controller can't talk.  This was
intended more as an example rather than a recipe.  The best part is that
it makes no assumptions about your drive(s) other than what the controller
already knows, so you don't need a special park for different ones.
-- 
Bill Kennedy  usenet      {rutgers,ihnp4!killer,cbosgd}!ssbn!bill
              internet    bill@ssbn.WLK.COM