home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume26
/
sysinfo-1.0
/
part01
/
info-sunos.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-10
|
16KB
|
645 lines
/*
* Copyright (c) 1992 Michael A. Cooper.
* This software may be freely distributed provided it is not sold for
* profit and the author is credited appropriately.
*/
#ifndef lint
static char *RCSid = "$Header: /src/common/usc/bin/sysinfo/RCS/info-sunos.c,v 1.19 1992/04/26 23:32:06 mcooper Exp $";
#endif
/*
* $Log: info-sunos.c,v $
* Revision 1.19 1992/04/26 23:32:06 mcooper
* Add Copyright notice
*
* Revision 1.18 1992/04/19 18:44:59 mcooper
* Change around GS framebuffer definition according to Greg Earle.
*
* Revision 1.17 1992/04/17 23:33:04 mcooper
* Add RomVecNL.
*
* Revision 1.16 1992/04/17 01:10:11 mcooper
* Moved DEVICE *() function declares to defs.h.
*
* Revision 1.15 1992/04/15 02:42:12 mcooper
* Change "ipi3sc" to DT_GENERIC.
*
* Revision 1.14 1992/04/12 22:03:13 mcooper
* - Add Tadpole/SPARCbook support.
* - Add Solbourne models and arch's.
*
* Revision 1.13 1992/03/31 00:44:40 mcooper
* Add sun386 kernel arch.
*
* Revision 1.12 1992/03/28 21:29:24 mcooper
* Move NetifNL to netif.c.
*
* Revision 1.11 1992/03/22 00:20:10 mcooper
* Major cleanup and re-org.
*
* Revision 1.10 1992/03/08 04:58:56 mcooper
* The old NETIFTAB has been removed by placing the old data
* directly in the devdatatab.
*
* Revision 1.9 1992/03/06 18:34:02 mcooper
* - Use new NAMETAB whenever possible.
* - Replace _size vars with { 0 } entries.
*
* Revision 1.8 1992/03/01 23:30:15 mcooper
* More more SunOS specific code from sysinfo.c to here.
*
* Revision 1.7 1992/02/27 22:01:22 mcooper
* Add support for getting CPU info for sun4m.
*
* Revision 1.6 1992/02/27 20:37:59 mcooper
* Move netif names in devdatatab to top to avoid conflicts
* of "fd" and "fddi".
*
* Revision 1.5 1992/02/27 00:14:22 mcooper
* Add "ei" (Solbourne ethernet interface) to devdatatab.
*
* Revision 1.4 1992/02/26 19:07:02 mcooper
* Add more random Sun devices.
*
* Revision 1.3 1992/02/25 00:59:35 mcooper
* Move tape info to local MTINFO.
*
* Revision 1.2 1992/02/25 00:23:29 mcooper
* - Cleanup framebuffers.
* - Add mt info.
* - Update device table.
*
* Revision 1.1 1992/02/22 02:20:19 mcooper
* Initial revision
*
*/
/*
* SunOS specific device info
*/
#include <stdio.h>
#include "system.h"
#include "defs.h"
#include <nlist.h>
#include <sys/types.h>
#include <sys/buf.h>
#include <sys/mtio.h>
#include <sun/dkio.h>
#include <sun/fbio.h>
#if defined(TADPOLE)
#include <taddev/ide_drvr_def.h>
#else /* !TADPOLE */
# if defined(HAVE_IPI)
# include <sundev/ipvar.h>
# endif /* HAVE_IPI */
# include <sundev/xdreg.h>
# include <sundev/xyreg.h>
# include <sundev/scsi.h>
# if defined(i386)
# include <sundev/sdreg.h>
# endif
#endif /* TADPOLE */
/*
* Characters for disk partitions
*/
char PartChars[] = "abcdefgh";
/*
* CPU (model) symbol
*/
struct nlist CpuNL[] = {
#if defined(COFF)
{ "cpu" },
#else
{ "_cpu" },
#endif /* COFF */
{ 0 },
};
#if defined(HAVE_MAINBUS)
/*
* MainBus name list
*/
struct nlist MainBusNL[] = {
#if defined(COFF)
{ "mbdinit" },
#else
{ "_mbdinit" },
#endif /* COFF */
{ 0 },
};
#endif /* HAVE_MAINBUS */
#if defined(HAVE_OPENPROM)
/*
* OpenPROM name list
*/
struct nlist OpenPROMNL[] = {
#if defined(COFF)
{ "top_devinfo" },
#else
{ "_top_devinfo" },
#endif /* COFF */
{ 0 },
};
#endif /* HAVE_OPENPROM */
/*
* RomVec
*/
struct nlist RomVecNL[] = {
#if defined(COFF)
{ "romp" },
#else
{ "_romp" },
#endif /* COFF */
{ 0 },
};
/*
* Sun system model table
*
* Not all values are real machines. What is found below is
* extracted from /usr/include/{sun3,sun3x,sun4,sun4c,sun4m}/cpu.h.
*/
NAMETAB ModelTab[] = {
/*
* Sun-3 CPU's
*/
#ifdef CPU_SUN3_50
{ CPU_SUN3_50, "3/50" },
#endif
#ifdef CPU_SUN3_60
{ CPU_SUN3_60, "3/60" },
#endif
#ifdef CPU_SUN3_E
{ CPU_SUN3_E, "3/Eurocard" },
#endif
#ifdef CPU_SUN3_110
{ CPU_SUN3_110, "3/110" },
#endif
#ifdef CPU_SUN3_160
{ CPU_SUN3_160, "3/100 Series" },
#endif
#ifdef CPU_SUN3_260
{ CPU_SUN3_260, "3/200 Series" },
#endif
/*
* Sun-3x CPU's
*/
#ifdef CPU_SUN3X_80:
{ CPU_SUN3X_80, "3/80" },
#endif
#ifdef CPU_SUN3X_470
{ CPU_SUN3X_470, "3/400 Series" },
#endif
/*
* Sun-4c CPU's.
*/
#ifdef CPU_SUN4C_05:
{ CPU_SUN4C_05, "4/05" },
#endif
#ifdef CPU_SUN4C_10:
{ CPU_SUN4C_10, "4/10" },
#endif
#ifdef CPU_SUN4C_20:
{ CPU_SUN4C_20, "4/20 (SPARCstation SLC)" },
#endif
/*
* XXX The 4/25 and 4/30 are both ELC's depending on your OS
*/
#ifdef CPU_SUN4C_25:
{ CPU_SUN4C_25, "4/25 (SPARCstation ELC)" },
#endif
#ifdef CPU_SUN4C_30:
{ CPU_SUN4C_30, "4/30 (SPARCstation ELC)" },
#endif
#ifdef CPU_SUN4C_32:
{ CPU_SUN4C_32, "4/32" },
#endif
#ifdef CPU_SUN4C_40:
{ CPU_SUN4C_40, "4/40 (SPARCstation IPC)" },
#endif
#ifdef CPU_SUN4C_45:
{ CPU_SUN4C_45, "4/45" },
#endif
#ifdef CPU_SUN4C_50:
{ CPU_SUN4C_50, "4/50 (SPARCstation IPX)" },
#endif
#ifdef CPU_SUN4C_60:
{ CPU_SUN4C_60, "4/60 (SPARCstation 1)" },
#endif
#ifdef CPU_SUN4C_65:
{ CPU_SUN4C_65, "4/65 (SPARCstation 1+)" },
#endif
#ifdef CPU_SUN4C_70:
{ CPU_SUN4C_70, "4/70" },
#endif
#ifdef CPU_SUN4C_75:
{ CPU_SUN4C_75, "4/75 (SPARCstation 2)" },
#endif
#ifdef CPU_SUN4C_80:
{ CPU_SUN4C_80, "4/80" },
#endif
#ifdef CPU_SUN4C_85:
{ CPU_SUN4C_85, "4/85" },
#endif
/*
* Sun-4 CPU's
*/
#ifdef CPU_SUN4_110
{ CPU_SUN4_110, "4/110" },
#endif
#ifdef CPU_SUN4_260
{ CPU_SUN4_260, "SPARCsystem 200" },
#endif
#ifdef CPU_SUN4_330
{ CPU_SUN4_330, "SPARCsystem 300" },
#endif
#ifdef CPU_SUN4_460 /* Sun changed the 4_460 to 4_470 in 4.1.1 */
{ CPU_SUN4_460, "SPARCsystem 400" },
#endif
#ifdef CPU_SUN4_470
{ CPU_SUN4_470, "SPARCsystem 400" },
#endif
/*
* Sun-4m CPU's
*/
#ifdef CPU_SUN4M_690
{ CPU_SUN4M_690, "SPARCsystem 600" },
#endif
/*
* Sun-386i CPU's
*/
#ifdef CPU_SUN386_MB1
{ CPU_SUN386_MB1, "386i (MB1)" },
#endif
#ifdef CPU_SUN386_150
/* The 386i/150 and 386i/250 are the same */
{ CPU_SUN386_150, "386i" },
#endif
/*
* Solbourne CPU's
*/
#ifdef CPU_SERIES4_500
{ CPU_SERIES4_500, "Series4/500" },
#endif
#ifdef CPU_SERIES4_600
{ CPU_SERIES4_600, "Series4/600" },
#endif
#ifdef CPU_SERIES5_500
{ CPU_SERIES5_500, "Series5/500" },
#endif
#ifdef CPU_SERIES5_600
{ CPU_SERIES5_600, "Series5/600" },
#endif
#ifdef CPU_SERIES5_900
{ CPU_SERIES5_900, "Series5/900" },
#endif
#ifdef CPU_SERIES5E_500
{ CPU_SERIES5E_500, "Series5E/500" },
#endif
#ifdef CPU_SERIES5E_600
{ CPU_SERIES5E_600, "Series5E/600" },
#endif
#ifdef CPU_SERIES5E_900
{ CPU_SERIES5E_900, "Series5E/900" },
#endif
#ifdef CPU_SERIES6_500
{ CPU_SERIES6_500, "Series6/500" },
#endif
#ifdef CPU_SERIES6_600
{ CPU_SERIES6_600, "Series6/600" },
#endif
#ifdef CPU_SERIES6_900
{ CPU_SERIES6_900, "Series6/900" },
#endif
/*
* TadPole CPU's
*/
#ifdef CPU_TAD_SPBK_S1
{ CPU_TAD_SPBK_S1, "SPARCbook-1" },
#endif
{ 0 },
};
/*
* Kernel Architecture table
*/
NAMETAB KernArchTab[] = {
#ifdef SUN386_ARCH
{ SUN386_ARCH, "sun386" },
#endif
#ifdef SUN3_ARCH
{ SUN3_ARCH, "sun3" },
#endif
#ifdef SUN3X_ARCH
{ SUN3X_ARCH, "sun3x" },
#endif
#ifdef SUN4_ARCH
{ SUN4_ARCH, "sun4" },
#endif
#ifdef SUN4C_ARCH
{ SUN4C_ARCH, "sun4c" },
#endif
#ifdef SUN4M_ARCH
{ SUN4M_ARCH, "sun4m" },
#endif
/*
* Tadpole
*/
#ifdef TAD_SPBK_ARCH
{ TAD_SPBK_ARCH, "SPARCbook" },
#endif
/*
* Solbourne
*/
#ifdef CPU_TYPE_SERIES4
{ CPU_TYPE_SERIES4, "Series4" },
#endif
#ifdef CPU_TYPE_SERIES5
{ CPU_TYPE_SERIES5, "Series5" },
#endif
#ifdef CPU_TYPE_SERIES5E
{ CPU_TYPE_SERIES5E, "Series5E" },
#endif
#ifdef CPU_TYPE_SERIES6
{ CPU_TYPE_SERIES6, "Series6" },
#endif
#ifdef CPU_TYPE_KAP_M2
{ CPU_TYPE_KAP_M2, "KAP_M2" },
#endif
{ 0 },
};
/*
* Device Data Table
*
* Compares are done by the length of the string appearing in
* the first columns. Therefore, longer names must appear before
* any shorter names that are not unique. e.g. "lebuffer" needs to
* be before "le".
*/
DEVDATATAB DevDataTab[] = {
{ "ie", 0, "Intel 82586 LAN Co-Processor",
"10Mb/sec Ethernet", ProbeNetif },
{ "ei", 0, "Solbourne IOASIC AMD Lance Am7990",
"10Mb/sec Ethernet", ProbeNetif },
{ "lebuffer", DT_PSEUDO, NULL, NULL, ProbeGeneric },
{ "le", 0, "AMD Lance Am7990",
"10Mb/sec Ethernet", ProbeNetif },
{ "ne", 0, "Interphase NC400",
"10Mb/sec Ethernet", ProbeNetif },
{ "fddi", 0, "Sun FDDI",
"100Mb/sec FDDI", ProbeNetif },
{ "sd", 0, NULL, NULL, ProbeDiskDrive },
{ "xd", 0, NULL, NULL, ProbeDiskDrive },
{ "xy", 0, NULL, NULL, ProbeDiskDrive },
{ "id", 0, NULL, NULL, ProbeDiskDrive },
{ "sr", 0, "CD-ROM", NULL, ProbeDiskDrive },
{ "fd", 0, "Floppy", NULL, ProbeDiskDrive },
{ "bwone", 0, NULL, NULL, ProbeFrameBuffer },
{ "bwtwo", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgone", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgtwo", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgthree", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgfour", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgsix", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgeight", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgnine", 0, NULL, NULL, ProbeFrameBuffer },
{ "cgtwelve", 0, NULL, NULL, ProbeFrameBuffer },
{ "gpone", 0, NULL, NULL, ProbeFrameBuffer },
{ "gt", 0, NULL, NULL, ProbeFrameBuffer },
{ "taac", 0, NULL, NULL, ProbeFrameBuffer },
{ "vx", 0, NULL, NULL, ProbeFrameBuffer },
{ "Cypress,CY", 0, NULL, "CPU", ProbeCPU },
{ "sbus", DT_BUS, NULL, NULL, ProbeGeneric },
{ "vme", DT_BUS, NULL, NULL, ProbeGeneric },
{ "obio", DT_BUS, NULL, "OnBoard I/O",
ProbeGeneric },
{ "obmem", DT_BUS, NULL, "OnBoard Memory",
ProbeGeneric },
{ "iommu", DT_BUS, NULL, NULL, ProbeGeneric },
{ "dma", DT_PSEUDO, NULL, NULL, ProbeGeneric },
{ "openprom", DT_PSEUDO, NULL, NULL, ProbeGeneric },
/* Old OpenPROMs say "Sun 4/60" instead of "SUNW,Sun 4/60" */
{ "Sun ", DT_PSEUDO, NULL, NULL, ProbeGeneric },
{ "SUNW,Sun", DT_PSEUDO, NULL, NULL, ProbeGeneric },
{ "SUNW,pn", DT_PSEUDO, NULL, NULL, ProbeGeneric },
{ "ipi3sc", DT_GENERIC, NULL, NULL, ProbeGeneric },
{ "esp", DT_DISKCTLR, "Emulex SCSI interface",
NULL, ProbeGeneric },
{ "st", DT_TAPEDRIVE, "SCSI",
NULL, ProbeTapeDrive },
{ "xtc", DT_TAPECTLR, "Xylogics 472",
"1/2 inch tape controller", ProbeGeneric },
{ "xt", DT_TAPEDRIVE, "Fujitsu M2444",
"1/2 inch tape drive", ProbeTapeDrive },
{ "audio", DT_GENERIC, "AM79C30A DSC",
"telephone quality audio", ProbeGeneric },
{ "zs", DT_GENERIC, "Zilog 8530",
"serial communications chip", ProbeGeneric },
{ "mti", DT_GENERIC, "ALM-1 (Systech MTI-1600)",
"16-line terminal multiplexer", ProbeGeneric },
{ "mcp", DT_GENERIC, "ALM-2 (Sun MCP/ALM)",
"16-line terminal multiplexer", ProbeGeneric },
{ "fpa", DT_GENERIC, "Wietek FPA",
"floating point accelerator", ProbeGeneric },
{ "des", DT_GENERIC, "AmZ8068 Data Ciphering Processor",
"NBS Data Encryption Standard", ProbeGeneric },
{ "vpc", DT_GENERIC, "Systech VPC-2200",
"Versatec & Centronics printer/plotter interface", ProbeGeneric },
{ "pp", DT_GENERIC, "Parallel Port",
"Centronics-compatible parallel printer port", ProbeGeneric },
{ "SUNW,bpp", DT_GENERIC, "SBus Printer Card",
"bidirectional parallel port", ProbeGeneric },
{ "SUNW,lpvi", DT_GENERIC, "SBus Printer Card",
"laser printer video interface", ProbeGeneric },
{ "db", DT_GENERIC, "Sun Dials Box",
NULL, ProbeGeneric },
{ "pr", DT_GENERIC, "PrestoServe",
"file system accelerator", ProbeGeneric },
/*
* Tadpole devices
*/
{ "nice", 0, "NICE Ethernet Co-processor",
"10Mb/sec Ethernet", ProbeNetif },
{ "par", DT_GENERIC, "Parallel Port",
"Centronics-compatible parallel printer port", ProbeGeneric },
{ "modem", DT_GENERIC, NULL,
"Hayes compatible modem", ProbeGeneric },
{ "urt", DT_GENERIC, NULL,
"serial communications chip", ProbeGeneric },
{ "vga", 0, NULL, NULL, ProbeFrameBuffer },
{ 0 },
};
/*
* Table of known Sun Disk Controllers.
*/
DKCTLRTAB DkCtlrTab[] = {
#if defined(DKC_XY450) && defined(XY_READ)
{ DKC_XY450, "Xylogics 450/451 SMD", XY_READ },
#endif
#if defined(DKC_ACB4000) && defined(SC_READ)
{ DKC_ACB4000, "Adaptec ACB4000 SCSI", SC_READ },
#endif
#if defined(DKC_MD21) && defined(SC_READ)
{ DKC_MD21, "Emulex MD21 SCSI", SC_READ },
#endif
#if defined(DKC_NCRFLOPPY) && defined(SC_READ)
{ DKC_NCRFLOPPY, "NCR Floppy SCSI", SC_READ },
#endif
#if defined(DKC_XD7053) && defined(XD_READ)
{ DKC_XD7053, "Xylogics 7053/753 SMD", XD_READ },
#endif
#if defined(DKC_SMSFLOPPY) && defined(SC_READ)
{ DKC_SMSFLOPPY, "SMS Floppy SCSI", SC_READ },
#endif
#if defined(DKC_SCSI_CCS) && defined(SC_READ)
{ DKC_SCSI_CCS, "SCSI CCS", SC_READ },
#endif
#if defined(DKC_CCS) && defined(SC_READ)
{ DKC_CCS, "CCS SCSI", SC_READ },
#endif
#if defined(DKC_NEC765)
{ DKC_NEC765, "NEC 765 Floppy", -1 },
#endif
#if defined(DKC_INTEL82072)
{ DKC_INTEL82072, "Intel 82072 Floppy", -1 },
#endif
#if defined(DKC_PANTHER) && defined(IP_READ)
{ DKC_PANTHER, "Sun ISP-80 (Panther) IPI-2", IP_READ },
#endif
#if defined(DKC_XD753_IPI) && defined(XD_READ)
/*
* Solbourne
*/
{ DKC_XD753_IPI, "Xylogics SV-{67}800 IPI", XD_READ },
#endif
#if defined(TADPOLE)
/*
* Tadpole
*/
{ 19, "PC IDE", IDE_READ },
#endif /* TADPOLE */
{ 0 },
};
/*
* Table of known Sun Frame Buffers
*/
NAMETAB FBTab[] = {
#ifdef FBTYPE_SUN2BW
{ FBTYPE_SUN2BW, "Black & White memory (bwtwo)" },
#endif
#ifdef FBTYPE_SUN2COLOR
{ FBTYPE_SUN2COLOR, "Color Graphics w/rasterop (cgtwo)" },
#endif
#ifdef FBTYPE_SUN2GP
{ FBTYPE_SUN2GP, "GS Graphics Processor (cgtwelve)" },
#endif
#ifdef FBTYPE_SUN5COLOR
{ FBTYPE_SUN5COLOR, "Sun-386i Accelerated Color" },
#endif
#ifdef FBTYPE_SUN3COLOR
{ FBTYPE_SUN3COLOR, "8-bit Color (cgthree)" },
#endif
#ifdef FBTYPE_MEMCOLOR
{ FBTYPE_MEMCOLOR, "B&W memory overlay plane (bwtwo)" },
#endif
#ifdef FBTYPE_SUN4COLOR
{ FBTYPE_SUN4COLOR, "Color memory w/overlay (cgfour)" },
#endif
#ifdef FBTYPE_SUNFAST_COLOR
{ FBTYPE_SUNFAST_COLOR, "GX 8-bit Accelerated Color (cgsix)" },
#endif
#ifdef FBTYPE_SUNROP_COLOR
{ FBTYPE_SUNROP_COLOR, "24-bit Color w/rasterop" },
#endif
#ifdef FBTYPE_SUNFB_VIDEO
{ FBTYPE_SUNFB_VIDEO, "Video Mixing" },
#endif
#ifdef FBTYPE_SUNGIFB
{ FBTYPE_SUNGIFB, "Medical Imaging" },
#endif
#ifdef FBTYPE_SUNGPLAS
{ FBTYPE_SUNGPLAS, "Plasma Panel" },
#endif
#ifdef FBTYPE_SUNGP3
{ FBTYPE_SUNGP3, "24-bit Accelerated GPSI Color" },
#endif
#ifdef FBTYPE_SUNGT
{ FBTYPE_SUNGT, "24-bit Color Graphics Accelerator (gt)" },
#endif
/*
* Tadpole frame buffer's
*/
#if defined(TADPOLE)
#ifdef FBTYPE_NOTSUN1
{ FBTYPE_NOTSUN1, "VGA Graphics Card" },
#endif
#endif /* TADPOLE */
{ 0 },
};
/*
* Magnetic Tape Info.
*
* This info is based on <sys/mtio.h>. It would be nice to just
* use that info, but not all systems have MT_TAPE_INFO.
*/
NAMETAB MtInfo[] = {
#ifdef MT_ISCPC
{ MT_ISCPC, "TapeMaster 1/2-inch" },
#endif
#ifdef MT_ISXY
{ MT_ISXY, "Xylogics 472 1/2-inch" },
#endif
#ifdef MT_ISAR
{ MT_ISAR, "Archive QIC-11" },
#endif
#ifdef MT_ISSYSGEN11
{ MT_ISSYSGEN11, "Sysgen QIC-11" },
#endif
#ifdef MT_ISSYSGEN
{ MT_ISSYSGEN, "Sysgen QIC-24" },
#endif
#ifdef MT_ISMT02
{ MT_ISMT02, "Emulex MT-02 QIC-24" },
#endif
#ifdef MT_ISVIPER1
{ MT_ISVIPER1, "Archive QIC-150" },
#endif
#ifdef MT_ISWANGTEK1
{ MT_ISWANGTEK1, "Wangtek QIC-150" },
#endif
#ifdef MT_ISKENNEDY
{ MT_ISKENNEDY, "Kennedy 9612 1/2-inch" },
#endif
#ifdef MT_ISHP
{ MT_ISHP, "HP 88780 1/2-inch" },
#endif
#ifdef MT_ISEXABYTE
{ MT_ISEXABYTE, "Exabyte EXB-8200 8mm" },
#endif
#ifdef MT_ISEXB8500
{ MT_ISEXB8500, "Exabyte EXB-8500 8mm" },
#endif
{ 0 },
};