Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ drv_gethardware(D3) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought






       drv_gethardware(D3)                              drv_gethardware(D3)


       NAME
             drv_gethardware - retrieve hardware information

       SYNOPSIS
             #include <sys/types.h>
             #include <sys/ddi.h>
             #include <sys/ddi_i386at.h>
             int drv_gethardware(ulong_t parm, void *value_p);

          Arguments
             parm      The hardware information to be obtained.

             value_p   A pointer to the data space into which the value of
                       the parameter specified by parm is to be copied.

       DESCRIPTION
             drv_gethardware returns the value of the parameter specified
             by parm in the location pointed to by value_p.

          Return Values
             On success, drv_gethardware returns 0.  On failure,
             drv_gethardware returns -1 to indicate that parm specified an
             invalid parameter.

       USAGE
             It is the responsibility of the driver to correctly declare
             the data space needed to hold the information returned.

             Valid values for parm are:

             PROC_INFO
                   Retrieve processor identification information.  value_p
                   should point to a structure of type struct cpuparms.
                   The cpuparms structure is defined as:
             struct cpuparms {
                   ulong_t cpu_id;          /* CPU identification */
                   ulong_t cpu_step;        /* Step (revision) number */
                   ulong_t cpu_resrvd[2];   /* RESERVED for future expansion */
             };
             /* Valid values for cpu_id */
             #define CPU_UNK   0
             #define CPU_i386  1
             #define CPU_i486  2
             #define CPU_i586  3
             #define CPU_i686  4
             #define CPU_i786  5


                           Copyright 1994 Novell, Inc.               Page 1













      drv_gethardware(D3)                              drv_gethardware(D3)


            /* Valid values for cpu_step */
            #define STEP_UNK  0
            #define STEP_B1   1           /* if cpu_id == CPU_i386 */

            IOBUS_TYPE
                  Retrieve the bus type.  Valid values are BUS_ISA,
                  BUS_EISA, and BUS_MCA.

            EISA_BRDID
                  Retrieve the EISA board ID for a controller in a given
                  EISA slot.  This function takes a pointer to a long
                  variable, which should contain the EISA slot number when
                  upon entry, and which will contain the EISA board ID
                  when the function exits.  If the slot number is invalid
                  or the system does not have an EISA bus, -1 is returned.
                  If the board ID cannot be determined, -1 is placed in
                  the parameter variable.

            TOTAL_MEM
                  Retrieve the size of memory (in bytes).

            DMA_SIZE
                  Retrieve the number of bits available for DMA
                  addressing.

            BOOT_DEV
                  Retrieve which device the system was booted from.
                  value_p should point to a structure of type struct
                  bootdev.  The bootdev structure is defined as:
            struct bootdev {
                  ulong_t   bdv_type;        /* Type of the boot device */
                  ulong_t   bdv_unit;        /* Unit number of the boot device */
                  ulong_t   bdv_resrvd[2];   /* RESERVED for future expansion */
            };
            /* Valid values for bdv_type */
            #define BOOT_FLOPPY   1
            #define BOOT_DISK     2
            #define BOOT_CDROM    3
            #define BOOT_NETWORK  4

            HD_PARMS
                  Retrieve a pointer to the parameters for a specified
                  hard disk.  value_p should point to a structure of type
                  struct hdparms.  The driver must specify the hard disk
                  by setting the hp_unit field of the hdparms structure
                  pointed to by value_p to the unit number of the hard


                          Copyright 1994 Novell, Inc.               Page 2













       drv_gethardware(D3)                              drv_gethardware(D3)


                   disk prior to calling drv_gethardware.  The hdparms
                   structure is defined as:
             struct hdparms {
                   ulong_t   hp_unit;         /* Hard disk unit number */
                   ulong_t   hp_ncyls;        /* Number of cylinders (0 == no disk) */
                   ulong_t   hp_nheads;       /* Number of heads */
                   ulong_t   hp_nsects;       /* Number of sectors per track */
                   ushort_t  hp_precomp;      /* Write precompensation cylinder */
                   ushort_t  hp_lz;           /* Landing zone cylinder number */
                   ulong_t   hp_resrvd[2];    /* RESERVED for future expansion */
             };

          Level
             Initialization, Base or Interrupt.

          Synchronization Constraints
             Does not sleep.

             Driver-defined basic locks, read/write locks, and sleep locks
             may be held across calls to this function.

       NOTICES
          Portability
             AT-compatible architectures

          Applicability
             ddi: 4, 5, 5mp, 6, 6mp, 7, 7mp

          Future Directions
             This interface is expected to be replaced or modified in a
             future release.

















                           Copyright 1994 Novell, Inc.               Page 3








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026