home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / sysadmin / 4630 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.2 KB  |  78 lines

  1. Newsgroups: comp.sys.next.sysadmin
  2. Path: sparky!uunet!decwrl!csus.edu!news
  3. From: eps@futon.SFSU.EDU (Eric P. Scott)
  4. Subject: Re: HOSTID fun
  5. Message-ID: <1992Aug13.004125.6072@csus.edu>
  6. Sender: news@csus.edu
  7. Reply-To: eps@cs.sfsu.edu
  8. Organization: San Francisco State University
  9. References: <1992Aug12.154841.26732@midway.uchicago.edu> <1992Aug12.160802.27393@midway.uchicago.edu>
  10. Date: Thu, 13 Aug 1992 00:41:25 GMT
  11. Lines: 65
  12.  
  13. In article <1992Aug12.154841.26732@midway.uchicago.edu>
  14.     eer1@midway.uchicago.edu (Paul Woods) writes:
  15. >According to the man page on "hostid", the hostid can be changed.  so why when
  16. >I try to change it, it tells me that it does not want to let me.  Is it truly
  17. >possible to change it?  I thought that it was.
  18.  
  19. In article <1992Aug12.160802.27393@midway.uchicago.edu>
  20.     eer1@midway.uchicago.edu (Paul Woods) writes:
  21. >The above question was a stupid one.
  22.  
  23. No, it's a good question, but it's come up before (last November).
  24.  
  25. Here's a slightly edited version:
  26.  
  27. NeXT didn't remove sethostid() from the kernel--they merely
  28. munged its dispatch vector in the version of sdmach they
  29. distribute to customers.
  30.  
  31. Every UNIX system call is assigned a number;
  32. sethostid() is #143 <syscall.h>
  33.  
  34. These numbers are used to index into the "sysent" array.
  35. Each element is an 8-byte structure:  <sys/systm.h>
  36.  
  37. struct sysent
  38. {
  39.     short    sy_narg;        /* total number of arguments */
  40.     short    sy_parallel;        /* can execute in parallel */
  41.     int    (*sy_call)();        /* handler */
  42. } sysent[];
  43.  
  44. This is what NeXT ships in 2.x:
  45.  
  46. sysent[143] = { 0, 1, errsys }
  47.   errsys always fails with EINVAL
  48.  
  49. This is what it's supposed to be:
  50.  
  51. sysent[143] = { 1, 1, sethostid }
  52.   this is the code that's supposed to be executed
  53.  
  54. This can be corrected by binary-patching 3 bytes in the kernel:
  55.  
  56. [This is for 2.1 ONLY!!!]
  57. % cmp -l sdmach xxmach
  58. 579602   0   1
  59. 579607 240 217
  60. 579608 214 206
  61. ^^^^^^ ^^^^^^^
  62. decimal  octal
  63.  
  64. Once you make this change, sethostid() will work the way it's
  65. supposed to, and the hostid(1) command will work as documented.
  66.  
  67. |Note that the addresses differ in different kernel versions;
  68. |e.g., for 2.2 it looks like this:
  69. |
  70. |% cmp -l sdmach xxmach
  71. |593462   0   1
  72. |593467 236 215
  73. |593468 100  72
  74.  
  75. [Any of the 3.0 prerelease sites care to comment?]
  76.  
  77.                     -=EPS=-
  78.