home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mach / 1057 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!sun-barr!sh.wide!wnoc-kyo!icspub!oskgate0.mei!chorus.mei!sonia.mei!fujii
  2. From: fujii@isl.mei.co.jp (Shigeki Fujii)
  3. Newsgroups: comp.os.mach
  4. Subject: Re: wiring down memory
  5. Message-ID: <FUJII.92Aug19154257@misato.isl.mei.co.jp>
  6. Date: 19 Aug 92 06:42:57 GMT
  7. References: <1992Aug18.161726@cs.utwente.nl>
  8. Sender: news@sonia.isl.mei.co.jp (Usenet News System)
  9. Organization: Matsushita Electric Industrial CO., Ltd. Osaka, Japan
  10. Lines: 39
  11. In-Reply-To: matena@cs.utwente.nl's message of 18 Aug 92 14:17:26 GMT
  12.  
  13.  
  14. In article <1992Aug18.161726@cs.utwente.nl>,
  15.         matena@cs.utwente.nl (Wim Matena) writes:
  16.  
  17. Wim> This call returns the much needed 'privileged_host_port'. However, the 
  18. Wim> vm_wire system call still doesn't work properly. It returns the well known
  19. Wim> 'KERN_FAILURE' error message. Could anyone help us out here?
  20.  
  21. If you
  22.    set the argument "set_maximum" of vm_protect() to "FALSE", or
  23.    set the argument "access" of vm_wire() to "VM_PROT_READ|VM_PROT_WRITE",
  24. your program will work properly.
  25.  
  26. Wim>     if (vm_allocate(mach_task_self(), &ptr, 4096, TRUE) !=
  27. Wim>         KERN_SUCCESS) {
  28.     
  29. Now, the value of current_protection is "VM_PROT_READ | VM_PROT_WRITE",
  30. and max_protection is "VM_PROT_ALL".
  31.  
  32. Wim> if (vm_protect(mach_task_self(), ptr, 4096, TRUE, VM_PROT_ALL) != KERN_SUCCESS) {
  33.  
  34. You set the argument "set_maximum" to "TRUE", so
  35. the value of max_protection is set to "VM_PROT_ALL" again.
  36. And current_protection is not changed because it is bellow the max_protection.
  37.  
  38. If you set the argument "set_maximum" to "FALSE",
  39. the value of current_protection is changed to "VM_PROT_ALL".
  40.  
  41. Wim> if ((kr=vm_wire(host_priv_port, mach_task_self(), ptr, 4096, VM_PROT_ALL))
  42. Wim>         != KERN_SUCCESS) {
  43.  
  44. The argument "access" of vm_wire()(VM_PROT_ALL) is upper
  45. the current_protection, so vm_wire() fails.
  46.  
  47. ----
  48. Shigeki Fujii (fujii@isl.mei.co.jp)
  49. Media Research Laboratory
  50. Audio and Video Research Center
  51. Matsushita Electric Industrial Co., Ltd.
  52.