home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / bugs / sys5 / 162 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  2.7 KB

  1. Xref: sparky comp.bugs.sys5:162 comp.unix.sys5.r4:1098
  2. Path: sparky!uunet!auspex-gw!guy
  3. From: guy@Auspex.COM (Guy Harris)
  4. Newsgroups: comp.bugs.sys5,comp.unix.sys5.r4
  5. Subject: Can a script find out, under SVR4, the ABI to which a machine conforms?
  6. Message-ID: <16187@auspex-gw.auspex.com>
  7. Date: 1 Jan 93 22:10:54 GMT
  8. Sender: news@auspex-gw.auspex.com
  9. Followup-To: comp.bugs.sys5
  10. Organization: Auspex Systems, Santa Clara
  11. Lines: 50
  12. Nntp-Posting-Host: auspex.auspex.com
  13.  
  14. The SVR4 documentation I have indicates that the "sysinfo()" routine
  15. will, if given the "command" SI_ARCHITECTURE, return "a string
  16. describing the instruction set architecture of the current system, e.g.,
  17. 'mc68030', 'm32100', or 'i80486'."
  18.  
  19. It also hints that said "command" is used by "uname -p" to return the
  20. "processor type" string.
  21.  
  22. Unfortunately, as I read it, that *doesn't* correspond to the ABI to
  23. which the machine conforms:
  24.  
  25.     there isn't a Motorola 68030 ABI - there's a Motorola 68K ABI,
  26.     but machines with 68020's, 68030's, or 68040's all have the
  27.     right instruction set for the 68K ABI;
  28.  
  29.     similarly, there isn't an Intel 486 ABI- there's an Intel i386
  30.     ABI, but machines with 386's, 486's, or presumably
  31.     586's^H^H^H^H^HPentia have the right instruction set for the
  32.     i386 ABI, or simulate the missing instructions in software, e.g. 
  33.     if the floating-point unit is missing;
  34.  
  35.     the same presumably applies to other ABIs for processors for
  36.     architectures that have acquired new instruction over time.
  37.  
  38. A *program* probably doesn't have to care what the ABI is for the
  39. machine on which it's running - if it's the wrong ABI, it won't run,
  40. period - but a *script* might care.  In particular, Frame Maker has a
  41. "fmarch" script that, at least on some platforms, is used to select the
  42. directory from which executables are to be run.
  43.  
  44. If, in fact, "uname -p" returns a *detailed* processor type, rather than
  45. an ABI type, "fmarch" and, conceivably, other scripts will have to know
  46. all the detailed processor types that support a particular ABI, and may
  47. thus have to change over time as new instructions are added to
  48. instruction sets and new processor types are added.
  49.  
  50. Perhaps later SVR4.x releases have already done this, but if not:
  51.  
  52.     There should be a new SI_ABI "command" for "sysinfo()", that
  53.     returns a string that indicates the ABI to which a system
  54.     conforms; for example, it would return "i386", or something such
  55.     as that, on 80386-based machines, 80486-based machines,
  56.     Am386-based machines, Cyrix-chip-based machines, Pentium-based
  57.     machines, etc..
  58.  
  59.     The string returned by SI_ABI for a particular ABI should be
  60.     part of the ABI specification.
  61.  
  62.     There should be a "-b" flag to "uname" to write the string
  63.     returned by SI_ABI to the standard output.
  64.