Main Page Data Structures File List Data Fields Globals Related Pages

# clib/ide.h

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 *
    00003 * (C) 2000 by BECK IPC GmbH
    00004 *
    00005 *  BECK IPC GmbH
    00006 *  Garbenheimerstr. 38
    00007 *  D-35578 Wetzlar
    00008 *
    00009 *  Phone : (49)-6441-905-240
    00010 *  Fax   : (49)-6441-905-245
    00011 *
    00012 * ---------------------------------------------------------------------------
    00013
    00014  $Header: ide.h, 6, 16.07.2002 13:24:45, Christoph Stoidner$
    00015
    00016  $Log:
    00017   4    IPC@CHIP  1.3         05.09.2001 11:53:54  Andre Pribil    Added a debug
    00018        output, code now more readable
    00019   3    IPC@CHIP  1.2         03.09.2001 17:52:55  Andre Pribil    16-Bit
    00020        interface added (from Marco Nesseldreher)
    00021   2    IPC@CHIP  1.1         15.02.2001 15:16:52  Christoph Stoidner
    00022   1    IPC@CHIP  1.0         15.02.2001 10:50:03  Christoph Stoidner
    00023  $
    00024
    00025  ****************************************************************************/
    00026 #ifdef _MSC_VER /* If Microsoft C Compiler is used, define new FP_SEG and FP_OFF Macro */
    00027   #ifdef FP_SEG
    00028       #undef FP_SEG
    00029   #endif
    00030   #define FP_SEG(ptr)    ((unsigned int)(((unsigned long)ptr)>>16))
    00031
    00032   #ifdef FP_OFF
    00033       #undef FP_OFF
    00034   #endif
    00035   #define FP_OFF(ptr)    ((unsigned int)(((unsigned long)ptr)&0xFFFF))
    00036 #endif
    00037
    00038 typedef struct
    00039 {
    00040   int   id;
    00041   int   sector_size;
    00042   int   cylinders;
    00043   int   heads;
    00044   int   sectors;
    00045 } T_DRIVE_PARAM;
    00046
    00047 extern T_DRIVE_PARAM drive;  // filled by call to IDE_identify
    00048
    00049 void IDE_reset( void );
    00050
    00051 int IDE_ReadSRAM(unsigned char *bfr); // return 1 if ok, 0 if error
    00052 int IDE_WriteSRAM(unsigned char *bfr); // return 1 if ok, 0 if error
    00053
    00054
    00055 int IDE_identify(void);  // ret 1 if o.k.
    00056
    00057 // read n sectors,  ret 1 if o.k.
    00058 int IDE_read( int cyl,
    00059               int head,
    00060               int sect,
    00061               int cnt,
    00062               unsigned char *buf );
    00063
    00064 // write n sectors,  ret 1 if o.k.
    00065 int IDE_write( int cyl,
    00066                int head,
    00067                int sect,
    00068                int cnt,
    00069                unsigned char *buf );
    00070
    00071
    00072 // ************ Read sectors in LBA mode *************
    00073 // *** ret 1 if o.k.,  0 if error
    00074 int IDE_LBA_read( unsigned long sector, int cnt, unsigned char *buf);
    00075
    00076 // ************ write sectors in LBA mode *************
    00077 // *** ret 1 if o.k.,  0 if error
    00078 int IDE_LBA_write( unsigned long sector, int cnt, unsigned char *buf );
    00079
    00080
    00081