Re: kernel vm question

2005-01-30 Thread David Schultz
On Fri, Jan 28, 2005, Dag-Erling Smrgrav wrote: > [EMAIL PROTECTED] (Dag-Erling Smørgrav) writes: > > David Schultz <[EMAIL PROTECTED]> writes: > > > When the line is there, the compiler is probably smart enough to > > > realize that 'x=y; y=x' is (usually) a no-op, so it optimizes away > > > both

Re: kernel vm question

2005-01-28 Thread Dag-Erling Smørgrav
[EMAIL PROTECTED] (Dag-Erling Smørgrav) writes: > David Schultz <[EMAIL PROTECTED]> writes: > > When the line is there, the compiler is probably smart enough to > > realize that 'x=y; y=x' is (usually) a no-op, so it optimizes away > > both statements. > Wrong. The compiler is free to optimize awa

Re: kernel vm question

2005-01-28 Thread Dag-Erling Smørgrav
David Schultz <[EMAIL PROTECTED]> writes: > On Thu, Jan 27, 2005, Jacques Fourie wrote: > > unsigned char *p = NULL; > > unsigned char v = 0x55; > > /* ... */ > > p = (unsigned char *)ip_output; > > /* ... */ > > v = p[0]; > > p[0] = v; > > /* ... */ > When the line is there, the compiler is probab

Re: kernel vm question

2005-01-27 Thread Jacques Fourie
Thanks for the reply - I really appreciate it. I have tried to change the protection on the page in a way similar to mprotect() but no luck. I have had a look at what ddb does when modifying kernel code and after applying the same ideas to my code everything works without a problem. The funny thin

Re: kernel vm question

2005-01-27 Thread Brian Fundakowski Feldman
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 th

Re: kernel vm question

2005-01-27 Thread David Schultz
On Thu, Jan 27, 2005, 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 segmen

Re: kernel vm question

2005-01-27 Thread Jacques Fourie
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 t

Re: kernel vm question

2005-01-27 Thread David Schultz
On Thu, Jan 27, 2005, Jacques Fourie wrote: > Hi, > > I have a kernel module with the following entry point : > > static int test_modevent(module_t mod, int type, void *unused) > { > int s; > unsigned char *p = NULL; > unsigned char v = 0x55; > > switch (type) > { > case MOD_LOAD

Re: kernel vm question

2005-01-27 Thread Zera William Holladay
On Thu, 27 Jan 2005, Jacques Fourie wrote: > Hi, > > I have a kernel module with the following entry point : > > static int test_modevent(module_t mod, int type, void *unused) > { >int s; >unsigned char *p = NULL; >unsigned char v = 0x55; > >switch (type) > { > case MOD

kernel vm question

2005-01-27 Thread Jacques Fourie
Hi, I have a kernel module with the following entry point : static int test_modevent(module_t mod, int type, void *unused) { int s; unsigned char *p = NULL; unsigned char v = 0x55; switch (type) { case MOD_LOAD: p = (unsigned char *)ip_output; s = splhigh(); v = p[