
/* Prorgamm     : HDPark
   Autor        : Jürgen Pechmann , Eichenhainstr. 4 , 8561 Ottensoos , Tel.09123/5794
   Zweck        : Schreib- Lesekopf der HDisk in Parkstellung bringen
   Compiler     : Aztec C V3.6
   Compilieren  : cc HDPark.c +L, ln HDPark.o -lc
*/

#include "exec/io.h"

#define CMD_SEEK 10L;

struct IOStdReq *ioreq;


main()
{
   ULONG ParkCyl,Error;
  
   ParkCyl=670*26*512;  /* Park-Cylinder * Sektoren pro Spur * 512 (Bytes pro Sektor)*/

   Forbid();
 
   Error = OpenDevice ( "harddisk.device" , 1 , ioreq , 0 );
   if (Error != 0) printf("harddisk.device konnte nicht geöffnet werden \n");
  
   ioreq->io_Command=CMD_SEEK;
   ioreq->io_Data = NULL;
   ioreq->io_Length = NULL;
   ioreq->io_Offset = ParkCyl;
 
   Error = DoIO(ioreq);

   CloseDevice(ioreq);
    
   while(Error==0) 
       printf("\nSchreib-Lesekopf der HDisk geparkt     **Rechner abschalten**");
            
   if  ( Error!=0)  printf("Kopf konnte nicht geparkt werden\n");
               
   Permit();
}


                     
   
