home *** CD-ROM | disk | FTP | other *** search
- 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
- From: fujii@isl.mei.co.jp (Shigeki Fujii)
- Newsgroups: comp.os.mach
- Subject: Re: wiring down memory
- Message-ID: <FUJII.92Aug19154257@misato.isl.mei.co.jp>
- Date: 19 Aug 92 06:42:57 GMT
- References: <1992Aug18.161726@cs.utwente.nl>
- Sender: news@sonia.isl.mei.co.jp (Usenet News System)
- Organization: Matsushita Electric Industrial CO., Ltd. Osaka, Japan
- Lines: 39
- In-Reply-To: matena@cs.utwente.nl's message of 18 Aug 92 14:17:26 GMT
-
-
- In article <1992Aug18.161726@cs.utwente.nl>,
- matena@cs.utwente.nl (Wim Matena) writes:
-
- Wim> This call returns the much needed 'privileged_host_port'. However, the
- Wim> vm_wire system call still doesn't work properly. It returns the well known
- Wim> 'KERN_FAILURE' error message. Could anyone help us out here?
-
- If you
- set the argument "set_maximum" of vm_protect() to "FALSE", or
- set the argument "access" of vm_wire() to "VM_PROT_READ|VM_PROT_WRITE",
- your program will work properly.
-
- Wim> if (vm_allocate(mach_task_self(), &ptr, 4096, TRUE) !=
- Wim> KERN_SUCCESS) {
-
- Now, the value of current_protection is "VM_PROT_READ | VM_PROT_WRITE",
- and max_protection is "VM_PROT_ALL".
-
- Wim> if (vm_protect(mach_task_self(), ptr, 4096, TRUE, VM_PROT_ALL) != KERN_SUCCESS) {
-
- You set the argument "set_maximum" to "TRUE", so
- the value of max_protection is set to "VM_PROT_ALL" again.
- And current_protection is not changed because it is bellow the max_protection.
-
- If you set the argument "set_maximum" to "FALSE",
- the value of current_protection is changed to "VM_PROT_ALL".
-
- Wim> if ((kr=vm_wire(host_priv_port, mach_task_self(), ptr, 4096, VM_PROT_ALL))
- Wim> != KERN_SUCCESS) {
-
- The argument "access" of vm_wire()(VM_PROT_ALL) is upper
- the current_protection, so vm_wire() fails.
-
- ----
- Shigeki Fujii (fujii@isl.mei.co.jp)
- Media Research Laboratory
- Audio and Video Research Center
- Matsushita Electric Industrial Co., Ltd.
-