kernel vm question

Brian Fundakowski Feldman green at freebsd.org
Thu Jan 27 11:26:33 PST 2005


On Thu, Jan 27, 2005 at 06:48:56PM +0200, Jacques Fourie wrote:
> Hi,
> 
> Yes, I am trying to patch a piece of code in the kernel. The strange
> thing is that this code works without a problem on FreeBSD 4.8 - has
> the VM system changed to such an extent between 4.8 and 4.9 that the
> pages in the kernel code segment are not writeable anymore?
> 
> Thanks for the bit about the compiler optimization - at least I
> understand that part now :)

They should have never been writable.  You should be able to change that
protection on the page temporarily though to achieve the effect you want;
take a look at e.g. mprotect(), you should be able to do much the same
thing with kernel_map instead.

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the freebsd-hackers mailing list