How can I change cr0 register in redhat system
hi all: when I change the cr0 register I get a "Segmentation fault (core dumped)". my code is : .data .text .global _start _start: movl %eax, %cr0 this code can work well in ubuntu system when I use root to run it. So what can I do to work it in redhat system? thanks
On Jul 23, 2012, at 9:32 AM, Fan Yang <lljyangfan@gmail.com> wrote:
hi all: when I change the cr0 register I get a "Segmentation fault (core dumped)". my code is :
.data .text .global _start _start: movl %eax, %cr0
this code can work well in ubuntu system when I use root to run it. So what can I do to work it in redhat system? Changing a control register is a privileged operation. You can't do it from the user space. You can only do it from ring 0.
Venkatram Tummala
thanks
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi all I have a certain configuration file which includes other files. Lets say *#include<asm/arch/fileabc.h>* Now under directory *include/asm/* I'm not having any directory as *arch*, instead it is *arch-omap4* and so I also have a link *arch - > arch-omap4* but when I'm building the code, there is error : *fatal error: asm/arch/fileabc.h : No such file or directory* * * *Any problem with the link ?* * * * * Regards Siddharth
On Mon, Jul 23, 2012 at 02:07:41PM +0530, siddharth saxena wrote:
Hi all
I have a certain configuration file which includes other files. Lets say *#include<asm/arch/fileabc.h>*
Where is your "configuration file" located? Is it fileabc.h, or does it include fileabc.h?
Now under directory *include/asm/*
I don't have include/asm/ in my copy of the linux source code (v3.5-rc4), did you add it yourself?
I'm not having any directory as *arch*, instead it is *arch-omap4* and so I also have a link *arch - > arch-omap4*
The thing that looks the most like what you seem to be trying to do is arch/arm/mach-*
but when I'm building the code, there is error : *fatal error: asm/arch/fileabc.h : No such file or directory* * * *Any problem with the link ?*
Which link? If you mean the linker or the linking proccess, then no: It doesn't get that far. HTH, Jonathan Neuschäfer PS: Please don't reply to emails on the mailing list if you're starting a new discussion.
u have to put the asm code in kernel module, and load it via "insmod" and when it execute, it will affect all the processes .....and btw, your version is dangerous....normally people will always query the latest value of Cr0, and then OR with the value they want to modify. below is one that worked: http://stackoverflow.com/questions/3962950/how-to-set-control-register-0-cr0... On Mon, Jul 23, 2012 at 12:00 PM, Fan Yang <lljyangfan@gmail.com> wrote:
hi all: when I change the cr0 register I get a "Segmentation fault (core dumped)". my code is :
.data .text .global _start _start: movl %eax, %cr0
this code can work well in ubuntu system when I use root to run it. So what can I do to work it in redhat system?
thanks
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Regards, Peter Teoh
participants (5)
-
Fan Yang -
Jonathan Neuschäfer -
Peter Teoh -
Ram Tummala -
siddharth saxena