home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / bugs / sys5 / 178 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  2.4 KB

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.bugs.sys5
  4. Subject: Re: Improving "file" (was Re: Making Solaris 2.1 smarter...)
  5. Message-ID: <16356@auspex-gw.auspex.com>
  6. Date: 12 Jan 93 18:36:08 GMT
  7. References: <16320@auspex-gw.auspex.com> <1993Jan10.143907.12860@ulysses.att.com> <16329@auspex-gw.auspex.com> <1993Jan11.183955.17911@ulysses.att.com>
  8. Sender: news@auspex-gw.auspex.com
  9. Distribution: na
  10. Organization: Auspex Systems, Santa Clara
  11. Lines: 47
  12. Nntp-Posting-Host: bootme.auspex.com
  13.  
  14. >(guy) requires a-priori partitioning of file formats into
  15. >big and little endian classes -- the problem here is that
  16. >there are some formats that are architecture independent
  17. >but still byte order dependent, like the binary cpio format
  18. >the solution is to provide duplicate magic file entries:
  19. >
  20. >0    short        070707        cpio archive
  21. >0    short        0143561        cpio archive
  22.  
  23. Nope.  Try:
  24.  
  25. 0    short        070707        cpio archive
  26. 0    short        0143561        byte-swapped cpio archive
  27.  
  28. Given that, unfortunately, not all versions of "cpio" are capable of
  29. decoding binary "cpio" files with the opposite byte order, it is
  30. potentially useful to know whether the archive is byte-swapped or not.
  31.  
  32. >(gsf) is based on the assumtion that a byte swapped binary magic number
  33. >will not clash with other magic file magic numbers (not a problem so far)
  34.  
  35. Actually, I think the old Sun-2 executable format *does* clash with the
  36. VAX BSD executable format - one has 4 bytes of 0407/0410/0413 in
  37. big-endian order at the beginning, the other has them in little-endian
  38. order at the beginning.
  39.  
  40. >this method avoids most magic file duplication for formats that cannot
  41. >be a-priori labeled BE or LE -- it also handles byte orderings other
  42. >then BE and LE (pdp shorts were LE but longs were half LE half BE)
  43.  
  44. Mine handles that as well, although you would have to use "belong" or
  45. "lelong" with a constant the two halves of which are swapped.
  46.  
  47. >you must provide a duplicate entry for binary cpio, no?
  48.  
  49. Nope.  See above.
  50.  
  51. >what about cpu's with byte swap HW jumpers -- does the format change
  52. >or just the byte order (not a trick question, I really don't know about
  53. >this)
  54.  
  55. It appears, from some of the magic file entries, that the magic number
  56. changes on at least one MIPS object/executable format.
  57.  
  58. Besides, I, at least, would want to know whether something is a
  59. big-endian or little-endian Frobozz executable, not just whether it's a
  60. Frobozz executable or not....
  61.